Skip to content

Commit

Permalink
Updating unit tests to support Python 3.12.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvanbrunt committed Sep 12, 2024
1 parent 5ee1f15 commit afa8019
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Removed dependency on `attrs` and replaced with [dataclasses](https://docs.python.org/3/library/dataclasses.html)
* add `allow_clipboard` initialization parameter and attribute to disable ability to
add output to the operating system clipboard
* Updated unit tests to be Python 3.12 compliant.
* Deletions (potentially breaking changes)
* Removed `apply_style` from `Cmd.pwarning()`.

Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def docs(session):
)


@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11'])
@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'])
@nox.parametrize('plugin', [None, 'ext_test', 'template', 'coverage'])
def tests(session, plugin):
if plugin is None:
Expand All @@ -41,7 +41,7 @@ def tests(session, plugin):
)


@nox.session(python=['3.8', '3.9', '3.10', '3.11'])
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
@nox.parametrize('step', ['mypy', 'flake8'])
def validate(session, step):
session.install('invoke', './[validate]')
Expand Down
2 changes: 1 addition & 1 deletion plugins/ext_test/build-pyenvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# virtualenvs will be added to '.python-version'. Feel free to modify
# this list, but note that this script intentionally won't install
# dev, rc, or beta python releases
declare -a pythons=("3.7" "3.8" "3.9", "3.10", "3.11")
declare -a pythons=("3.7" "3.8" "3.9", "3.10", "3.11", "3.12")

# function to find the latest patch of a minor version of python
function find_latest_version {
Expand Down
2 changes: 1 addition & 1 deletion plugins/ext_test/noxfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nox


@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11'])
@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'])
def tests(session):
session.install('invoke', './[test]')
session.run('invoke', 'pytest', '--junit', '--no-pty')
1 change: 1 addition & 0 deletions plugins/ext_test/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
# dependencies for development and testing
# $ pip install -e .[dev]
Expand Down
6 changes: 3 additions & 3 deletions plugins/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ tiered testing strategy to accomplish this objective.
- [pytest](https://pytest.org) runs the unit tests
- [nox](https://nox.thea.codes/en/stable/) runs the unit tests on multiple versions
of python
- [GitHub Actions](https://github.com/features/actions) runs the tests on the various
- [GitHub Actions](https://github.com/features/actions) runs the tests on the various
supported platforms

This plugin template is set up to use the same strategy.
Expand Down Expand Up @@ -291,8 +291,8 @@ unit tests found in the `tests` directory.
### Use nox to run unit tests in multiple versions of python

The included `noxfile.py` is setup to run the unit tests in python 3.7, 3.8,
3.9, 3.10, and 3.11 You can run your unit tests in all of these versions of
python by:
3.9, 3.10, 3.11, and 3.12 You can run your unit tests in all of these versions
of python by:
```
$ nox
```
Expand Down
2 changes: 1 addition & 1 deletion plugins/template/build-pyenvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# virtualenvs will be added to '.python-version'. Feel free to modify
# this list, but note that this script intentionally won't install
# dev, rc, or beta python releases
declare -a pythons=("3.7" "3.8" "3.9" "3.10" "3.11")
declare -a pythons=("3.7" "3.8" "3.9" "3.10" "3.11", "3.12")

# function to find the latest patch of a minor version of python
function find_latest_version {
Expand Down
2 changes: 1 addition & 1 deletion plugins/template/noxfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nox


@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11'])
@nox.session(python=['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'])
def tests(session):
session.install('invoke', './[test]')
session.run('invoke', 'pytest', '--junit', '--no-pty')
1 change: 1 addition & 0 deletions plugins/template/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
# dependencies for development and testing
# $ pip install -e .[dev]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines(),
Expand Down

0 comments on commit afa8019

Please sign in to comment.