Skip to content
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

make sagemath_categories-check, make pypi-wheels-check #36452

Merged
merged 13 commits into from
Oct 21, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Oct 11, 2023

We add make targets for testing wheel-building script packages that have already been installed. For example:

$ make SAGE_WHEELS=yes sagemath_categories  # builds and stores (but does not install) a wheel
$ make sagemath_categories-check            # tests the wheel using tox

The target make pypi-wheels-check calls all of them. We restructure the Build & Test CI so that all tests are run after build has been completed. Later, as a follow up of this and #36446, we can store the result of Build as a container image and then parallelize the various tests on top of it.

This is implemented on top of an improvement of how we record information on our wheels.

$ cat venv/var/lib/sage/scripts/sagemath_categories/spkg-requirements.txt  
sagemath_categories @ file:///Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/local/var/lib/sage/venv-python3.11/var/lib/sage/wheels/sagemath_categories-10.2b6-cp311-cp311-macosx_13_0_x86_64.whl

Previously, this information was only known during the execution of the spkg-install script.

In a follow-up, we can address #30956 by delaying the wheel installation to spkg-postinst.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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

@mkoeppe mkoeppe self-assigned this Oct 11, 2023
@mkoeppe mkoeppe changed the title make sagemath_categories-check make sagemath_categories-check, make pypi-wheels-check Oct 12, 2023

- name: Test changed files (sage -t --new)
run: |
# We run tests with "sage -t --new"; this only tests the uncommitted changes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() && steps.worktree.outcome == 'success'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i've made a similar change in 8224cb0

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 12, 2023

Thus previously

make SAGE_CHECK=yes sagemath_categories                    

worked, but will not work after this PR. Instead we will use

make sagemath_categories-check                                           

Am I right?

If so, then do we need to update some relevant part of the developer guide?

@mkoeppe
Copy link
Member Author

mkoeppe commented Oct 12, 2023

Thus previously

make SAGE_CHECK=yes sagemath_categories                    

worked, but will not work after this PR

No, it still works the same way. The makefile invokes the spkg-check script after running the spkg-install.

fi
chmod +x spkg-install
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this never used, and so removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's right. It was a leftover from the abandoned support for "old-style packages"

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 13, 2023

OK. It looks good as far as I can tell.

It works well as described.

@mkoeppe
Copy link
Member Author

mkoeppe commented Oct 13, 2023

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 15, 2023
…-check`

    
<!-- ^^^^^
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 add `make` targets for testing wheel-building script packages that
have already been installed. For example:
```
$ make SAGE_WHEELS=yes sagemath_categories  # builds and stores (but
does not install) a wheel
$ make sagemath_categories-check            # tests the wheel using tox
```
The target `make pypi-wheels-check` calls all of them. We restructure
the Build & Test CI so that all tests are run after build has been
completed. Later, as a follow up of this and sagemath#36446, we can store the
result of Build as a container image and then parallelize the various
tests on top of it.

This is implemented on top of an improvement of how we record
information on our wheels.
```
$ cat venv/var/lib/sage/scripts/sagemath_categories/spkg-
requirements.txt
sagemath_categories @ file:///Users/mkoeppe/s/sage/sage-
rebasing/worktree-algebraic-2018-spring/local/var/lib/sage/venv-python3.
11/var/lib/sage/wheels/sagemath_categories-10.2b6-cp311-cp311-
macosx_13_0_x86_64.whl
```
Previously, this information was only known during the execution of the
`spkg-install` script.

In a follow-up, we can address sagemath#30956 by delaying the wheel installation
to spkg-postinst.

<!-- 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! -->
    
URL: sagemath#36452
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 17, 2023
…-check`

    
<!-- ^^^^^
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 add `make` targets for testing wheel-building script packages that
have already been installed. For example:
```
$ make SAGE_WHEELS=yes sagemath_categories  # builds and stores (but
does not install) a wheel
$ make sagemath_categories-check            # tests the wheel using tox
```
The target `make pypi-wheels-check` calls all of them. We restructure
the Build & Test CI so that all tests are run after build has been
completed. Later, as a follow up of this and sagemath#36446, we can store the
result of Build as a container image and then parallelize the various
tests on top of it.

This is implemented on top of an improvement of how we record
information on our wheels.
```
$ cat venv/var/lib/sage/scripts/sagemath_categories/spkg-
requirements.txt
sagemath_categories @ file:///Users/mkoeppe/s/sage/sage-
rebasing/worktree-algebraic-2018-spring/local/var/lib/sage/venv-python3.
11/var/lib/sage/wheels/sagemath_categories-10.2b6-cp311-cp311-
macosx_13_0_x86_64.whl
```
Previously, this information was only known during the execution of the
`spkg-install` script.

In a follow-up, we can address sagemath#30956 by delaying the wheel installation
to spkg-postinst.

<!-- 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! -->
    
URL: sagemath#36452
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
@vbraun vbraun merged commit 4faf2ae into sagemath:develop Oct 21, 2023
22 of 30 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Oct 21, 2023
@mkoeppe mkoeppe deleted the wheel_requirements branch November 19, 2023 20:50
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 27, 2023
…agemath#36452

    
<!-- ^^^^^
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? -->
sagemath#36452 broke `make SPKG-uninstall` for Python packages.

Reproducer:
```
$ make zipp-uninstall
...
if [ -d '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10' ]; then sage-spkg-uninstall
zipp '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10'; fi
Uninstalling existing 'zipp'
Running pip-uninstall script for 'zipp'
ERROR: Could not open requirements file: [Errno 2] No such file or
directory: '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10/var/lib/sage/scripts/zipp/spkg-
requirements.txt'
Warning: pip exited with status 0
Removing stamp file '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-
python3.10/var/lib/sage/installed/zipp-3.11.0'
$ ./sage -pip list | grep zipp
zipp                           3.11.0
```



<!-- 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! -->
    
URL: sagemath#36737
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 30, 2023
…agemath#36452

    
<!-- ^^^^^
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? -->
sagemath#36452 broke `make SPKG-uninstall` for Python packages.

Reproducer:
```
$ make zipp-uninstall
...
if [ -d '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10' ]; then sage-spkg-uninstall
zipp '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10'; fi
Uninstalling existing 'zipp'
Running pip-uninstall script for 'zipp'
ERROR: Could not open requirements file: [Errno 2] No such file or
directory: '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-python3.10/var/lib/sage/scripts/zipp/spkg-
requirements.txt'
Warning: pip exited with status 0
Removing stamp file '/Users/mkoeppe/s/sage/sage-rebasing/worktree-
clean/local/var/lib/sage/venv-
python3.10/var/lib/sage/installed/zipp-3.11.0'
$ ./sage -pip list | grep zipp
zipp                           3.11.0
```



<!-- 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! -->
    
URL: sagemath#36737
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants