Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: python3-typst #47044

Closed
Eloitor opened this issue Nov 3, 2023 · 7 comments
Closed

Package request: python3-typst #47044

Eloitor opened this issue Nov 3, 2023 · 7 comments
Labels
request Package request

Comments

@Eloitor
Copy link
Contributor

Eloitor commented Nov 3, 2023

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

@Eloitor Eloitor added the request Package request label Nov 3, 2023
@tornaria
Copy link
Contributor

tornaria commented Dec 7, 2023

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])

?

@classabbyamp
Copy link
Member

classabbyamp commented Dec 7, 2023

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

@tornaria
Copy link
Contributor

tornaria commented Dec 7, 2023

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.

@sgn
Copy link
Member

sgn commented Dec 7, 2023

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.

@classabbyamp
Copy link
Member

I was more referring to the native rust library for typst, which is a lot more flexible than these bindings, it seems.

@Eloitor
Copy link
Contributor Author

Eloitor commented Dec 7, 2023

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...

@sgn
Copy link
Member

sgn commented Dec 7, 2023

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 on typst...

Wait until Rust can have stable ABI, which means never. :-p

@Eloitor Eloitor closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Package request
Projects
None yet
Development

No branches or pull requests

4 participants