Closed Eloitor closed 7 months ago
What is this good for?
How is
import typst
typst.compile(in, output=out)
any different than
import subprocess
subprocess.run(["typst", "compile", in, out])
?
i would assume typst-as-a-library has a more flexible of an api than shelling out, not to mention probably being faster
the package in question is pyo3 bindings not just a library that runs shell commands
i would assume typst-as-a-library has a more flexible of an api than shelling out, not to mention probably being faster
the package in question is pyo3 bindings not just a library that runs shell commands
All it seems to have is a compile()
function, and it only takes a filename as input. It doesn't even support query metadata afaict.
Template is easy if you want to try it:
# Template file for 'python3-typst'
pkgname=python3-typst
version=0.10.0
revision=1
build_style=python3-pep517
build_helper=rust
hostmakedepends="cargo maturin"
depends="python3"
short_desc="Python binding to typst"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="Apache-2.0"
homepage="https://github.com/messense/typst-py"
distfiles="${PYPI_SITE}/t/typst/typst-${version}.tar.gz"
checksum=37853d0938db054cfa9d00aa574d4eac2985af6e7396a59c521a76e9e6bdf020
make_check=no # there are no tests
I'm honestly not sure its worth shipping, but I don't mind making a PR if you think it's worthwhile.
Note that the whole of typst (and dependencies) seem to be vendored in, so the pkg will be roughly the same size as typst
itself.
i would assume typst-as-a-library has a more flexible of an api than shelling out
It's worst in every way. It only exposes a single compile
functions, without those options that exposed by the shell commands. My opinion, ignore this package.
I was more referring to the native rust library for typst, which is a lot more flexible than these bindings, it seems.
Note that the whole of typst (and dependencies) seem to be vendored in, so the pkg will be roughly the same size as
typst
itself.
This is what I noticed while trying (without success) to write the template myself. I asked for this package thinking that maybe there is a way to make python3-typst
depend on typst
...
I was more referring to the native rust library for typst, which is a lot more flexible than these bindings, it seems.
Flexible or not, if it's not exposed, it's useless. Worse, the current state of Rust ecosystem, everything is static-linked, which brings more burden in maintaining.
I asked for this package thinking that maybe there is a way to make
python3-typst
depend ontypst
...
Wait until Rust can have stable ABI, which means never. :-p
Package name
python3-typst
Package homepage
https://github.com/messense/typst-py
Description
Python binding to typst.
Does the requested package meet the package requirements?
System, Compiled
Is the requested package released?
Yes