-
-
Notifications
You must be signed in to change notification settings - Fork 613
sdh_pip_install: Force reinstallation of built wheels; add sage_setup source deps #32659
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
Comments
comment:1
A solution provided by pypa/pip#9147 (was merged in pip 20.3) is to use a specification |
Commit: |
comment:3
Unfortunately this does not fix the issue:
New commits:
|
comment:4
This behavior of pip is subject to current discussion/development - Un-deprecate source distribution re-installation behaviour Rewrite direct URL reinstallation logic by uranusjr Updating remote links with new URLs for PEP508 functionallity |
comment:5
Another possible workaround is proposed in pypa/pip#8711 (comment) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
Unfortunately also that does not fix the issue:
|
comment:8
Also another approach, providing a diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers
index 4a8862d50f..e7b8fc8677 100644
--- a/build/bin/sage-dist-helpers
+++ b/build/bin/sage-dist-helpers
@@ -271,7 +271,20 @@ sdh_store_wheel() {
mkdir -p "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}" && \
$sudo mv "$wheel" "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/" || \
sdh_die "Error storing $wheel"
+ wheel_basename="${wheel##*/}"
wheel="${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/${wheel##*/}"
+ # Trac #32659: pip no longer reinstalls local wheels if the version is the same.
+ # Because neither (1) applying patches nor (2) local changes (in the case
+ # of sage-conf, sage-setup, etc.) bump the version number, we need to
+ # override this behavior. The pip install option --force-reinstall does too
+ # much -- it also reinstalls all dependencies, which we do not want.
+ # We override it by specifying the hash -- but this can only be done using a
+ # requirements file, not using flags on the command line,
+ # https://github.com/pypa/pip/issues/3257
+ distname="${wheel_basename%%-*}"
+ hasharg=$(python3 -m pip hash "$wheel" | sed -n /--hash=/p)
+ requirements_file="${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/requirements-$distname.txt"
+ echo "$distname @ file://$wheel $hasharg" | $sudo tee $requirements_file > /dev/null
}
sdh_store_and_pip_install_wheel() {
@@ -306,7 +319,7 @@ sdh_store_and_pip_install_wheel() {
local sudo=""
local root=""
fi
- $sudo sage-pip-install $root $pip_options "$wheel" || \
+ $sudo sage-pip-install $root $pip_options -v -v -v -r "$requirements_file" || \
sdh_die "Error installing ${wheel##*/}"
if [ -n "${SAGE_PKG_DIR}" ]; then
# Record name of installed distribution name for uninstallation. It still says:
|
comment:9
I think we will need either pypa/pip#10564 (and use |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Matthias Koeppe |
This comment has been minimized.
This comment has been minimized.
comment:14
A new pip version is out (#32671); it makes some changes closely related to this issue but does not solve anything. Needs review |
comment:15
Is it intended that |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
Looks like I introduced |
comment:18
Thanks, looks good to me. |
Reviewer: Lorenz Panny |
comment:19
Thanks for reviewing! |
Changed branch from u/mkoeppe/sdh_pip_install__force_reinstallation_of_built_wheels to |
Changed commit from |
Replying to [ticket:32659 Matthias Köppe]:
This discussion is still ongoing and has moved to pypa/pip#10564 (most recent activity: June 2022) |
After #32492, we may get
Because of this behavior of pip, some configuration changes made in
configure
will not be updated in an incremental build. Likewise for other Python packages when we add a patch, or forsage-setup
when we edit files there (as happened in #32607).However, as discussed in pypa/pip#8711, the
pip install
option--force-reinstall
does too much -- it also reinstalls all dependencies, which we definitely do not want.Instead, we just use
pip uninstall
beforepip install
.We also add some dependencies on source files to
sage_setup
. This is also for #32607.CC: @jhpalmieri @vbraun @yyyyx4
Component: build
Author: Matthias Koeppe
Branch:
d435781
Reviewer: Lorenz Panny
Issue created by migration from https://trac.sagemath.org/ticket/32659
The text was updated successfully, but these errors were encountered: