-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
Test pip editable install with meson #39369
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 13ec342; changes) is ready! 🎉 |
Previously, the following test fails with meson editable install ``` 2025-01-28T04:27:13.4765580Z File "src/sage/misc/cachefunc.pyx", line 881, in sage.misc.cachefunc.CachedFunction._instancedoc_ 2025-01-28T04:27:13.4766297Z Failed example: 2025-01-28T04:27:13.4766651Z os.path.exists(sage_getfile(I.groebner_basis)) 2025-01-28T04:27:13.4767084Z Expected: 2025-01-28T04:27:13.4767330Z True 2025-01-28T04:27:13.4767571Z Got: 2025-01-28T04:27:13.4767808Z False ``` See https://github.com/sagemath/sage/actions/runs/13003203795/job/362655 39648 . ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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. (can't really test, but see sagemath#39369) - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39424 Reported by: user202729 Reviewer(s): Tobias Diez
Previously, the following test fails with meson editable install ``` 2025-01-28T04:27:13.4765580Z File "src/sage/misc/cachefunc.pyx", line 881, in sage.misc.cachefunc.CachedFunction._instancedoc_ 2025-01-28T04:27:13.4766297Z Failed example: 2025-01-28T04:27:13.4766651Z os.path.exists(sage_getfile(I.groebner_basis)) 2025-01-28T04:27:13.4767084Z Expected: 2025-01-28T04:27:13.4767330Z True 2025-01-28T04:27:13.4767571Z Got: 2025-01-28T04:27:13.4767808Z False ``` See https://github.com/sagemath/sage/actions/runs/13003203795/job/362655 39648 . ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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. (can't really test, but see sagemath#39369) - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39424 Reported by: user202729 Reviewer(s): Tobias Diez
Previously, the following test fails with meson editable install ``` 2025-01-28T04:27:13.4765580Z File "src/sage/misc/cachefunc.pyx", line 881, in sage.misc.cachefunc.CachedFunction._instancedoc_ 2025-01-28T04:27:13.4766297Z Failed example: 2025-01-28T04:27:13.4766651Z os.path.exists(sage_getfile(I.groebner_basis)) 2025-01-28T04:27:13.4767084Z Expected: 2025-01-28T04:27:13.4767330Z True 2025-01-28T04:27:13.4767571Z Got: 2025-01-28T04:27:13.4767808Z False ``` See https://github.com/sagemath/sage/actions/runs/13003203795/job/362655 39648 . ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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. (can't really test, but see sagemath#39369) - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39424 Reported by: user202729 Reviewer(s): Tobias Diez
…dules' into meson-try-editable
This reverts commit 40c0b19.
Otherwise the test would fail with meson editable install. See https://g ithub.com/sagemath/sage/actions/runs/13003203795/job/36265539648 . Looks like the function was last changed in sagemath#36407. There was no discussion why the simple implementation is not used. This is part of the fix for this test. The other part needed is sagemath#39498 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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. (can't really test, but see sagemath#39369) - [ ] I have updated the documentation and checked the documentation preview. (no documentation change) ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39423 Reported by: user202729 Reviewer(s): Tobias Diez
Otherwise it will fail with meson editable install on objects like `x` of type `Expression`, where the class does not have a docstring but `__init__` method have. The strategy is similar to `sage_getsourcelines` where `__init__` method is looked in. I choose to implement this instead of the more complex workaround (see the comment below). This fixes the test that fails in meson editable mode: ``` 2025-02-11T20:13:36.4801998Z ********************************************************************** 2025-02-11T20:13:36.4803076Z File "src/sage/misc/sageinspect.py", line 1363, in sage.misc.sageinspect.sage_getfile_relative 2025-02-11T20:13:36.4804104Z Failed example: 2025-02-11T20:13:36.4804750Z sage_getfile_relative(x) # needs sage.symbolic 2025-02-11T20:13:36.4808395Z Expected: 2025-02-11T20:13:36.4813350Z 'sage/symbolic/expression.pyx' 2025-02-11T20:13:36.4814244Z Got: 2025-02-11T20:13:36.4815714Z '/home/runner/work/sage/sage/builddir/src/sage/symbolic/expression.pyx' 2025-02-11T20:13:44.3128543Z ********************************************************************** ``` This may still fail in another case where neither class nor `__init__` method has a docstring (in that case `?` will fail to get the file in meson editable mode), but that's not in scope I guess. (I left a comment there to explain) See also sagemath#39369 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. (change should be invisible to users not using meson editable so…) ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39499 Reported by: user202729 Reviewer(s):
Otherwise the test would fail with meson editable install. See https://g ithub.com/sagemath/sage/actions/runs/13003203795/job/36265539648 . Looks like the function was last changed in sagemath#36407. There was no discussion why the simple implementation is not used. This is part of the fix for this test. The other part needed is sagemath#39498 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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. (can't really test, but see sagemath#39369) - [ ] I have updated the documentation and checked the documentation preview. (no documentation change) ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39423 Reported by: user202729 Reviewer(s): Tobias Diez
Fix more bugs uncovered by sagemath#39369 . Add a feature flag `meson_editable`, and put doctests behind this flag accordingly. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39494 Reported by: user202729 Reviewer(s): Tobias Diez
Previously, the sorting and filtering is only applied in case of FileFinder. This makes it consistently applied. Needed to make tests in sagemath#39369 pass. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [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 and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39498 Reported by: user202729 Reviewer(s): Tobias Diez
Otherwise it will fail with meson editable install on objects like `x` of type `Expression`, where the class does not have a docstring but `__init__` method have. The strategy is similar to `sage_getsourcelines` where `__init__` method is looked in. I choose to implement this instead of the more complex workaround (see the comment below). This fixes the test that fails in meson editable mode: ``` 2025-02-11T20:13:36.4801998Z ********************************************************************** 2025-02-11T20:13:36.4803076Z File "src/sage/misc/sageinspect.py", line 1363, in sage.misc.sageinspect.sage_getfile_relative 2025-02-11T20:13:36.4804104Z Failed example: 2025-02-11T20:13:36.4804750Z sage_getfile_relative(x) # needs sage.symbolic 2025-02-11T20:13:36.4808395Z Expected: 2025-02-11T20:13:36.4813350Z 'sage/symbolic/expression.pyx' 2025-02-11T20:13:36.4814244Z Got: 2025-02-11T20:13:36.4815714Z '/home/runner/work/sage/sage/builddir/src/sage/symbolic/expression.pyx' 2025-02-11T20:13:44.3128543Z ********************************************************************** ``` This may still fail in another case where neither class nor `__init__` method has a docstring (in that case `?` will fail to get the file in meson editable mode), but that's not in scope I guess. (I left a comment there to explain) See also sagemath#39369 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. (change should be invisible to users not using meson editable so…) ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39499 Reported by: user202729 Reviewer(s):
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.
I'm fine with this. @kwankyu any opinions?
No. |
We may also do something like "only test Python 3.11 non-editable & Python 3.12 editable" to save some carbon. Thoughts? (the old Conda matrix does something similar.) |
I like this! Having only one "editable" run should be sufficient, right? (github workflows have the |
Okay done (use the trick first used in https://github.com/sagemath/sage/pull/39369/files ) |
Tests pip editable install with meson on GitHub Actions.
This uncovers several failing tests, which are fixed by (see dependencies below)
Note: review is hard because of the large number of dependencies. It is probably easier to look only in
.github
folder.📝 Checklist
⌛ Dependencies