Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.10. #271

Merged
merged 25 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c240eb0
Support Python 3.10 in `bezier.Dockerfile`.
dhermes Oct 5, 2021
e98ec32
Get rid of out-of-band `nox` upgrade.
dhermes Oct 5, 2021
f1e0fd5
Updating to latest deps in `noxfile.py`.
dhermes Oct 6, 2021
2ed8be1
Add 3.10 support in `noxfile.py`.
dhermes Oct 6, 2021
06ee71a
Using 3.10 in all GitHub Actions workflows.
dhermes Oct 6, 2021
a9b146c
Replace short flag with long flag in GitHub Actions workflows.
dhermes Oct 6, 2021
2b2a9ea
Replace short flag with long flag in DEVELOPMENT.rst.
dhermes Oct 6, 2021
9b627fb
Clean up all other uses of `nox -s`.
dhermes Oct 6, 2021
54c3797
Refer to `3.10` in `DEVELOPMENT.rst`.
dhermes Oct 6, 2021
d7c095a
Refer to `3.10` in `README.rst` and related files/templates.
dhermes Oct 6, 2021
36ed862
Updating other files that reference 3.9.
dhermes Oct 6, 2021
1f41a30
Last few references to python 3.9 (as 39).
dhermes Oct 6, 2021
f12a181
Temporarily turn of fail fast for macOS and Windows.
dhermes Oct 22, 2021
2fc0e3e
Using a temporary (for now) tag for the Docker image.
dhermes Oct 26, 2021
b642802
Remove 3.7 support (hopefully got it all).
dhermes Oct 26, 2021
3ca31e5
Update tests that assume `OS_ADD_DLL_DIRECTORY` exists.
dhermes Oct 26, 2021
a71497c
Getting rid of more pre-3.8 deps.
dhermes Oct 26, 2021
eaddbdb
Maximal minimums in setup.py.
dhermes Oct 26, 2021
a396a2f
3.10 in error message.
dhermes Oct 26, 2021
6eb46de
Ran `nox -s blacken`.
dhermes Nov 8, 2021
18ebfa5
Small change to `readelf` output for doctest.
dhermes Nov 8, 2021
6df38bf
Conditional step for 3.10-32 on windows.
dhermes Nov 8, 2021
4453294
Opt out of SciPy for 3.10-32 on Windows.
dhermes Nov 8, 2021
cf13be7
Prepare PR for merging.
dhermes Nov 15, 2021
8b2ef08
Revert to "latest" image of Ubuntu CI image.
dhermes Nov 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 20 additions & 32 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
key: ubuntu-tests-pip
- uses: actions/checkout@v2
- name: Pull Docker image used for CI
run: docker pull dhermes/bezier:latest
run: docker pull dhermes/bezier:issue-270
dhermes marked this conversation as resolved.
Show resolved Hide resolved
- name: Start and detach a Docker container (max lifetime 1 hour)
run: |
docker run \
Expand All @@ -39,32 +39,28 @@ jobs:
--env MATPLOTLIBRC=tests \
--env "GITHUB_REF=${GITHUB_REF}" \
--workdir /var/code/bezier/ \
dhermes/bezier:latest \
dhermes/bezier:issue-270 \
sleep 3600
- name: Out-of-band upgrade `nox` to latest
run: |
docker exec dhermes-bezier \
python -m pip install --upgrade 'nox >= 2021.10.1'
- name: Unit tests in Python 3.7
- name: Unit tests in Python 3.8
run: |
docker exec dhermes-bezier \
nox -s "unit-3.7"
- name: Unit tests in Python 3.8
nox --session "unit-3.8"
- name: Unit tests in Python 3.9
run: |
docker exec dhermes-bezier \
nox -s "unit-3.8"
nox --session "unit-3.9"
- name: Unit tests in pypy3
run: |
docker exec dhermes-bezier \
nox -s "unit-pypy3"
- name: Unit tests AND line coverage in Python 3.9
nox --session "unit-pypy3"
- name: Unit tests AND line coverage in Python 3.10
run: |
docker exec dhermes-bezier \
nox -s cover
- name: Functional tests in Python 3.9
nox --session cover
- name: Functional tests in Python 3.10
run: |
docker exec dhermes-bezier \
nox -s "functional-3.9"
nox --session "functional-3.10"
- name: Upload coverage to coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand All @@ -82,7 +78,7 @@ jobs:
key: ubuntu-lint-pip
- uses: actions/checkout@v2
- name: Pull Docker image used for CI
run: docker pull dhermes/bezier:latest
run: docker pull dhermes/bezier:issue-270
- name: Start and detach a Docker container (max lifetime 1 hour)
run: |
docker run \
Expand All @@ -94,24 +90,20 @@ jobs:
--env MATPLOTLIBRC=tests \
--env "GITHUB_REF=${GITHUB_REF}" \
--workdir /var/code/bezier/ \
dhermes/bezier:latest \
dhermes/bezier:issue-270 \
sleep 3600
- name: Out-of-band upgrade `nox` to latest
run: |
docker exec dhermes-bezier \
python -m pip install --upgrade 'nox >= 2021.10.1'
- name: Check that all Cython generated files have been updated
run: |
docker exec dhermes-bezier \
nox -s "update_generated(check=True)"
nox --session "update_generated(check=True)"
- name: Lint code for style issues
run: |
docker exec dhermes-bezier \
nox -s lint
nox --session lint
- name: Check that test case examples are valid for JSON schema
run: |
docker exec dhermes-bezier \
nox -s validate_functional_test_cases
nox --session validate_functional_test_cases
docs:
runs-on: ubuntu-20.04
steps:
Expand All @@ -121,7 +113,7 @@ jobs:
key: ubuntu-docs-pip
- uses: actions/checkout@v2
- name: Pull Docker image used for CI
run: docker pull dhermes/bezier:latest
run: docker pull dhermes/bezier:issue-270
- name: Start and detach a Docker container (max lifetime 1 hour)
run: |
docker run \
Expand All @@ -133,17 +125,13 @@ jobs:
--env MATPLOTLIBRC=tests \
--env "GITHUB_REF=${GITHUB_REF}" \
--workdir /var/code/bezier/ \
dhermes/bezier:latest \
dhermes/bezier:issue-270 \
sleep 3600
- name: Out-of-band upgrade `nox` to latest
run: |
docker exec dhermes-bezier \
python -m pip install --upgrade 'nox >= 2021.10.1'
- name: Run all doctests
run: |
docker exec dhermes-bezier \
nox -s doctest
nox --session doctest
- name: Build docs
run: |
docker exec dhermes-bezier \
nox -s docs
nox --session docs
3 changes: 2 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ jobs:
PY_VERSION: '${{ matrix.python-version }}'
PY_BIN_DIR: '/Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}/bin'
strategy:
fail-fast: false # Temporary
dhermes marked this conversation as resolved.
Show resolved Hide resolved
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- uses: actions/cache@v2
with:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ jobs:
MINGW_32: 'C:\msys64\mingw32\bin'
MINGW_64: 'C:\msys64\mingw64\bin'
strategy:
fail-fast: false # Temporary
dhermes marked this conversation as resolved.
Show resolved Hide resolved
matrix:
nox-session:
- unit-3.7-32
- unit-3.7
- unit-3.8-32
- unit-3.8
- unit-3.9-32
- unit-3.9
- unit-3.10-32
- cover
- functional-3.9
- functional-3.10
- doctest
steps:
- uses: actions/cache@v2
Expand All @@ -57,6 +58,12 @@ jobs:
}
$env:Path = "$MINGW;" + $env:Path
gfortran --version
- name: Support `py -3.10-32` on Windows
uses: actions/setup-python@v2
if: ${{ matrix.nox-session == 'unit-3.10-32' }}
with:
python-version: '3.10.0'
architecture: x86
- name: Invoke nox
shell: powershell
run: |
Expand Down
80 changes: 40 additions & 40 deletions DEVELOPMENT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ In order to add a feature to ``bezier``:
proposed changes (i.e. just sending a large PR with a finished
feature may catch maintainer(s) off guard).

#. **Add tests**: The feature must work fully on CPython versions 3.7, 3.8 and
3.9 and on PyPy 3; on Linux, macOS and Windows. In addition, the feature
should have 100% line coverage.
#. **Add tests**: The feature must work fully on CPython versions 3.8, 3.9
and 3.10 and on PyPy 3; on Linux, macOS and Windows. In addition, the
feature should have 100% line coverage.

#. **Documentation**: The feature must (should) be documented with
helpful `doctest`_ examples wherever relevant.
Expand Down Expand Up @@ -85,8 +85,8 @@ To explicitly disable the building of the extension, the

$ BEZIER_NO_EXTENSION=True .../bin/python -m pip wheel .

This environment variable is actually used for the ``nox -s docs`` session
to emulate the `RTD`_ build environment (where no Fortran compiler is
This environment variable is actually used for the ``nox --session docs``
session to emulate the `RTD`_ build environment (where no Fortran compiler is
present).

Dependencies
Expand All @@ -112,21 +112,21 @@ We recommend using `Nox`_ to run unit tests:

.. code-block:: console

$ nox -s "unit-3.7"
$ nox -s "unit-3.8"
$ nox -s "unit-3.9"
$ nox -s "unit-pypy3"
$ nox -s unit # Run all versions
$ nox --session "unit-3.8"
$ nox --session "unit-3.9"
$ nox --session "unit-3.10"
$ nox --session "unit-pypy3"
$ nox --session unit # Run all versions

However, `pytest`_ can be used directly (though it won't
manage dependencies or build the binary extension):

.. code-block:: console

$ PYTHONPATH=src/python/ python3.7 -m pytest tests/unit/
$ PYTHONPATH=src/python/ python3.8 -m pytest tests/unit/
$ PYTHONPATH=src/python/ python3.9 -m pytest tests/unit/
$ PYTHONPATH=src/python/ pypy3 -m pytest tests/unit/
$ PYTHONPATH=src/python/ python3.8 -m pytest tests/unit/
$ PYTHONPATH=src/python/ python3.9 -m pytest tests/unit/
$ PYTHONPATH=src/python/ python3.10 -m pytest tests/unit/
$ PYTHONPATH=src/python/ pypy3 -m pytest tests/unit/

.. _Nox: https://nox.readthedocs.io
.. _pytest: https://docs.pytest.org
Expand Down Expand Up @@ -165,7 +165,7 @@ To run the coverage report locally:

.. code-block:: console

$ nox -s cover
$ nox --session cover
$ # OR
$ PYTHONPATH=src/python/ python -m pytest \
> --cov=bezier \
Expand All @@ -180,17 +180,17 @@ marked slow, use the ``--ignore-slow`` flag:

.. code-block:: console

$ nox -s "unit-3.7" -- --ignore-slow
$ nox -s "unit-3.8" -- --ignore-slow
$ nox -s "unit-3.9" -- --ignore-slow
$ nox -s unit -- --ignore-slow
$ nox --session "unit-3.8" -- --ignore-slow
$ nox --session "unit-3.9" -- --ignore-slow
$ nox --session "unit-3.10" -- --ignore-slow
$ nox --session unit -- --ignore-slow

These slow tests have been identified via:

.. code-block:: console

$ ...
$ nox -s "unit-3.9" -- --durations=10
$ nox --session "unit-3.10" -- --durations=10

and then marked with ``pytest.mark.skipif``.

Expand Down Expand Up @@ -250,16 +250,16 @@ To run the functional tests:

.. code-block:: console

$ nox -s "functional-3.7"
$ nox -s "functional-3.8"
$ nox -s "functional-3.9"
$ nox -s "functional-pypy3"
$ nox -s functional # Run all versions
$ nox --session "functional-3.8"
$ nox --session "functional-3.9"
$ nox --session "functional-3.10"
$ nox --session "functional-pypy3"
$ nox --session functional # Run all versions
$ # OR
$ PYTHONPATH=src/python/ python3.7 -m pytest tests/functional/
$ PYTHONPATH=src/python/ python3.8 -m pytest tests/functional/
$ PYTHONPATH=src/python/ python3.9 -m pytest tests/functional/
$ PYTHONPATH=src/python/ pypy3 -m pytest tests/functional/
$ PYTHONPATH=src/python/ python3.8 -m pytest tests/functional/
$ PYTHONPATH=src/python/ python3.9 -m pytest tests/functional/
$ PYTHONPATH=src/python/ python3.10 -m pytest tests/functional/
$ PYTHONPATH=src/python/ pypy3 -m pytest tests/functional/

.. _functional tests: https://github.com/dhermes/bezier/tree/main/tests/functional

Expand Down Expand Up @@ -325,7 +325,7 @@ To check compliance:

.. code-block:: console

$ nox -s lint
$ nox --session lint

A few extensions and overrides have been specified in the `pylintrc`_
configuration for ``bezier``.
Expand Down Expand Up @@ -375,8 +375,8 @@ To build the documentation locally:

.. code-block:: console

$ nox -s docs
$ # OR (from a Python 3.7 or later environment)
$ nox --session docs
$ # OR (from a Python 3.8 or later environment)
$ PYTHONPATH=src/python/ ./scripts/build_docs.sh

Documentation Snippets
Expand All @@ -391,8 +391,8 @@ To run the documentation tests:

.. code-block:: console

$ nox -s doctest
$ # OR (from a Python 3.7 or later environment)
$ nox --session doctest
$ # OR (from a Python 3.8 or later environment)
$ PYTHONPATH=src/python/:. sphinx-build -W \
> -b doctest \
> -d docs/build/doctrees \
Expand All @@ -414,8 +414,8 @@ To regenerate all the images:

.. code-block:: console

$ nox -s docs_images
$ # OR (from a Python 3.7 or later environment)
$ nox --session docs_images
$ # OR (from a Python 3.8 or later environment)
$ export MATPLOTLIBRC=docs/ GENERATE_IMAGES=True PYTHONPATH=src/python/
$ sphinx-build -W \
> -b doctest \
Expand Down Expand Up @@ -496,14 +496,14 @@ Supported Python Versions

``bezier`` explicitly supports:

- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `PyPy 3`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _PyPy 3: https://pypy.org/

Supported versions can be found in the ``noxfile.py`` `config`_.
Expand Down Expand Up @@ -552,8 +552,8 @@ services:

- ``WHEELHOUSE``: If set, this gives a path to prebuilt NumPy and SciPy wheels
for PyPy 3.
- ``GENERATE_IMAGES``: Indicates to ``nox -s doctest`` that images should
be generated during cleanup of each test case.
- ``GENERATE_IMAGES``: Indicates to ``nox --session doctest`` that images
should be generated during cleanup of each test case.
- ``READTHEDOCS``: Indicates currently running on Read The Docs (RTD). This is
used to tell Sphinx to use the RTD theme when **not** running on RTD.
- ``COVERALLS_REPO_TOKEN``: To upload the coverage report.
Loading