Opened 3 years ago
Last modified 4 months ago
#21507 new task
Make sagelib a PyPI package — at Version 13
Reported by: | mkoeppe | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.6 |
Component: | build | Keywords: | pip, PyPI |
Cc: | jdemeyer, was, vbraun, vdelecroix, dimpase, fbissey, embray, leif, aenge, nthiery, mmarco, klee, robertwb, infinity0, thansen, defeo, slelievre, gh-timokau, klui | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
This is a task ticket organizing the steps necessary to eventually provide sagelib via PyPI.
It would be used by a Python user as follows. Let's assume a user has already installed every package that sage-the-distribution provides on their distribution. Then a simple
pip install sagelib
would install sagelib in the user's Python installation. Then the user could do from sage.all import *
.
. . . . . . . . . . . . . . . . .
Here are the first steps:
- #21480: Make
sagelib setup.py
self-contained, independent ofSAGE_ROOT
- #21508: Clean up src/setup.py to bring it to standard distutils behavior
- #21516: Fix sagelib sdist (src/setup.py sdist)
- #21535: Make src/setup.py independent of SAGE_CYTHONIZED
- #21527: Fix symbolic link to thebe.js
This defines milestone 1. sagelib
is now a well-behaved Python package. It can be built and installed as follows (without invoking sage -sh
):
export SAGE_LOCAL=/path/to/local/hierarchy/populated/by/sage/distribution export SAGE_PKGS=/path/to/sage/distribution/source/directory/build/pkgs $SAGE_LOCAL/bin/python setup.py install # or pip install .
. . . . . . . . . . . . . . . . .
Next steps:
- Remove the dependency on the environment variable SAGE_PKGS (#20382, ...)
This defines milestone 2. sagelib
can now be built and installed as follows (without invoking sage -sh
):
export SAGE_LOCAL=/path/to/local/hierarchy/populated/by/sage/distribution $SAGE_LOCAL/bin/python setup.py install # or pip install .
. . . . . . . . . . . . . . . . .
Next steps:
- Remove the dependency on the SAGE_LOCAL environment variable
- #15105: hardwired paths in src/sage
- ...
This defines milestone 3. If SAGE_LOCAL is not set, then sagelib will discover system packages and Python packages installed in standard places.
python setup.py install # or pip install .
At this point, sagelib will be ready for upload to PyPI.
Change History (13)
comment:1 Changed 3 years ago by
- Cc was vbraun vdelecroix dimpase added
- Description modified (diff)
comment:2 Changed 3 years ago by
- Cc fbissey embray leif added
- Description modified (diff)
comment:3 Changed 3 years ago by
- Description modified (diff)
comment:4 Changed 3 years ago by
- Milestone changed from sage-7.4 to sage-7.5
comment:5 Changed 3 years ago by
- Description modified (diff)
comment:6 Changed 3 years ago by
- Description modified (diff)
comment:7 Changed 3 years ago by
- Description modified (diff)
comment:8 Changed 3 years ago by
- Cc aenge nthiery added
comment:9 Changed 3 years ago by
- Cc mmarco klee robertwb added
comment:10 follow-up: ↓ 11 Changed 3 years ago by
comment:11 in reply to: ↑ 10 Changed 3 years ago by
Replying to embray:
There's more still be to added to the list of issues, such as providing binary wheels and how that will be handled.
Definitely. I'm hoping that we can use this ticket to organize it.
I think it will be important to also make more progress on making some hard dependencies optional (that is, allow optional features to fail gracefully if a dependency for that feature is not found).
I agree.
comment:12 Changed 3 years ago by
Here's a question for the distutils experts. Is a Python package allowed to install things in bin/
? Do any other Python packages do that?
Where would one install helper scripts? Is there a Python equivalent of $prefix/libexec
?
comment:13 Changed 3 years ago by
- Description modified (diff)
Thanks for taking the lead on this. There's more still be to added to the list of issues, such as providing binary wheels and how that will be handled. I think it will be important to also make more progress on making some hard dependencies optional (that is, allow optional features to fail gracefully if a dependency for that feature is not found).