On Friday, February 16, 2024 at 6:26:32 PM UTC-8 Kwankyu Lee wrote:

 

By default the package content would be fetched, as pip does,


Not just as pip does, but by actually calling "pip" to contact PyPI.
 

and that would mean the default configuration for sage would require 
internet at install time.


That's right.


Then Dima's proposal implies assuming internet at install time. Right? 


Yes.

But one can make "pip" work with some local directory for the packages it 
considers instead of using PyPI over the Internet:
We can use "pip install --no-index --find-links=/SOME/LOCAL/DIRECTORY ...". 
See https://pip.pypa.io/en/stable/cli/pip_install/#finding-packages

As all pip options can also be provided systematically via environment 
variables, we can also set "PIP_NO_INDEX=true" and 
"PIP_FIND_LINKS=/SOME/LOCAL/DIRECTORY" for the same effect. Then one does 
not need to change the invocations of pip.

In fact, we already do exactly this in the Sage distribution for a slightly 
different purpose, namely when we build "normal" Python packages and 
"script" Python packages (= packages whose source trees are part of the 
repository, such as 
https://github.com/sagemath/sage/tree/develop/pkgs/sagemath-bliss), see 
https://github.com/sagemath/sage/blob/develop/build/pkgs/sagemath_objects/spkg-install.in#L3

We do this because, following modern Python build practices, we build most 
packages with "build isolation". The build-time prerequisites are not 
accessed from the normal Sage venv but are specifically installed in a 
temporary environment just for the build of the specific package. The 
prerequisites are installed from wheel files in venv/var/lib/sage/wheels/; 
this directory is referred to by the variable $SAGE_SPKG_WHEELS.

(Where do the wheel files in venv/var/lib/sage/wheels/ come from? Either 
(1) we have built them ahead of time and stored them there; or (2) they are 
platform-independent wheels and we have found them in the directory 
upstream/, downloaded them from GH Release assets, downloaded them from 
Sage mirrors, or the upstream_url (= PyPI).)

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/069c83d2-b54b-4026-96cc-8c01be13289dn%40googlegroups.com.

Reply via email to