Skip to content

Commit ede9d41

Browse files
committed
Update CI
1 parent f212145 commit ede9d41

File tree

4 files changed

+61
-34
lines changed

4 files changed

+61
-34
lines changed

.github/workflows/tests.yml

+47-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Checkout source
1818
uses: actions/checkout@v3
1919
- name: Set up Python 3.8
20-
uses: actions/setup-python@v4.3.0
20+
uses: actions/setup-python@v4.5.0
2121
with:
2222
python-version: 3.8
2323
- name: Install dependencies
@@ -40,7 +40,7 @@ jobs:
4040
- name: Checkout source
4141
uses: actions/checkout@v3
4242
- name: Set up Python 3.8
43-
uses: actions/setup-python@v4.3.0
43+
uses: actions/setup-python@v4.5.0
4444
with:
4545
python-version: 3.8
4646
- name: Upgrade pip
@@ -97,96 +97,123 @@ jobs:
9797
runs-on: ${{ matrix.os }}
9898
strategy:
9999
matrix:
100-
arch:
101-
- auto
102100
include:
103101
- python-version: '3.6'
104-
os: ubuntu-latest
102+
os: ubuntu-20.04
105103
install-extras: tests-strict,runtime-strict
104+
arch: auto
106105
- python-version: '3.6'
107106
os: macOS-latest
108107
install-extras: tests-strict,runtime-strict
108+
arch: auto
109109
- python-version: '3.6'
110110
os: windows-latest
111111
install-extras: tests-strict,runtime-strict
112+
arch: auto
112113
- python-version: '3.11'
113114
os: ubuntu-latest
114115
install-extras: tests-strict,runtime-strict,optional-strict
116+
arch: auto
115117
- python-version: '3.11'
116118
os: macOS-latest
117119
install-extras: tests-strict,runtime-strict,optional-strict
120+
arch: auto
118121
- python-version: '3.11'
119122
os: windows-latest
120123
install-extras: tests-strict,runtime-strict,optional-strict
124+
arch: auto
121125
- python-version: '3.11'
122126
os: macOS-latest
123127
install-extras: tests
128+
arch: auto
124129
- python-version: '3.11'
125130
os: windows-latest
126131
install-extras: tests
132+
arch: auto
127133
- python-version: '3.6'
128-
os: ubuntu-latest
134+
os: ubuntu-20.04
129135
install-extras: tests,optional
136+
arch: auto
130137
- python-version: '3.7'
131138
os: ubuntu-latest
132139
install-extras: tests,optional
140+
arch: auto
133141
- python-version: '3.8'
134142
os: ubuntu-latest
135143
install-extras: tests,optional
144+
arch: auto
136145
- python-version: '3.9'
137146
os: ubuntu-latest
138147
install-extras: tests,optional
148+
arch: auto
139149
- python-version: '3.10'
140150
os: ubuntu-latest
141151
install-extras: tests,optional
152+
arch: auto
142153
- python-version: '3.11'
143154
os: ubuntu-latest
144155
install-extras: tests,optional
156+
arch: auto
145157
- python-version: '3.6'
146158
os: macOS-latest
147159
install-extras: tests,optional
160+
arch: auto
148161
- python-version: '3.7'
149162
os: macOS-latest
150163
install-extras: tests,optional
164+
arch: auto
151165
- python-version: '3.8'
152166
os: macOS-latest
153167
install-extras: tests,optional
168+
arch: auto
154169
- python-version: '3.9'
155170
os: macOS-latest
156171
install-extras: tests,optional
172+
arch: auto
157173
- python-version: '3.10'
158174
os: macOS-latest
159175
install-extras: tests,optional
176+
arch: auto
160177
- python-version: '3.11'
161178
os: macOS-latest
162179
install-extras: tests,optional
180+
arch: auto
163181
- python-version: '3.6'
164182
os: windows-latest
165183
install-extras: tests,optional
184+
arch: auto
166185
- python-version: '3.7'
167186
os: windows-latest
168187
install-extras: tests,optional
188+
arch: auto
169189
- python-version: '3.8'
170190
os: windows-latest
171191
install-extras: tests,optional
192+
arch: auto
172193
- python-version: '3.9'
173194
os: windows-latest
174195
install-extras: tests,optional
196+
arch: auto
175197
- python-version: '3.10'
176198
os: windows-latest
177199
install-extras: tests,optional
200+
arch: auto
178201
- python-version: '3.11'
179202
os: windows-latest
180203
install-extras: tests,optional
204+
arch: auto
181205
- python-version: pypy-3.7
182206
os: ubuntu-latest
183207
install-extras: tests,optional
208+
arch: auto
184209
- python-version: pypy-3.7
185210
os: macOS-latest
186211
install-extras: tests,optional
212+
arch: auto
187213
- python-version: pypy-3.7
188214
os: windows-latest
189215
install-extras: tests,optional
216+
arch: auto
190217
steps:
191218
- name: Checkout source
192219
uses: actions/checkout@v3
@@ -204,7 +231,7 @@ jobs:
204231
with:
205232
platforms: all
206233
- name: Setup Python
207-
uses: actions/setup-python@v4.3.0
234+
uses: actions/setup-python@v4.5.0
208235
with:
209236
python-version: ${{ matrix.python-version }}
210237
- name: Build pure wheel
@@ -220,25 +247,33 @@ jobs:
220247
CI_PYTHON_VERSION: py${{ matrix.python-version }}
221248
run: |-
222249
# Find the path to the wheel
223-
WHEEL_FPATH=$(ls wheelhouse/xdoctest*.whl)
224-
# Install the wheel
225-
python -m pip install ${WHEEL_FPATH}[${INSTALL_EXTRAS}]
250+
ls wheelhouse
251+
pip install tomli pkginfo
252+
MOD_NAME=xdoctest
253+
echo "MOD_NAME=$MOD_NAME"
254+
WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('$MOD_NAME*.whl'))[-1]).replace(chr(92), chr(47)))")
255+
echo "WHEEL_FPATH=$WHEEL_FPATH"
256+
MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
257+
echo "MOD_VERSION=$MOD_VERSION"
258+
# Install the wheel (ensure we are using the version we just built)
259+
# NOTE: THE VERSION MUST BE NEWER THAN AN EXISTING PYPI VERSION OR THIS MAY FAIL
260+
pip install "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
226261
# Create a sandboxed directory
227262
WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
228263
mkdir -p $WORKSPACE_DNAME
229264
cd $WORKSPACE_DNAME
230265
# Get the path to the installed package and run the tests
231266
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
232267
echo "MOD_DPATH = $MOD_DPATH"
233-
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov=xdoctest $MOD_DPATH ../tests
268+
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="$MOD_NAME" "$MOD_DPATH" ../tests
234269
# Move coverage file to a new name
235270
mv .coverage "../.coverage.$WORKSPACE_DNAME"
236271
cd ..
237272
- name: Show built files
238273
shell: bash
239274
run: ls -la wheelhouse
240275
- name: Set up Python 3.8 to combine coverage Linux
241-
uses: actions/setup-python@v4.3.0
276+
uses: actions/setup-python@v4.5.0
242277
if: runner.os == 'Linux'
243278
with:
244279
python-version: 3.8

.readthedocs.yml

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
11
# .readthedocs.yml
22
# Read the Docs configuration file
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4-
#
4+
#
55
# See Also:
66
# https://readthedocs.org/dashboard/xdoctest/advanced/
77

88
# Required
99
version: 2
10-
11-
# Build documentation in the docs/ directory with Sphinx
1210
sphinx:
1311
configuration: docs/source/conf.py
14-
15-
# Build documentation with MkDocs
16-
#mkdocs:
17-
# configuration: mkdocs.yml
18-
19-
# Optionally build your docs in additional formats such as PDF and ePub
2012
formats: all
21-
22-
# Optionally set the version of Python and requirements required to build your docs
2313
python:
2414
version: 3.7
2515
install:
26-
- requirements: requirements/docs.txt
27-
- method: pip
28-
path: .
29-
#extra_requirements:
30-
# - docs
31-
32-
#conda:
33-
# environment: environment.yml
16+
- requirements: requirements/docs.txt
17+
- method: pip
18+
path: .

dev/setup_secrets.sh

+9
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,15 @@ export_encrypted_code_signing_keys(){
393393

394394
MAIN_GPG_KEYID=$(gpg --list-keys --keyid-format LONG "$GPG_IDENTIFIER" | head -n 2 | tail -n 1 | awk '{print $1}')
395395
GPG_SIGN_SUBKEY=$(gpg --list-keys --with-subkey-fingerprints "$GPG_IDENTIFIER" | grep "\[S\]" -A 1 | tail -n 1 | awk '{print $1}')
396+
# Careful, if you don't have a subkey, requesting it will export more than you want.
397+
# Export the main key instead (its better to have subkeys, but this is a lesser evil)
398+
if [[ "$GPG_SIGN_SUBKEY" == "" ]]; then
399+
# NOTE: if you get here this probably means your subkeys expired (and
400+
# wont even be visible), so we probably should check for that here and
401+
# thrown an error instead of using this hack, which likely wont work
402+
# anyway.
403+
GPG_SIGN_SUBKEY=$(gpg --list-keys --with-subkey-fingerprints "$GPG_IDENTIFIER" | grep "\[C\]" -A 1 | tail -n 1 | awk '{print $1}')
404+
fi
396405
echo "MAIN_GPG_KEYID = $MAIN_GPG_KEYID"
397406
echo "GPG_SIGN_SUBKEY = $GPG_SIGN_SUBKEY"
398407

requirements.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
-r requirements/runtime.txt
22
-r requirements/tests.txt
3-
-r requirements/tests-binary.txt
4-
-r requirements/jupyter.txt
5-
-r requirements/colors.txt
3+
-r requirements/optional.txt

0 commit comments

Comments
 (0)