Skip to content

Commit cfc69e5

Browse files
authored
Merge pull request #74 from smarie/feature/56_72_new_ci_xdist_issue
Refactored layout and CI to update to latest (from makefun)
2 parents 37535e2 + 6a6dd06 commit cfc69e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+353
-1040
lines changed

.github/workflows/base.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/[email protected]
2727

2828
- name: Install python 3.9
29-
uses: actions/setup-python@v5.0.0
29+
uses: actions/setup-python@v5.1.0
3030
with:
3131
python-version: 3.9
3232
architecture: x64
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: List 'tests' nox sessions and required python versions
3838
id: set-matrix
39-
run: echo "::set-output name=matrix::$(nox -s gha_list -- -s tests -v)"
39+
run: echo "matrix=$(nox --json -l -s tests -v)" >> $GITHUB_OUTPUT
4040

4141
outputs:
4242
matrix: ${{ steps.set-matrix.outputs.matrix }} # save nox sessions list to outputs
@@ -59,17 +59,47 @@ jobs:
5959
- name: Checkout
6060
uses: actions/[email protected]
6161

62-
- name: Install python ${{ matrix.nox_session.python }} for tests
63-
uses: MatteoH2O1999/[email protected] # actions/[email protected]
62+
# General case
63+
- name: Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.13)
64+
if: ${{ ! contains(fromJson('["3.5", "3.13"]'), matrix.nox_session.python ) }}
65+
uses: MatteoH2O1999/setup-python@v4 # actions/[email protected]
6466
id: set-py
6567
with:
6668
python-version: ${{ matrix.nox_session.python }}
6769
architecture: x64
6870
allow-build: info
6971
cache-build: true
7072

73+
# Particular case of issue with 3.5
74+
- name: Install python ${{ matrix.nox_session.python }} for tests (3.5)
75+
if: contains(fromJson('["3.5"]'), matrix.nox_session.python )
76+
uses: MatteoH2O1999/setup-python@v4 # actions/[email protected]
77+
id: set-py-35
78+
with:
79+
python-version: ${{ matrix.nox_session.python }}
80+
architecture: x64
81+
allow-build: info
82+
cache-build: true
83+
env:
84+
# workaround found in https://github.com/actions/setup-python/issues/866
85+
# for issue "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:728)" on Python 3.5
86+
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
87+
88+
89+
- name: Install python ${{ matrix.nox_session.python }} for tests (3.13)
90+
if: contains(fromJson('["3.13"]'), matrix.nox_session.python )
91+
uses: actions/setup-python@v5
92+
id: set-py-latest
93+
with:
94+
# Include all versions including pre releases
95+
# See https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-a-python-version
96+
python-version: ${{ format('~{0}.0-alpha.0', matrix.nox_session.python) }}
97+
architecture: x64
98+
allow-build: info
99+
cache-build: true
100+
71101
- name: Install python 3.12 for nox
72-
uses: actions/setup-python@v5.0.0
102+
uses: actions/setup-python@v5.1.0
73103
with:
74104
python-version: 3.12
75105
architecture: x64
@@ -87,8 +117,8 @@ jobs:
87117

88118
# Share ./docs/reports so that they can be deployed with doc in next job
89119
- name: Share reports with other jobs
90-
# if: matrix.nox_session == '...': not needed, if empty won't be shared
91-
uses: actions/[email protected].0
120+
if: runner.os == 'Linux'
121+
uses: actions/[email protected].1
92122
with:
93123
name: reports_dir
94124
path: ./docs/reports
@@ -101,7 +131,7 @@ jobs:
101131
uses: actions/[email protected]
102132

103133
- name: Install python 3.9 for nox
104-
uses: actions/setup-python@v5.0.0
134+
uses: actions/setup-python@v5.1.0
105135
with:
106136
python-version: 3.9
107137
architecture: x64
@@ -128,14 +158,14 @@ jobs:
128158
fetch-depth: 0 # so that gh-deploy works
129159

130160
- name: Install python 3.9 for nox
131-
uses: actions/setup-python@v5.0.0
161+
uses: actions/setup-python@v5.1.0
132162
with:
133163
python-version: 3.9
134164
architecture: x64
135165

136166
# 1) retrieve the reports generated previously
137167
- name: Retrieve reports
138-
uses: actions/[email protected].1
168+
uses: actions/[email protected].4
139169
with:
140170
name: reports_dir
141171
path: ./docs/reports
@@ -167,9 +197,12 @@ jobs:
167197
EOF
168198
- name: \[not on TAG\] Publish coverage report
169199
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
170-
uses: codecov/codecov-action@v4.0.1
200+
uses: codecov/codecov-action@v4.1.1
171201
with:
172202
files: ./docs/reports/coverage/coverage.xml
203+
- name: \[not on TAG\] Build wheel and sdist
204+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
205+
run: nox -s build
173206

174207
# -------------- only on Ubuntu + TAG PUSH (no pull request) -----------
175208

@@ -181,7 +214,7 @@ jobs:
181214
# 8) Publish the wheel on PyPi
182215
- name: \[TAG only\] Deploy on PyPi
183216
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
184-
uses: pypa/gh-action-pypi-publish@v1.8.11
217+
uses: pypa/gh-action-pypi-publish@release/v1
185218
with:
186219
user: __token__
187220
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ coverage.xml
5050
*.py,cover
5151
.hypothesis/
5252
.pytest_cache/
53-
pytest_harvest/_version.py
53+
src/pytest_harvest/_version.py
5454

5555
# Translations
5656
*.mo

ci_tools/headers.tmpl

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci_tools/headers_check.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)