-
-
Notifications
You must be signed in to change notification settings - Fork 660
Document building from the monorepo using PIP_CONSTRAINT=$SAGE_ROOT/constraints_pkgs.txt
#37434
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
Conversation
Documentation preview for this PR (built with commit 3ab2a18; changes) is ready! 🎉 |
Yes, I understand how this would have failed if the sdist had no .py files like it is happening for 10.3.beta4 right now. For that reason, CI will probably fail if we commit this PR now. I cannot see any obvious problem. I would consider a clean CI run to be enough to decide this can be included. |
pkgs/sagemath-standard/tox.ini: Add environment sagepython-constraints_pkgs[-norequirements]
…ts_pkgs-norequirements
I get $ export PIP_CONSTRAINT="$(pwd)/constraints_pkgs.txt"
$ ./sage -sh -c 'python3 -m build pkgs/sagemath-standard'
...
File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-via-sdist-pj7cyyv6/sagemath_standard-10.5b2/sage_setup/autogen/interpreters/utils.py", line 19, in <module>
from jinja2 import Environment
ModuleNotFoundError: No module named 'jinja2'
************************************************************************
Error building the Sage library
************************************************************************ |
Thanks for testing. |
… into constraints_pkgs
…ts_pkgs-norequirements' runs
…constraints_pkgs-norequirements' runs
…_pkgs-norequirements' runs
The wheel was built successfully. But pip-installing it in a venv, I get ...
...
Using cached pure_eval-0.2.3-py3-none-any.whl (11 kB)
Using cached wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Building wheels for collected packages: fpylll, lrcalc
Building wheel for fpylll (pyproject.toml) ... -done
Created wheel for fpylll: filename=fpylll-0.6.1-cp39-cp39-macosx_12_0_x86_64.whl size=879911 sha256=62fa81e4cfb35635b0804f3691ff603ebadae4be7f11c3a127fb8a0b9fa3a0d1
Stored in directory: /Users/kwankyu/Library/Caches/pip/wheels/9d/f5/89/488429ee43f2e24a12435aa9fb258eeb5bd1f27cfd5e35710b
Building wheel for lrcalc (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for lrcalc (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/pip-build-env-phum_0fo/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'long_description_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'lrcalc' extension
creating build
creating build/temp.macosx-12-x86_64-cpython-39
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/kwankyu/Venv/python39/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c lrcalc.c -o build/temp.macosx-12-x86_64-cpython-39/lrcalc.o
lrcalc.c:1239:10: fatal error: 'lrcalc/ivector.h' file not found
#include "lrcalc/ivector.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lrcalc
Successfully built fpylll
Failed to build lrcalc
ERROR: Could not build wheels for lrcalc, which is required to install pyproject.toml-based projects
[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip |
|
Did you run it within |
… for 'constraints_pkgs-norequirements' runs
I've also noted in #31251 that it would be desirable for lrcalc upstream to publish wheels to PyPI. |
No. I ran it in a new venv. What is the point of installing the sagemath-standard wheel within In the venv, I get (python39) Hera:~$ pip install lrcalc
Collecting lrcalc
Using cached lrcalc-2.1.tar.gz (16 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: lrcalc
Building wheel for lrcalc (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for lrcalc (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/pip-build-env-5pnlind4/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'long_description_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'lrcalc' extension
creating build
creating build/temp.macosx-12-x86_64-cpython-39
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/kwankyu/Venv/python39/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c lrcalc.c -o build/temp.macosx-12-x86_64-cpython-39/lrcalc.o
lrcalc.c:1239:10: fatal error: 'lrcalc/ivector.h' file not found
#include "lrcalc/ivector.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lrcalc
Failed to build lrcalc
ERROR: Could not build wheels for lrcalc, which is required to install pyproject.toml-based projects
[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip |
So all the fuss I went through is unavoidable unless lrcalc is published to PyPI? |
Within You can activate your venv within the |
I see. My venvs are outside of |
The step This is the first time that I successfully installed sagemath-standard distribution package. Personally, it is the most impressive product of the modularization efforts :-) |
Perhaps not an issue directly related with this PR, but I wonder if |
Basically all standard packages are dependencies of sagemath-standard, so https://doc.sagemath.org/html/en/reference/spkg/index.html#standard-packages provides this documentation. The direct non-Python dependencies of sagemath-standard are also declared in https://github.com/sagemath/sage/blob/develop/src/pyproject.toml#L25, but this is at the moment only decoration because there is no tooling that reads this information. Note that the user-facing documentation of installation with Python tools is in https://github.com/sagemath/sage/blob/develop/README.md#alternative-installation-using-pypi - it provisions the non-Python dependencies via sage_conf. |
So Python dependencies are automatically resolved and installed via pip, and non-Python dependencies should be provisioned by the system or by sage_conf. For my case, my system only lacked lrcalc, rather fortunately. https://github.com/sagemath/sage/blob/develop/README.md#alternative-installation-using-pypi perfectly explains the installation procedure of sagemath-standard. I think that there should be a link to it or a copy in the Project description of sagemath-standard at https://pypi.org/project/sagemath-standard. |
Good idea, done in 02f6e88 |
…ecific to sagemath-standard
…ecific to sagemath-standard (fixup)
Perhaps another test run of the changed workflows? Otherwise lgtm. |
Thanks. I think I'll iterate on the workflows in a follow up, when changes such as #38518 have been merged |
OK, as the changes on the workflows are just additions and can be tested on the battleground. |
Thanks for the review! |
sagemathgh-37434: Document building from the monorepo using `PIP_CONSTRAINT=$SAGE_ROOT/constraints_pkgs.txt` <!-- ^^^^^ 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 --> This is aimed at the intermediate level, for users who wish to build a set of distribution packages as supplied in `pkgs/` but without using the wheelhouse infrastructure of Sage-the-distribution. Documentation included in the files. It can also be tested using new tox environments defined in `pkgs/sagemath-standard/tox.ini`, and is tested on GH Actions: https://github.com/mkoeppe/sage/actions/workflows/ci-linux- incremental.yml?query=branch%3Aconstraints_pkgs - this also provides the missing automatic test for the **sagemath- standard** distribution built out of `pkgs/sagemath-standard/` Marked as critical because it is hoped to ease the adoption of modularized distribution packages by downstream packagers. <!-- 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. - [ ] 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! --> - Depends on sagemath#38515 (merged here) - Depends on sagemath#38500 (merged here) URL: sagemath#37434 Reported by: Matthias Köppe Reviewer(s): François Bissey, Kwankyu Lee, Matthias Köppe
sagemathgh-38515: `src/pyproject.toml`: Add missing build dep `jinja2` <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> - Broken in sagemath#37287 - Reported in sagemath#37434 (comment) - Reported in sagemath#36524 (comment) ### 📝 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#38515 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-38518: CI Linux: Consolidate jobs <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Thanks to the more powerful runners in use since early 2024, we can do away with the splits between - `standard-pre` and `standard` - `minimal-pre` and `minimal` - `optional-0-o` and `optional-p-z` - `experimental-0-o` and `experimental-p-z` This makes the CI runs a bit easier to navigate for those who look at them. - Test run: https://github.com/mkoeppe/sage/actions/runs/10438362191 This should also fix "No space left on device" aborts as seen for example in https://github.com/mkoeppe/sage/actions/runs/10426436105 for standard-pre (where we did not use to maximize the available disk space). ### 📝 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. - [ ] 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: ... --> - Depends on sagemath#37434 (merged here) URL: sagemath#38518 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
sagemathgh-38515: `src/pyproject.toml`: Add missing build dep `jinja2` <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> - Broken in sagemath#37287 - Reported in sagemath#37434 (comment) - Reported in sagemath#36524 (comment) ### 📝 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#38515 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-38518: CI Linux: Consolidate jobs <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Thanks to the more powerful runners in use since early 2024, we can do away with the splits between - `standard-pre` and `standard` - `minimal-pre` and `minimal` - `optional-0-o` and `optional-p-z` - `experimental-0-o` and `experimental-p-z` This makes the CI runs a bit easier to navigate for those who look at them. - Test run: https://github.com/mkoeppe/sage/actions/runs/10438362191 This should also fix "No space left on device" aborts as seen for example in https://github.com/mkoeppe/sage/actions/runs/10426436105 for standard-pre (where we did not use to maximize the available disk space). ### 📝 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. - [ ] 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: ... --> - Depends on sagemath#37434 (merged here) URL: sagemath#38518 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
This is aimed at the intermediate level, for users who wish to build a set of distribution packages as supplied in
pkgs/
but without using the wheelhouse infrastructure of Sage-the-distribution.Documentation included in the files.
It can also be tested using new tox environments defined in
pkgs/sagemath-standard/tox.ini
, and is tested on GH Actions: https://github.com/mkoeppe/sage/actions/workflows/ci-linux-incremental.yml?query=branch%3Aconstraints_pkgspkgs/sagemath-standard/
Marked as critical because it is hoped to ease the adoption of modularized distribution packages by downstream packagers.
📝 Checklist
⌛ Dependencies
src/pyproject.toml
: Add missing build depjinja2
#38515 (merged here)