Skip to content

Commit 18fc711

Browse files
committed
Update xcookie structure
1 parent 822b445 commit 18fc711

File tree

5 files changed

+88
-53
lines changed

5 files changed

+88
-53
lines changed

.github/workflows/tests.yml

+84-45
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
python -m pip install --upgrade pip
4949
python -m pip install -r requirements/tests.txt
5050
python -m pip install -r requirements/runtime.txt
51-
true
5251
- name: Build sdist
5352
shell: bash
5453
run: |-
@@ -63,26 +62,30 @@ jobs:
6362
run: |-
6463
pwd
6564
ls -al
65+
# Run in a sandboxed directory
66+
WORKSPACE_DNAME="testsrcdir_minimal_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
67+
mkdir -p $WORKSPACE_DNAME
68+
cd $WORKSPACE_DNAME
69+
# Run the tests
70+
# Get path to installed package
6671
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
6772
echo "MOD_DPATH = $MOD_DPATH"
68-
python -m pytest -p pytester -p no:doctest --xdoctest --cov=xdoctest $MOD_DPATH ./tests
73+
python -m pytest --cov={self.mod_name} $MOD_DPATH ../tests
74+
cd ..
6975
- name: Test full loose sdist
7076
run: |-
7177
pwd
7278
ls -al
73-
python -m pip install -r requirements/optional.txt
7479
true
75-
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
76-
echo "MOD_DPATH = $MOD_DPATH"
7780
# Run in a sandboxed directory
78-
WORKSPACE_DNAME="testsrcdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
81+
WORKSPACE_DNAME="testsrcdir_full_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
7982
mkdir -p $WORKSPACE_DNAME
8083
cd $WORKSPACE_DNAME
8184
# Run the tests
8285
# Get path to installed package
8386
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
8487
echo "MOD_DPATH = $MOD_DPATH"
85-
python -m pytest -p pytester -p no:doctest --xdoctest $MOD_DPATH ../tests
88+
python -m pytest --cov={self.mod_name} $MOD_DPATH ../tests
8689
cd ..
8790
- name: Upload sdist artifact
8891
uses: actions/upload-artifact@v3
@@ -94,69 +97,105 @@ jobs:
9497
runs-on: ${{ matrix.os }}
9598
strategy:
9699
matrix:
97-
os:
98-
- windows-latest
99-
- ubuntu-latest
100-
- macOS-latest
101-
python-version:
102-
- '3.6'
103-
- '3.7'
104-
- '3.8'
105-
- '3.9'
106-
- '3.10'
107-
- '3.11'
108-
- pypy-3.7
109-
install-extras:
110-
- tests
111-
- tests,optional
112100
arch:
113101
- auto
114102
include:
115103
- python-version: '3.6'
116-
os: windows-latest
104+
os: ubuntu-latest
117105
install-extras: tests-strict,runtime-strict
118-
- python-version: '3.10'
119-
os: windows-latest
106+
- python-version: '3.6'
107+
os: macOS-latest
120108
install-extras: tests-strict,runtime-strict
121109
- python-version: '3.6'
122110
os: windows-latest
111+
install-extras: tests-strict,runtime-strict
112+
- python-version: '3.11'
113+
os: ubuntu-latest
123114
install-extras: tests-strict,runtime-strict,optional-strict
124-
- python-version: '3.10'
115+
- python-version: '3.11'
116+
os: macOS-latest
117+
install-extras: tests-strict,runtime-strict,optional-strict
118+
- python-version: '3.11'
125119
os: windows-latest
126120
install-extras: tests-strict,runtime-strict,optional-strict
121+
- python-version: '3.11'
122+
os: macOS-latest
123+
install-extras: tests
124+
- python-version: '3.11'
125+
os: windows-latest
126+
install-extras: tests
127127
- python-version: '3.6'
128128
os: ubuntu-latest
129-
install-extras: tests-strict,runtime-strict
130-
- python-version: '3.10'
129+
install-extras: tests,optional
130+
- python-version: '3.7'
131131
os: ubuntu-latest
132-
install-extras: tests-strict,runtime-strict
133-
- python-version: '3.6'
132+
install-extras: tests,optional
133+
- python-version: '3.8'
134134
os: ubuntu-latest
135-
install-extras: tests-strict,runtime-strict,optional-strict
135+
install-extras: tests,optional
136+
- python-version: '3.9'
137+
os: ubuntu-latest
138+
install-extras: tests,optional
136139
- python-version: '3.10'
137140
os: ubuntu-latest
138-
install-extras: tests-strict,runtime-strict,optional-strict
141+
install-extras: tests,optional
142+
- python-version: '3.11'
143+
os: ubuntu-latest
144+
install-extras: tests,optional
139145
- python-version: '3.6'
140146
os: macOS-latest
141-
install-extras: tests-strict,runtime-strict
147+
install-extras: tests,optional
148+
- python-version: '3.7'
149+
os: macOS-latest
150+
install-extras: tests,optional
151+
- python-version: '3.8'
152+
os: macOS-latest
153+
install-extras: tests,optional
154+
- python-version: '3.9'
155+
os: macOS-latest
156+
install-extras: tests,optional
142157
- python-version: '3.10'
143158
os: macOS-latest
144-
install-extras: tests-strict,runtime-strict
145-
- python-version: '3.6'
159+
install-extras: tests,optional
160+
- python-version: '3.11'
146161
os: macOS-latest
147-
install-extras: tests-strict,runtime-strict,optional-strict
162+
install-extras: tests,optional
163+
- python-version: '3.6'
164+
os: windows-latest
165+
install-extras: tests,optional
166+
- python-version: '3.7'
167+
os: windows-latest
168+
install-extras: tests,optional
169+
- python-version: '3.8'
170+
os: windows-latest
171+
install-extras: tests,optional
172+
- python-version: '3.9'
173+
os: windows-latest
174+
install-extras: tests,optional
148175
- python-version: '3.10'
176+
os: windows-latest
177+
install-extras: tests,optional
178+
- python-version: '3.11'
179+
os: windows-latest
180+
install-extras: tests,optional
181+
- python-version: pypy-3.7
182+
os: ubuntu-latest
183+
install-extras: tests,optional
184+
- python-version: pypy-3.7
149185
os: macOS-latest
150-
install-extras: tests-strict,runtime-strict,optional-strict
186+
install-extras: tests,optional
187+
- python-version: pypy-3.7
188+
os: windows-latest
189+
install-extras: tests,optional
151190
steps:
152191
- name: Checkout source
153192
uses: actions/checkout@v3
154193
- name: Enable MSVC 64bit
155194
uses: ilammy/msvc-dev-cmd@v1
156-
if: matrix.os == 'windows-latest' && matrix.cibw_build != 'cp3*-win32'
195+
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
157196
- name: Enable MSVC 32bit
158197
uses: ilammy/msvc-dev-cmd@v1
159-
if: matrix.os == 'windows-latest' && matrix.cibw_build == 'cp3*-win32'
198+
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
160199
with:
161200
arch: x86
162201
- name: Set up QEMU
@@ -165,7 +204,7 @@ jobs:
165204
with:
166205
platforms: all
167206
- name: Setup Python
168-
uses: actions/setup-python@v4.2.0
207+
uses: actions/setup-python@v4.3.0
169208
with:
170209
python-version: ${{ matrix.python-version }}
171210
- name: Build pure wheel
@@ -191,17 +230,15 @@ jobs:
191230
# Get the path to the installed package and run the tests
192231
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
193232
echo "MOD_DPATH = $MOD_DPATH"
194-
# https://pytest-cov.readthedocs.io/en/latest/plugins.html
195-
# python2 hack
196-
COV_CORE_SOURCE="$MOD_DPATH" COV_CORE_CONFIG=../pyproject.toml COV_CORE_DATAFILE=.coverage.eager python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report html --cov-report term --cov-append --cov=xdoctest $MOD_DPATH ../tests || python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov=xdoctest $MOD_DPATH ../tests
233+
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov=xdoctest $MOD_DPATH ../tests
197234
# Move coverage file to a new name
198235
mv .coverage "../.coverage.$WORKSPACE_DNAME"
199236
cd ..
200237
- name: Show built files
201238
shell: bash
202239
run: ls -la wheelhouse
203240
- name: Set up Python 3.8 to combine coverage Linux
204-
uses: actions/setup-python@v4.2.0
241+
uses: actions/setup-python@v4.3.0
205242
if: runner.os == 'Linux'
206243
with:
207244
python-version: 3.8
@@ -266,6 +303,7 @@ jobs:
266303
$GPG_EXECUTABLE --list-keys || echo "first invocation of gpg creates directories and returns 1"
267304
$GPG_EXECUTABLE --list-keys
268305
VERSION=$(python -c "import setup; print(setup.VERSION)")
306+
pip install twine
269307
pip install urllib3 requests[security] twine
270308
GPG_KEYID=$(cat dev/public_gpg_key)
271309
echo "GPG_KEYID = '$GPG_KEYID'"
@@ -308,6 +346,7 @@ jobs:
308346
$GPG_EXECUTABLE --list-keys || echo "first invocation of gpg creates directories and returns 1"
309347
$GPG_EXECUTABLE --list-keys
310348
VERSION=$(python -c "import setup; print(setup.VERSION)")
349+
pip install twine
311350
pip install urllib3 requests[security] twine
312351
GPG_KEYID=$(cat dev/public_gpg_key)
313352
echo "GPG_KEYID = '$GPG_KEYID'"
@@ -331,4 +370,4 @@ jobs:
331370
# --secret=EROTEMIC_TWINE_USERNAME=$EROTEMIC_TWINE_USERNAME \
332371
# --secret=EROTEMIC_CI_SECRET=$EROTEMIC_CI_SECRET \
333372
# --secret=EROTEMIC_TEST_TWINE_USERNAME=$EROTEMIC_TEST_TWINE_USERNAME \
334-
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
373+
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD

requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@
33
-r requirements/tests-binary.txt
44
-r requirements/jupyter.txt
55
-r requirements/colors.txt
6-
7-
#-r requirements/optional.txt

run_doctests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#!/bin/bash
2-
xdoctest ./src/xdoctest --style=google all "$@"
1+
#!/usr/bin/env bash
2+
xdoctest src/xdoctest --style=google all "$@"

run_linter.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
flake8 ./src/xdoctest --count --select=E9,F63,F7,F82 --show-source --statistics
2+
flake8 ./xdoctest --count --select=E9,F63,F7,F82 --show-source --statistics

run_tests.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import pytest
44
import sys
55
package_name = 'xdoctest'
6-
mod_dpath = './src/' + package_name
6+
mod_dpath = 'src/xdoctest'
77
test_dpath = 'tests'
88
pytest_args = [
9-
'-p', 'pytester',
10-
'-p', 'no:doctest',
119
'--cov-config', 'pyproject.toml',
1210
'--cov-report', 'html',
1311
'--cov-report', 'term',

0 commit comments

Comments
 (0)