-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
New ABC sage.structure.element.NumberFieldElement, deprecate is_NumberFieldElement #35100
New ABC sage.structure.element.NumberFieldElement, deprecate is_NumberFieldElement #35100
Conversation
…with deprecation warning
…mberfieldelement__deprecate_is_numberfieldelement SageMath version 10.0.beta0, Release Date: 2023-02-12
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #35100 +/- ##
===========================================
+ Coverage 88.57% 88.58% +0.01%
===========================================
Files 2140 2140
Lines 397273 397108 -165
===========================================
- Hits 351891 351793 -98
+ Misses 45382 45315 -67
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…mberfieldelement__deprecate_is_numberfieldelement
…for_namespace_packages' into t/34931/new_abc_sage_structure_element_numberfieldelement__deprecate_is_numberfieldelement
…sage_structure_element_numberfieldelement__deprecate_is_numberfieldelement
By the way, did you see #34931 (comment)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM.
I did, but I don't know which is better either. At this point, I think it is best to keep with the same pattern as it makes it easier to refactor stuff later on if something changes. |
same pattern as what? |
As the other ABCEDFITs by being in |
Note that in #35076 (for |
I forgot that. Hmm...then perhaps we should put it into its own little file. I am worried a bit about bloat within |
OK, then I'll make this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM.
…mberfieldelement__deprecate_is_numberfieldelement
…output (trac->github)
Documentation preview for this PR is ready! 🎉 |
…mberfieldelement__deprecate_is_numberfieldelement SageMath version 10.0.beta3, Release Date: 2023-03-02
@mkoeppe : for some reason I don't understand, the removal of $ PYTHONPATH=pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311 python
Python 3.11.2 (main, Feb 8 2023, 14:30:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.rings.number_field.number_field_element_base
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sage.rings.number_field.number_field_element_base'
>>>
$ touch pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/rings/number_field/__init__.py
$ PYTHONPATH=pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311 python
Python 3.11.2 (main, Feb 8 2023, 14:30:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.rings.number_field.number_field_element_base
>>> I'm doing it here with plain python, but the same thing happens with sage. There are lots of empty
|
This is what I think happens:
If I'm correct, this explains why only In other words, a system install of sagemath will "shadow" a user install; in principle this shouldn't be an issue, except when the user install is missing a module python will pick it from the system install. The only way to avoid this seems to be to keep empty modules to 'hide" the corresponding system modules. |
Yes, ordinary packages shadow namespace packages. A configuration in which an old version of Sage is installed in system site-packages cannot be reliably supported. |
According to https://docs.python.org/3/tutorial/modules.html#packages:
Since If you agree, I'll PR adding back the empty
I don't see why. I've been running development sage-the-library for a while without issues. Note that the problem here arises only because the empty In other words, we have to make sure that everything that the sage library may want to import actually exists in our local installation. I.e. every module but also the whole path of packages containing it. |
No, this is no longer true since PEP 420. Read https://doc.sagemath.org/html/en/developer/packaging_sage_library.html#ordinary-packages-vs-implicit-namespace-packages |
I fail to see why you needed to remove
You are not moving these modules to a separate package, are you? They are still part of If kind of silly to modularize sage-the-library breaking it in smaller more manageable parts, if making system packages for those parts is not supported. The whole point of installing sage-the-library in the system site-packages is so that it can be imported from regular python. At least I thought that was the plan... If you really need to remove those These are the directories that may be missing
The last one is a false positive, but all the others seem reasonable to me. I don't quite care if the packages have or not |
Yes, I am moving some of the contained modules to separate distributions. Technology preview: #35095 – this enlarges the distribution sagemath-categories to include a bit from each of these 3 namespace packages. See https://github.com/sagemath/sage/blob/2b264b236844b196e360de300701fbe5fc977636/pkgs/sagemath-categories/MANIFEST.in.m4 |
Yes, at the moment sagemath-standard is still monolithic. But #34587 makes sagemath-standard depend on subset distributions such as sagemath-categories. |
Is this happening for 10.0? If not, can we just keep these at least until 10.0 is released? Better yet, can you remove them as part of the actual move to separate distributions? I assume that will be a lot of pain for distributions, we may as well get all the pain at the same time. Maybe I'll get my sagemath package stuck at 10.0 forever. Another thought: why is it so important to remove I still fail to see what problem this is solving. |
No. If any distribution ships an |
I don't know what's special about 10.0 |
The modularization solves the problem that nobody can install and use parts of Sage without pulling in gigabytes of non-pip-installable dependencies. |
I do agree that some synchronization may help – because the issue that you have reported arises from the transition to namespace packages; it is not a problem by itself. |
Nothing special, I'm just saying don't break releases if the PR that need this are not going to be merged.
That's what distros are for. The sagemath package in void linux is just 50M compressed (builds in 10 minutes from 28M source). What is the advantage of shipping it in separate chunks, if they are developed together and they can't be updated separately?
Now, that's constructive. Let's do it explicitly and knowing we break stuff. What about this: Maybe if there was an easy and well documented way to install sage-the-library system wide (e.g. for a distro) we could impose some policy to distro-packages (like not installing the empty Let me ask you a question in the opposite direction: do you know why are all those empty |
There are lots of people out there who don't use distro Python. Basically, if something is not pip-installable, it's not usable as an upstream for other Python projects. |
By the way, does Void have any mechanism for users to make Python venvs that mix a defined set of Void-packaged Python distribution packages with pip-installed Python packages? |
There is no technical need for any of the empty
|
This causes a lot of grief, see sagemath#35100 (comment)
📚 Description
Fixes #34931
📝 Checklist
⌛ Dependencies
Depends on #35033