Skip to content

Commit c97a5a3

Browse files
committed
Update xcookie CI
Update type annotations Update setup for 311 wip Fixup path ref Update test requirements for 311 Forgot to bump version number Update CCI More verbosity in tests wip add docs got pyproject ignore Does changing package_dir help? readd keywords Try to fix setup.py Fix find-packages dir wip wip
1 parent fe624a7 commit c97a5a3

21 files changed

+329
-234
lines changed

.circleci/config.yml

+18-14
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ jobs:
118118
name: run tests
119119
command: |
120120
. venv/bin/activate
121+
ls
122+
$PYTHON_EXE -m pip freeze
121123
$PYTHON_EXE run_tests.py
122124
# Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration)
123-
codecov
124-
- store_artifacts:
125-
path: test-reports
126-
destination: test-reports
127-
- store_artifacts:
128-
path: .coverage
129-
destination: .coverage
125+
#codecov
126+
#- store_artifacts:
127+
# path: test-reports
128+
# destination: test-reports
129+
#- store_artifacts:
130+
# path: .coverage
131+
# destination: .coverage
130132

131133

132134
.test_full_template: &test_full_template
@@ -160,15 +162,17 @@ jobs:
160162
name: run tests
161163
command: |
162164
. venv/bin/activate
165+
ls
166+
$PYTHON_EXE -m pip freeze
163167
$PYTHON_EXE run_tests.py
164168
# Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration)
165-
codecov
166-
- store_artifacts:
167-
path: test-reports
168-
destination: test-reports
169-
- store_artifacts:
170-
path: .coverage
171-
destination: .coverage
169+
#codecov
170+
#- store_artifacts:
171+
# path: test-reports
172+
# destination: test-reports
173+
#- store_artifacts:
174+
# path: .coverage
175+
# destination: .coverage
172176

173177

174178
###################################

.github/workflows/tests.yml

+79-41
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Based on ~/code/xcookie/xcookie/rc/tests.yml.in
44
# Now based on ~/code/xcookie/xcookie/builders/github_actions.py
55

6-
name: PurePy Build and Test
6+
name: PurePyCI
77

88
on:
99
push:
@@ -16,10 +16,10 @@ jobs:
1616
steps:
1717
- name: Checkout source
1818
uses: actions/checkout@v3
19-
- name: Set up Python 3.8
19+
- name: Set up Python 3.11 for linting
2020
uses: actions/[email protected]
2121
with:
22-
python-version: 3.8
22+
python-version: '3.11'
2323
- name: Install dependencies
2424
run: |-
2525
python -m pip install --upgrade pip
@@ -34,15 +34,15 @@ jobs:
3434
mypy --install-types --non-interactive ./src/xdoctest
3535
mypy ./src/xdoctest
3636
build_and_test_sdist:
37-
name: Test sdist Python 3.8
37+
name: Build sdist
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: Checkout source
4141
uses: actions/checkout@v3
42-
- name: Set up Python 3.8
42+
- name: Set up Python 3.11
4343
uses: actions/[email protected]
4444
with:
45-
python-version: 3.8
45+
python-version: '3.11'
4646
- name: Upgrade pip
4747
run: |-
4848
python -m pip install --upgrade pip
@@ -57,7 +57,7 @@ jobs:
5757
- name: Install sdist
5858
run: |-
5959
ls -al ./wheelhouse
60-
pip install wheelhouse/xdoctest*.tar.gz -v
60+
pip install --prefer-binary wheelhouse/xdoctest*.tar.gz -v
6161
- name: Test minimal loose sdist
6262
run: |-
6363
pwd
@@ -92,9 +92,48 @@ jobs:
9292
with:
9393
name: wheels
9494
path: ./wheelhouse/*.tar.gz
95-
build_and_test_purepy_wheels:
95+
build_purepy_wheels:
9696
name: ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
9797
runs-on: ${{ matrix.os }}
98+
strategy:
99+
matrix:
100+
os:
101+
- ubuntu-latest
102+
python-version:
103+
- '3.11'
104+
arch:
105+
- auto
106+
steps:
107+
- name: Checkout source
108+
uses: actions/checkout@v3
109+
- name: Set up QEMU
110+
uses: docker/setup-qemu-action@v2
111+
if: runner.os == 'Linux' && matrix.arch != 'auto'
112+
with:
113+
platforms: all
114+
- name: Setup Python
115+
uses: actions/[email protected]
116+
with:
117+
python-version: ${{ matrix.python-version }}
118+
- name: Build pure wheel
119+
shell: bash
120+
run: |-
121+
python -m pip install pip -U
122+
python -m pip install setuptools>=0.8 build
123+
python -m build --wheel --outdir wheelhouse
124+
- name: Show built files
125+
shell: bash
126+
run: ls -la wheelhouse
127+
- uses: actions/upload-artifact@v3
128+
name: Upload wheels artifact
129+
with:
130+
name: wheels
131+
path: ./wheelhouse/xdoctest*.whl
132+
test_purepy_wheels:
133+
name: ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
134+
runs-on: ${{ matrix.os }}
135+
needs:
136+
- build_purepy_wheels
98137
strategy:
99138
matrix:
100139
include:
@@ -219,12 +258,12 @@ jobs:
219258
uses: actions/checkout@v3
220259
- name: Enable MSVC 64bit
221260
uses: ilammy/msvc-dev-cmd@v1
222-
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
223-
- name: Enable MSVC 32bit
224-
uses: ilammy/msvc-dev-cmd@v1
225-
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
226-
with:
227-
arch: x86
261+
if: matrix.os == 'windows-latest' # && ${{ contains(matrix.cibw_skip, '*-win32') }}
262+
#- name: Enable MSVC 32bit
263+
# uses: ilammy/msvc-dev-cmd@v1
264+
# if: matrix.os == 'windows-latest' && ${{ contains(matrix.cibw_skip, '*-win_amd64') }}
265+
# with:
266+
# arch: x86
228267
- name: Set up QEMU
229268
uses: docker/setup-qemu-action@v2
230269
if: runner.os == 'Linux' && matrix.arch != 'auto'
@@ -234,49 +273,51 @@ jobs:
234273
uses: actions/[email protected]
235274
with:
236275
python-version: ${{ matrix.python-version }}
237-
- name: Build pure wheel
238-
shell: bash
239-
run: |-
240-
python -m pip install pip -U
241-
python -m pip install setuptools>=0.8 build
242-
python -m build --wheel --outdir wheelhouse
276+
- uses: actions/download-artifact@v3
277+
name: Download wheels and sdist
278+
with:
279+
name: wheels
280+
path: wheelhouse
243281
- name: Test wheel with ${{ matrix.install-extras }}
244282
shell: bash
245283
env:
246284
INSTALL_EXTRAS: ${{ matrix.install-extras }}
247285
CI_PYTHON_VERSION: py${{ matrix.python-version }}
248286
run: |-
249-
# Find the path to the wheel
250-
ls wheelhouse
287+
echo "Finding the path to the wheel"
288+
ls -al wheelhouse
289+
echo "Installing helpers"
251290
pip install tomli pkginfo
252291
MOD_NAME=xdoctest
253292
echo "MOD_NAME=$MOD_NAME"
254293
WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('$MOD_NAME*.whl'))[-1]).replace(chr(92), chr(47)))")
255294
echo "WHEEL_FPATH=$WHEEL_FPATH"
256295
MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
257296
echo "MOD_VERSION=$MOD_VERSION"
258-
# Install the wheel (ensure we are using the version we just built)
297+
echo "Install the wheel (ensureing we are using the version we just built)"
259298
# 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
261-
# Create a sandboxed directory
299+
pip install --prefer-binary "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
300+
echo "Install finished. Creating a sandbox directory to test it"
262301
WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
302+
echo "WORKSPACE_DNAME=$WORKSPACE_DNAME"
263303
mkdir -p $WORKSPACE_DNAME
304+
echo "cd-ing into the workspace"
264305
cd $WORKSPACE_DNAME
306+
pwd
307+
ls -al
308+
pip freeze
265309
# Get the path to the installed package and run the tests
266310
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
267311
echo "MOD_DPATH = $MOD_DPATH"
312+
echo "running the pytest command inside the workspace"
268313
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="$MOD_NAME" "$MOD_DPATH" ../tests
314+
echo "pytest command finished, moving the coverage file to the repo root"
315+
ls -al
269316
# Move coverage file to a new name
270317
mv .coverage "../.coverage.$WORKSPACE_DNAME"
318+
echo "changing directory back to th repo root"
271319
cd ..
272-
- name: Show built files
273-
shell: bash
274-
run: ls -la wheelhouse
275-
- name: Set up Python 3.8 to combine coverage Linux
276-
uses: actions/[email protected]
277-
if: runner.os == 'Linux'
278-
with:
279-
python-version: 3.8
320+
ls -al
280321
- name: Combine coverage Linux
281322
if: runner.os == 'Linux'
282323
run: |-
@@ -295,18 +336,14 @@ jobs:
295336
name: Codecov Upload
296337
with:
297338
file: ./tests/coverage.xml
298-
- uses: actions/upload-artifact@v3
299-
name: Upload wheels artifact
300-
with:
301-
name: wheels
302-
path: ./wheelhouse/xdoctest*.whl
303339
test_deploy:
304340
name: Uploading Test to PyPi
305341
runs-on: ubuntu-latest
306342
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release')
307343
needs:
308344
- build_and_test_sdist
309-
- build_and_test_purepy_wheels
345+
- build_purepy_wheels
346+
- test_purepy_wheels
310347
steps:
311348
- name: Checkout source
312349
uses: actions/checkout@v3
@@ -349,7 +386,8 @@ jobs:
349386
if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
350387
needs:
351388
- build_and_test_sdist
352-
- build_and_test_purepy_wheels
389+
- build_purepy_wheels
390+
- test_purepy_wheels
353391
steps:
354392
- name: Checkout source
355393
uses: actions/checkout@v3
@@ -405,4 +443,4 @@ jobs:
405443
# --secret=EROTEMIC_TWINE_USERNAME=$EROTEMIC_TWINE_USERNAME \
406444
# --secret=EROTEMIC_CI_SECRET=$EROTEMIC_CI_SECRET \
407445
# --secret=EROTEMIC_TEST_TWINE_USERNAME=$EROTEMIC_TEST_TWINE_USERNAME \
408-
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
446+
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1010
### Changed
1111

1212
* Binary tests are now only run on "full" installs to reduce minimal dependencies.
13+
* Support for Python 3.11
14+
* Minor typing fixes
1315

1416

1517
## Version 1.1.0 - Released 2022-09-05

dev/port_ubelt_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def _autogen_xdoctest_utils():
4444
'''
4545
# -*- coding: utf-8 -*-
4646
"""
47-
This file was autogenerated based on code in ubelt
47+
This file was autogenerated based on code in ubelt via
48+
dev/port_ubelt_utils.py in the xdoctest repo
4849
"""
4950
from __future__ import print_function, division, absolute_import, unicode_literals
5051
''')

pyproject.toml

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ description = "A rewrite of the builtin doctest module"
1818
url = "https://github.com/Erotemic/xdoctest"
1919
license = "Apache 2"
2020
dev_status = "stable"
21+
typed = true
2122
classifiers = [
2223
"Development Status :: 5 - Production/Stable",
2324
"Intended Audience :: Developers",
@@ -29,6 +30,7 @@ classifiers = [
2930
"License :: OSI Approved :: Apache Software License",
3031
# Supported Python versions
3132
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.11",
3234
"Programming Language :: Python :: 3.10",
3335
"Programming Language :: Python :: 3.9",
3436
"Programming Language :: Python :: 3.8",
@@ -38,6 +40,9 @@ classifiers = [
3840
"Programming Language :: Python :: Implementation :: CPython",
3941
]
4042

43+
[tool.xcookie.setuptools]
44+
keywords = '"xdoctest,doctest,test,docstr,pytest"'
45+
4146
[tool.xcookie.entry_points]
4247
# the pytest11 entry point makes the plugin available to pytest
4348
pytest11 = [
@@ -50,8 +55,8 @@ console_scripts = [
5055

5156

5257
[tool.pytest.ini_options]
53-
addopts = "-p no:doctest --xdoctest --xdoctest-style=google --ignore-glob=setup.py --ignore-glob=dev"
54-
norecursedirs = ".git ignore build __pycache__ dev _skbuild"
58+
addopts = "-p no:doctest --xdoctest --xdoctest-style=google --ignore-glob=setup.py --ignore-glob=dev --ignore-glob=docs"
59+
norecursedirs = ".git ignore build __pycache__ dev _skbuild docs"
5560
filterwarnings = [ "default", "ignore:.*No cfgstr given in Cacher constructor or call.*:Warning", "ignore:.*Define the __nice__ method for.*:Warning", "ignore:.*private pytest class or function.*:Warning",]
5661

5762
[tool.coverage.run]

requirements/tests-binary.txt

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# For testing doctests in binary extension modules
2-
scikit-build>=0.11.1
3-
cmake>=3.21.2
4-
ninja>=1.10.2
5-
pybind11>=2.7.1
2+
3+
scikit-build>=0.16.1 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
4+
scikit-build>=0.11.1 ; python_version < '3.11' # Python <=3.10
5+
6+
ninja>=1.11.1 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
7+
ninja>=1.10.2 ; python_version < '3.11' # Python <=3.10
8+
9+
pybind11>=2.10.3 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
10+
pybind11>=2.7.1 ; python_version < '3.11' # Python <=3.10
11+
12+
cmake>=3.25.0 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
13+
cmake>=3.21.2 ; python_version < '3.11' # Python <=3.10

0 commit comments

Comments
 (0)