Skip to content

Commit 6b54890

Browse files
committed
Test changed setup, and Python 3.12, on CI
Key changes: - Update the two CI workflows to install the project and its dependencies in accordance with the changed recommendations in README.md. (This is to test that those recommendations work, which the changed test_installation test case partially but not completely tests. The old approach to installation still works too, so this change on CI is not required to keep CI working.) - Add Python 3.12 to the CI test matrix in pythonpackage.yml, testing it on Ubuntu. (The Cygwin workflow still tests only 3.9.) Maintenance changes, made to avoid decreasing readability with the other changes (and hopefully even increase it somewhat): - Separate commands into more steps, grouping them by more specific purposes. - Decrease the ways the two workflows differ from each other that do not represent actual intended behavioral differences. This is to make the important differences easier to stop, and to make it easier to determine when the same change has or has not been made to both workflows.
1 parent 21c5f87 commit 6b54890

File tree

2 files changed

+70
-19
lines changed

2 files changed

+70
-19
lines changed

Diff for: .github/workflows/cygwin-test.yml

+32-9
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,61 @@ jobs:
1212
SHELLOPTS: igncr
1313
TMP: "/tmp"
1414
TEMP: "/tmp"
15+
defaults:
16+
run:
17+
shell: bash.exe -eo pipefail -o igncr "{0}"
1518

1619
steps:
1720
- name: Force LF line endings
1821
run: git config --global core.autocrlf input
22+
1923
- uses: actions/checkout@v4
2024
with:
2125
fetch-depth: 9999
26+
2227
- uses: cygwin/cygwin-install-action@v4
2328
with:
2429
packages: python39 python39-pip python39-virtualenv git
30+
31+
- name: Show python and git versions
32+
run: |
33+
set -x
34+
/usr/bin/python --version
35+
/usr/bin/git version
36+
2537
- name: Tell git to trust this repo
26-
shell: bash.exe -eo pipefail -o igncr "{0}"
2738
run: |
2839
/usr/bin/git config --global --add safe.directory "$(pwd)"
29-
- name: Install dependencies and prepare tests
30-
shell: bash.exe -eo pipefail -o igncr "{0}"
40+
41+
- name: Prepare this repo for tests
3142
run: |
3243
set -x
33-
/usr/bin/python -m pip install --upgrade pip setuptools wheel
34-
/usr/bin/python --version; /usr/bin/git --version
44+
3545
/usr/bin/git submodule update --init --recursive
3646
/usr/bin/git fetch --tags
37-
/usr/bin/python -m pip install -r requirements.txt
38-
/usr/bin/python -m pip install -r test-requirements.txt
3947
TRAVIS=yes ./init-tests-after-clone.sh
48+
49+
- name: Further prepare git configuration for tests
50+
run: |
51+
set -x
52+
4053
/usr/bin/git config --global user.email "[email protected]"
4154
/usr/bin/git config --global user.name "Travis Runner"
4255
# If we rewrite the user's config by accident, we will mess it up
4356
# and cause subsequent tests to fail
4457
cat test/fixtures/.gitconfig >> ~/.gitconfig
58+
59+
- name: Update PyPA packages
60+
run: |
61+
set -x
62+
/usr/bin/python -m pip install --upgrade pip setuptools wheel
63+
64+
- name: Install project and test dependencies
65+
run: |
66+
set -x
67+
/usr/bin/python -m pip install ".[test]"
68+
4569
- name: Test with pytest
46-
shell: bash.exe -eo pipefail -o igncr "{0}"
4770
run: |
71+
set -x
4872
/usr/bin/python -m pytest
49-
continue-on-error: false

Diff for: .github/workflows/pythonpackage.yml

+38-10
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,70 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
19+
include:
20+
- experimental: false
21+
- python-version: "3.12"
22+
experimental: true
1923

2024
steps:
2125
- uses: actions/checkout@v4
2226
with:
2327
fetch-depth: 9999
28+
2429
- name: Set up Python ${{ matrix.python-version }}
2530
uses: actions/setup-python@v4
2631
with:
2732
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies and prepare tests
33+
allow-prereleases: ${{ matrix.experimental }}
34+
35+
- name: Show python and git versions
36+
run: |
37+
set -x
38+
python --version
39+
git version
40+
41+
- name: Prepare this repo for tests
2942
run: |
3043
set -x
3144
32-
python -m pip install --upgrade pip setuptools wheel
33-
python --version; git --version
3445
git submodule update --init --recursive
3546
git fetch --tags --force
36-
37-
pip install -r requirements.txt
38-
pip install -r test-requirements.txt
3947
TRAVIS=yes ./init-tests-after-clone.sh
4048
49+
- name: Prepare git configuration for tests
50+
run: |
51+
set -x
52+
4153
git config --global user.email "[email protected]"
4254
git config --global user.name "Travis Runner"
4355
# If we rewrite the user's config by accident, we will mess it up
4456
# and cause subsequent tests to fail
4557
cat test/fixtures/.gitconfig >> ~/.gitconfig
4658
59+
- name: Update PyPA packages
60+
run: |
61+
set -x
62+
63+
python -m pip install --upgrade pip
64+
if pip freeze --all | grep --quiet '^setuptools=='; then
65+
# Python prior to 3.12 ships setuptools. Upgrade it if present.
66+
python -m pip install --upgrade setuptools
67+
fi
68+
python -m pip install --upgrade wheel
69+
70+
- name: Install project and test dependencies
71+
run: |
72+
set -x
73+
pip install ".[test]"
74+
4775
- name: Check types with mypy
48-
# With new versions of pypi new issues might arise. This is a problem if there is nobody able to fix them,
49-
# so we have to ignore errors until that changes.
50-
continue-on-error: true
5176
run: |
5277
set -x
5378
mypy -p git
79+
# With new versions of mypy new issues might arise. This is a problem if there is nobody able to fix them,
80+
# so we have to ignore errors until that changes.
81+
continue-on-error: true
5482

5583
- name: Test with pytest
5684
run: |

0 commit comments

Comments
 (0)