On Tuesday, April 23, 2024 at 11:06:12 AM UTC-7 Dima Pasechnik wrote:


On 23 April 2024 18:41:34 BST, Matthias Koeppe <matthia...@gmail.com> 
wrote: 
>*$ git blame src/sage/combinat//designs/block_design.py* 
> 
>fdbe7f7e3348 (Matthias Koeppe 2023-07-12 10:53:08 -0700 65) 
>lazy_import('sage.libs.gap.libgap', 'libgap') 
>fdbe7f7e3348 (Matthias Koeppe 2023-07-12 10:53:08 -0700 66) 
>lazy_import('sage.matrix.matrix_space', 'MatrixSpace') 
>fdbe7f7e3348 (Matthias Koeppe 2023-07-12 10:53:08 -0700 67) 
>lazy_import('sage.modules.free_module', 'VectorSpace') 
>fdbe7f7e3348 (Matthias Koeppe 2023-07-12 10:53:08 -0700 68) 
>lazy_import('sage.rings.finite_rings.finite_field_constructor', 
>'FiniteField') 
> 
>What you see there is the result of work in the modularization project, 
>using one of the techniques documented 
>in 
https://doc.sagemath.org/html/en/developer/packaging_sage_library.html#dependencies-and-distribution-packages
 
>("Reducing module-level run-time dependencies:") to reduce dependencies or 
>to make dependencies milder. 

The problem is that without these imports, lazy or not, this module is 
basically useless.


That's correct, but that's not a "problem". 

It's part of a deliberate design, explained in detail in my 2023-06 
sage-devel posts. 

>From "*Modularization project: IV. The rules*" 
(https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s):
*3.* Distribution packages declare build dependencies and runtime 
dependencies 
<https://sagemath-tobias.netlify.app/developer/packaging_sage_library.html#dependencies-and-distribution-packages>
 (on 
other Python distribution packages). These two can be entirely unrelated to 
each other. In addition to the runtime dependencies, it is possible to 
declare extra dependencies – either those necessary for running tests 
<https://sagemath-tobias.netlify.app/developer/packaging_sage_library.html#doctest-only-dependencies>
 or 
for providing advertised  
<https://sagemath-tobias.netlify.app/developer/packaging_sage_library.html#other-runtime-dependencies>
extra  
<https://sagemath-tobias.netlify.app/developer/packaging_sage_library.html#other-runtime-dependencies>
features 
<https://sagemath-tobias.netlify.app/developer/packaging_sage_library.html#other-runtime-dependencies>.
 
But there is no such thing as an "optional build dependency" or 
"conditional compilation". The set of modules that form a distribution 
package is static. There is no place in the name (or metadata) of a wheel 
package that could indicate different "configurations".

*4. *As a result of 3, it is possible to create distributions that contain 
some modules that cannot be imported because some of their dependencies are 
missing. That's OK; they can become importable simply by the presence of 
other distributions, in particular those declared as extra dependencies. 
All of this is discovered at the time of importing a module; there is no 
ahead-of-time linking step of any sort.

>From "*Modularization project: V. The blocs*" 
(https://groups.google.com/g/sage-devel/c/kiB32zP3xD4):
*We should not attempt to define a distribution package for every possible 
community or subfield of mathematics that Sage supports.*
The proposed design instead introduces 3 types of distribution packages: 
[...]
Each of the distribution packages can define a list of extras (nicknames 
for sets of other distribution packages that provide additional advertised 
features). When using pip to install a distribution, users can use square 
bracket notation to add (adjoin?) these extras.


-- 
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/66e08815-08bc-439f-be60-af476b7185a7n%40googlegroups.com.

Reply via email to