-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Replace relative imports by absolute ones in sage.{algebras,arith,categories,cpython,data_structures,misc,modular,rings,sat,symbolic}
#36666
Conversation
So you don't want to resolve merge conflicts with your PR, but instead force me to do it?! |
Tobias, I know that you know all of the following -- but I'll explain it for the audience: |
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.
LGTM and passes tests on Fedora 35.
And how is that helping with these PRs being in conflict with #35095? You have to resolve these conflicts eventually so why not now? |
Tobias, again you are abusing your privileges as a member of the Triage group. |
I'm a little puzzled by the goal here. If I do |
In the meantime, is the main disagreement about which changes get merged first? The other branches have been rebased on top of this one, so why not proceed with this one? |
Sorry, just clicked the wrong button. Didn't meant to close the pr |
Only relative Changes to This PR is a cherry-pick from my branch in #35095, the three commits indicated #36572 (comment), with any conflicts in cherry picking resolved to "no change". |
Got it, thank you. The changes look good to me, too, so I will echo the approval from @dcoudert. |
Of course, I can always open a PR that contains various subsets of changes proposed in other PRs. But there is only value in doing this if there is a problem with the original PRs (otherwise these other PRs could be directly merged). The only problem that has been pointed out so far is that Matthias doesn't want to resolve the merge conflicts in 'all.py' files introduced in these PRs. But someone has to resolve this conflicts at some point, so why not do it now? |
Aren't the only existing conflicts with #35095? Since Matthias is responsible for that branch, he is capable of handling any merge conflicts there when he is ready to do so. I would not be surprised, though, if I don't have the full picture, so please explain what I might be missing. |
Yes, that's why I'm also not understanding the purpose of this PR here. Matthias, could you please explain to us your envisioned strategy to resolve the conflicts between #35095 and my PRs, and how this PR here is needed for this. As an explanation of why I'm so negative about this PR here, is that I'm seeing it as being part of the following 'strategy' (in fact, the only reason that I can see of why Matthias opened this PR is to exactly enable this strategy):
|
I think this is a gratuitous request for information. It has been explained already: It is a "common denominator PR". This is a standard maintainer technique for achieving development velocity. By merging it in "develop", it reduces the size of diffs of the related PRs, thus facilitating review of all of these PRs. |
If they directly conflict with what he's doing, that's something that needs to be resolved. If they can be merged independently of what he's doing, then others can approve them and they can get merged. When you say that they are no longer relevant, it sounds like we're in the latter situation.
When the time comes, I am willing to help resolve the merge conflicts. Ping me. |
It's all green, so let's get this in |
Thanks! |
That is only one of the points in #36666 (comment). |
Would you clarify for us: Do you mean that you are also doubling down on your false claim of authorship (the 2nd point in your list)? |
@tobiasdiez My question does require an answer. |
Sorry, I read that as a rhetoric question. We both know that I didn't authored these commits, and I never claimed I did. Your little rebase experiment should have convinced you that (all?/most of?) your changes here were already contained in my PRs. So I think a bit of attribution does not hurt. |
Yes, we both do know that.
As part of setting the status back to "needs work", you demanded in #36666 (comment):
Using the word "proper" here means that you were accusing me of improperly withholding attribution.
That's patronizing language, unwelcome here.
Here again you are writing to mislead the public. When you opened #36572 on Oct 29, the same day I informed you in #36572 (comment) that I made the changes to the Cython files already in #35095 for the whole Sage library. (On Oct 30, I added the precise commits to this comment for reference.) On Oct 30, nevertheless you opened #36588 and #36589, which overlap with my changes. (Apparently you were unconcerned about attribution at that time!) On Nov 3, I informed you in #36588 (comment) and #36589 (comment) that "The only thing that is needed to solve the problem with Cython is to take care of relative cimports, not imports. Doing this in one PR creates lots of gratuitous merge conflicts with #35095." (Note that I did not demand any changes.) You responded in #36588 (comment): "my main motivation is making it work with pytest. For this the normal imports have to be changed as well." (You seemed unconcerned about my workload of resolving the resulting merge conflicts: "I'm sorry for the merge conflicts, but they should be easy to resolve.") I opened the present PR, which is cherry-picked carefully from #35095 and does not create merge conflicts. The rest can be read above. |
Documentation preview for this PR (built with commit b2222c3; changes) is ready! 🎉 |
Regarding point 4 of #36666 (comment),
... last week Tobias undid the rebase of the branches of #36572, #36588, #36589, and today his original branches have been merged into develop. |
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> This makes the CI conda pass by marking affected files as "known baseline failures", thus reducing the noise that this workflow makes on PRs (including sagemath#36666 (comment)) Less intrusive version of sagemath#36372. In addition to the failure marked there, here we collect a number of more failures observed over the course of a week in https://github.com/sagemath/sage/actions/workflows/ci- conda.yml?query=is%3Acompleted <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36678 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Tobias Diez
…e relative by absolute imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We restructure the `all.py` files for modularization. Guided by the technical constraints outlined in https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s, sagemath#35095 defines distribution packages (pip-installable packages) **sagemath-{brial, combinat, eclib, flint, gap, giac, glpk, graphs, groups, homfly, lcalc, libbraiding, libecm, linbox, modules, mpmath, ntl, pari, plot, polyhedra, schemes, singular, standard-no-symbolics, symbolics}**. When a namespace package such as `sage.misc` is filled by modules from several distribution packages, we create modules named: - `src/sage/misc/all__sagemath_environment.py` - `src/sage/misc/all__sagemath_objects.py` - `src/sage/misc/all__sagemath_repl.py` Import statements are moved from `src/sage/misc/all.py` to these files as appropriate, and `src/sage/misc/all.py` imports `*` from there. Also some imports are replaced by lazy imports. The new files provide the top level namespaces for the modularized distribution packages, thus [enabling modularized testing](https://doc.s agemath.org/html/en/developer/packaging_sage_library.html#testing- distribution-packages). This design was introduced in sagemath#29865 (merged in Jan 2022, early in the Sage 9.6 development cycle). <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Copied from sagemath#35095. - Part of sagemath#29705 Moreover, applied a one-line command to replace relative by absolute imports, thus complementing sagemath#36666, which does not touch `.all*` files. The changes to other files in `sage.modules` etc. come from the PRs sagemath#36597, sagemath#36572, sagemath#36588, sagemath#36589 merged here and do not need review. <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36597 (merged here to resolve merge conflict) - Depends on sagemath#36572 (merged here to resolve merge conflict) - Depends on sagemath#36588 (merged here to resolve merge conflict) - Depends on sagemath#36589 (merged here to resolve merge conflict) - Depends on sagemath#36449 (merged here to resolve merge conflict) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36676 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri, Matthias Köppe, Tobias Diez
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> Author: @mkoeppe, based on @tobiasdiez's config in sagemath#36503. Adding a configuration for the ruff linter as proposed in sagemath#36503 is timely and uncontroversial. However, sagemath#36503 bundled this gratuitously with the controversial design of creating a `pyproject.toml` file in SAGE_ROOT. `pyproject.toml` -- by definition in PEP 518, PEP 621 -- marks a directory as a Python project, i.e., the source directory of a Python distribution package (sagemath#36503 (comment)). Generalizing the use of `pyproject.toml` to "[non-package projects](https://peps.python.org/pep-0735/#motivation)" is still subject to discussion in the Python community in [PEP 735](https://peps.python.org/pep-0735/) (Nov 2023). **The scope of PRs should be chosen to minimize friction, not to maximize friction.** sagemath#36726 (comment) Here we remove the artificial friction from the gratuitous bundling, by configuring ruff in `ruff.toml` instead. Configuration in ruff.toml and pyproject.toml has equal validity / standing per [ruff documentation](https://docs.astral.sh/ruff/configuration/#config-file- discovery). And this is the location of most of our other linter configuration files. Reference on previous common denominator PRs: sagemath#36666 (comment), sagemath#36666 (comment), sagemath#36572 (comment), sagemath#36960 (comment), sagemath#36960 (comment), ... <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37452 Reported by: Matthias Köppe Reviewer(s): Giacomo Pope, Matthias Köppe
…e relative by absolute imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We restructure the `all.py` files for modularization. Guided by the technical constraints outlined in https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s, sagemath#35095 defines distribution packages (pip-installable packages) **sagemath-{brial, combinat, eclib, flint, gap, giac, glpk, graphs, groups, homfly, lcalc, libbraiding, libecm, linbox, modules, mpmath, ntl, pari, plot, polyhedra, schemes, singular, standard-no-symbolics, symbolics}**. When a namespace package such as `sage.misc` is filled by modules from several distribution packages, we create modules named: - `src/sage/misc/all__sagemath_environment.py` - `src/sage/misc/all__sagemath_objects.py` - `src/sage/misc/all__sagemath_repl.py` Import statements are moved from `src/sage/misc/all.py` to these files as appropriate, and `src/sage/misc/all.py` imports `*` from there. Also some imports are replaced by lazy imports. The new files provide the top level namespaces for the modularized distribution packages, thus [enabling modularized testing](https://doc.s agemath.org/html/en/developer/packaging_sage_library.html#testing- distribution-packages). This design was introduced in sagemath#29865 (merged in Jan 2022, early in the Sage 9.6 development cycle). <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Copied from sagemath#35095. - Part of sagemath#29705 Moreover, applied a one-line command to replace relative by absolute imports, thus complementing sagemath#36666, which does not touch `.all*` files. The changes to other files in `sage.modules` etc. come from the PRs sagemath#36597, sagemath#36572, sagemath#36588, sagemath#36589 merged here and do not need review. <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36597 (merged here to resolve merge conflict) - Depends on sagemath#36572 (merged here to resolve merge conflict) - Depends on sagemath#36588 (merged here to resolve merge conflict) - Depends on sagemath#36589 (merged here to resolve merge conflict) - Depends on sagemath#36449 (merged here to resolve merge conflict) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36676 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri, Kwankyu Lee, Matthias Köppe, Tobias Diez
Final chunk of the cherry-pick from #35095 for #36228, see also #36572 (comment)
This PR overlaps with #36572, #36588, #36589, but it does not touch
.all*
files (no changes there are needed for #36228), thus avoiding conflicts with #35095 (see also #36524 (comment))📝 Checklist
⌛ Dependencies