I have created https://gitlab.com/mathzeta2/zetalib whose purpose is to be a pip-installable SageMath package of Zeta. It is mostly Python, but has one Cython file and one C file. I hope it works... any issues or suggestions are welcome.

It is also based on (an old fork of) sage_sample, and I am sure there are better ways to do some of the packaging acrobatics in there.

Currently to install zetalib, first install the dependencies:
$ sage -i latte_int
$ sage -i normaliz
or you can have them installed from elsewhere (you can later manually change the dependencies' commands being called) and then run
$ sage -pip install zetalib # Will compile the .c file

In the future it might be better to make zetalib into a Sage experimental package, so one could just run
$ sage -i zetalib
which will list latte_int and normaliz as dependencies, automatically install them and then fetch zetalib from PyPI. I think there are patchbots that test with many optional packages installed, which is a good way to catch regressions, instead of letting old packages rot.

Off-topic tip: The zetalib tarball on PyPI includes the generated .c file of the .pyx file (and the .pyx file), so users will only need a C compiler to install it. I am not sure this is relevant to Sage packages, because Cython is always included.

Regards,
TB

On 09/07/2020 10:38, Nico Van Cleemput wrote:
Thanks. I had been googling again yesterday, but still hadn't found any concrete examples, so I had started reading the full documentation of packaging for Python. This example will help me focus that effort a lot.

Cheers
Nico

Op do 9 jul. 2020 om 09:33 schreef Markus Wageringel <[email protected]>:
One example is https://github.com/mwageringel/fgb_sage, which is a small wrapper for an external C binary and which uses sage_sample as a template. The relevant part is the setup.py file, which downloads the external files and makes them available for compiling the Cython code. It does not use pipx (which I do not know about), but is implemented in a somewhat ad-hoc fashion, so probably this is not the optimal way to achieve this but could be streamlined a bit.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/33bca7b6-33d9-4ae2-a734-e809ec5f120co%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CADXCEk9uuXEPwg69a4--U1SEMOE01VgvG%2ByAF-5X-iD6Vtz94Q%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6461b35d-919c-ae43-155c-9338bf81e877%40gmail.com.

Reply via email to