-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Create PEP 503 simple repository for wheels built during installation #30527
Comments
comment:1
|
Dependencies: #29500 |
comment:3
There is also pypiserver, see eg https://stackoverflow.com/a/51528588/873661 for how to use it with pipenv |
comment:4
Well, we don't want to run a server for this, but following this link I found https://github.com/wolever/pip2pi |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:7
Yeah I agree, a server is not required (although the overhead of creating a simple server on listing on localhost should be pretty minimal). If pip2pi works with pipenv and pip, then that's perfect! |
New commits:
|
Author: Matthias Koeppe |
Commit: |
comment:10
What is the reason that sage needs to build wheels for standard packages, and not just downloads them from pypi? Is it because some packages have patches applied? In this case, I would propose to migrate these patches to proper forks of the packages which are then published to pypi including their wheel. This has a few advantages, mainly that the build of sage is speedup and simplified, and that the wider python community can profit from these patches. What do you think? |
comment:11
Replying to @tobiasdiez:
Sage-the-distribution is a deployment mechanism. Compiling all packages from source gives us full control and eliminates possible ABI problems from mixing prebuilt wheels that were compiled on different systems. Building from source also has advantages such as generating architecture-specific code (see #27122).
In some cases, yes, in other cases, just specific configuration.
We don't have intentions to take over maintenance of these packages. Whenever possible, we send our patches upstream. In many cases, it is just a matter of mismatched release schedules, and we have to keep patches only for a limited time until upstream makes a new stable release including a particular patch. For example, consider the |
comment:12
Thanks for the detailed explanation. Makes things clearer for me now.
But isn't the concept of compile-once-reuse-often the main point of wheels? By design, it's the responsibility of the the maintainer (= publisher of the wheel) that the wheel is useable and optimized for the particular platforms they are published. This also make sense since she is the export of the code of the library. I feel none of the advantages of wheels outlined in https://www.python.org/dev/peps/pep-0427/ can really prove effective if wheels are rebuilt from code every time.
In my opinion, the build process of sage would immensely profit from all these advantages. Anyway, this discussion is somewhat orthogonal to this ticket (sorry!). So concerning the changes, the code looks good to me. I'm only wondering if the pip2 support in the uninstallation script is really necessary (since only python3 is supported now). However, I don't feel familiar enough with the build script to change the status to positive review. |
Reviewer: Tobias Diez, |
comment:13
Replying to @tobiasdiez:
In practice, wheels are offered on PyPI with the broadest possible platform compatibility, typically using https://github.com/pypa/manylinux -- this is the opposite of "optimized". |
comment:14
Replying to @tobiasdiez:
Yes, this should be removed, but I prefer to keep tickets narrowly focused. A separate ticket can do this. |
comment:15
Replying to @tobiasdiez:
Wheels are a format for deployment. Public distribution of wheels on a package index is one use case. Here on this ticket we use it for local deployment -- users can installs these wheels into their venvs. |
comment:16
Replying to @tobiasdiez:
I prefer to think about this not as a question of improving "the" build process of sage, but to offer more options for building sage. This is for example also the purpose of the modularization plan outlined in #29705 - make modularized parts of the Sage library deployable via PyPI. |
Changed reviewer from Tobias Diez, to Tobias Diez, ... |
comment:18
Replying to @mkoeppe:
It's added in the new file |
comment:19
Ok, I'll clean it up - but in #29500 (dependency of this ticket) |
This comment has been minimized.
This comment has been minimized.
comment:26
Thank you! |
comment:27
Looks like some script is silently ignoring errors (and there is an error, too):
Also docbuild fails on buildbots but not on my machine with
|
comment:29
Replying to @vbraun:
Looks like this package is not ready for Python 3.8, wolever/pip2pi#111 |
comment:30
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:34
Replying to @vbraun:
To debug this on the affected buildbots, it should be checked whether the file |
Changed keywords from none to sd111 |
comment:36
Waiting for review |
comment:37
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:38
Setting a new milestone for this ticket based on a cursory review. |
comment:39
I tried
|
comment:40
Thanks for testing. Looks like this now needs updating to the recent build system changes (probably the SAGE_LOCAL/SAGE_VENV split). There's no urgency to this ticket because I learned that one can use |
Closing as unnecessary |
As a follow-up to #29500 (Install all Python packages via
pip wheel
, store wheels in$SAGE_LOCAL/var/lib/sage/wheels
):We create a PEP 503 compliant Simple Repository index in
$SAGE_SPKG_WHEELS
. Then users can create their virtual environment using tools such aspipenv
[[source]]
orpip install --index-url
.We do this using the command
dir2pi
from https://pypi.org/project/pip2pi/Follow-up:
src/requirements.txt
for installation ofsagelib
in a venvReferences:
Implement pep 503 Simple Repository API for deployment pytorch/pytorch#25639 "Implement pep 503 Simple Repository API for deployment"
https://pypi.org/project/piprepo/ - create PEP 503 package repo
https://stackoverflow.com/questions/45744937/how-do-install-packages-from-a-local-python-package-index
https://pipenv-fork.readthedocs.io/en/latest/advanced.html#specifying-package-indexes
CC: @slel @tobiasdiez @embray @jhpalmieri
Component: build
Keywords: sd111
Author: Matthias Koeppe
Branch/Commit: u/mkoeppe/pep-503-simple-repository-for-wheels @
333e50c
Reviewer: Tobias Diez
Issue created by migration from https://trac.sagemath.org/ticket/30527
The text was updated successfully, but these errors were encountered: