Skip to content

Commit

Permalink
devtools: cleanup related to python release tooling (gap-system#5792)
Browse files Browse the repository at this point in the history
* we are not using python-dateutil anymore
* CI: use consistent Python version & packages
* CI: creating Windows installer does not need Python
* devtools: mypy is not a requirement, it is only used optionally
* clarify dev/releases/README.md: Updating the website in one
  section only discussed the GH workflow and in another only the
  update_website.py script, without any hint about their relation.
  • Loading branch information
fingolfin authored Sep 5, 2024
1 parent 423ba87 commit b68674e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dependencies
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: "Install some python packages"
run: |
python -m pip install -r dev/releases/requirements.txt
python -m pip install pytest mock black isort
python -m pip install black isort mypy pytest
- name: Check code formatting
- name: "Check code formatting"
run: python -m black --check --diff dev/releases

- name: Check imports
- name: "Check imports"
run: python -m isort --check --profile black dev/releases

#- name: Validate types
#- name: "Validate types"
# run: python -m mypy --disallow-untyped-calls --disallow-untyped-defs dev/releases/*.py

#- name: Run tests
#- name: "Run tests"
# run: python -m pytest tools/tests/dev/releases*.py -vv

unix:
Expand Down Expand Up @@ -92,9 +97,10 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: "Install Python modules"
run: pip3 install PyGithub python-dateutil
python-version: 3.11
- name: "Install some python packages"
run: |
python -m pip install -r dev/releases/requirements.txt
- name: "Install latex"
run: |
packages=(
Expand Down Expand Up @@ -179,10 +185,6 @@ jobs:
# The GAP to be wrapped is put into gap-$GAP_VERSION/
# The gap-windows script requires the GAP directory to be named this way.

- uses: actions/setup-python@v5
with:
python-version: 3.9

# Download the artifact -- for an actual release, this contains the
# exact same tarball as was uploaded to the release as an asset
- name: "Download GAP archive from previous job"
Expand Down
6 changes: 3 additions & 3 deletions dev/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ git push origin v${VER}
6. Edit the new release under <https://github.com/gap-system/gap/releases/> and
change the release from "pre-release" to "latest release" (i.e., on <https://github.com/gap-system/gap/releases/edit/vX.Y.Z> disable "Set as a pre-release" and enable "Set as the latest release").
7. Next either manually dispatch the “[Sync](https://github.com/gap-system/GapWWW/actions/workflows/sync.yml)” GitHub Actions workflow on `gap-system/GapWWW`, or wait overnight for it to happen on schedule.
- This Workflow creates a pull request to `gap-system/GapWWW`, which updates the GAP website according to the release data hosted on `gap-system/gap`. Check that the result is sensible.
- This workflow creates a pull request to `gap-system/GapWWW`, which updates the GAP website according to the release data hosted on `gap-system/gap`. Check that the result is sensible.
- This workflow uses the `update_website.py` script which can also be run manually, see below for more information.
8. When it is time to publicise the new GAP release, merge the pull request to GapWWW.
9. There are currently additional steps required for the new manual to appear on <https://docs.gap-system.org>, and to add a copy of the new release files to <https://files.gap-system.org>.
These could and be automated in the future but are currently not. Details are described in steps 10 and following below.
Expand All @@ -56,7 +57,6 @@ Before starting the release process, the scripts have the following dependencies
- Several python modules, including (e.g. installed using `pip3` (`pip3 install <MODULENAME>`):
- `PyGithub`
- `requests`
- `python-dateutil`


### Steps
Expand Down Expand Up @@ -89,7 +89,7 @@ Before starting the release process, the scripts have the following dependencies
5. Access your local clone of the `GapWWW` repository.
6. Make sure that your clone is up to date with `gap-system/GapWWW`.
7. Check out the master branch.
8. Run `update_website.py` in root directory of `GapWWW` (see `update_website.py --help`). This:
8. Start website update: either as described above via a workflow in the `GapWWW` repository; or by running `update_website.py` in root directory of `GapWWW` (see `update_website.py --help`). This:
- Fetches the GitHub releases data from `gap-system/gap`.
- Deletes, modifies, and adds various JSON and HTML files according to this data.
9. Inspect the changes, and commit and push them to the master branch to `gap-system/GapWWW`.
Expand Down
3 changes: 1 addition & 2 deletions dev/releases/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github
mypy
PyGitHub
requests
types-requests

0 comments on commit b68674e

Please sign in to comment.