From fb0efb33aa87e1d824b3f5f9c19631eeee7aea2d Mon Sep 17 00:00:00 2001 From: James Gerity Date: Wed, 4 Oct 2023 22:13:59 -0400 Subject: [PATCH 1/3] build: update setuptools pin Versions of setuptools before 66.1 used deprecated portions of `pkgutil` that were removed in Python 3.12. More information: https://github.com/pypa/setuptools/issues/3631 https://setuptools.pypa.io/en/latest/history.html#v66-1-0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a5b9ac664..bc2d00de1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools~=63.0", "wheel"] +requires = ["setuptools~=66.1", "wheel"] build-backend = "setuptools.build_meta" [tool.setuptools] From 86d67b2b05585b88e96006f5b72351e3458dc055 Mon Sep 17 00:00:00 2001 From: James Gerity Date: Thu, 5 Oct 2023 01:19:04 -0400 Subject: [PATCH 2/3] ci, contrib, meta: add Python 3.12 --- .github/workflows/ci.yml | 1 + contrib/tox.ini | 8 +++++--- pyproject.toml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b96606009..b8b7d05b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - "3.9" - "3.10" - "3.11" + - "3.12" steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/contrib/tox.ini b/contrib/tox.ini index ebcf3a424..975f5a0b4 100644 --- a/contrib/tox.ini +++ b/contrib/tox.ini @@ -2,12 +2,12 @@ package_root = . min_version = 4.3.3 envlist = - py{38,39,310,311}-qa + py{38,39,310,311,312}-qa skip_missing_interpreters = true ignore_base_python_conflict = true labels = - lint = py{38,39,310,311}-lint - test = py{38,39,310,311}-test + lint = py{38,39,310,311,312}-lint + test = py{38,39,310,311,312}-test [testenv] @@ -20,11 +20,13 @@ envname = py39: py39 py310: py310 py311: py311 + py312: py312 envdir = py38: {toxinidir}/.tox/py38 py39: {toxinidir}/.tox/py39 py310: {toxinidir}/.tox/py310 py311: {toxinidir}/.tox/py311 + py312: {toxinidir}/.tox/py312 depends = base deps = diff --git a/pyproject.toml b/pyproject.toml index bc2d00de1..cff96f1ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Communications :: Chat :: Internet Relay Chat", ] requires-python = ">=3.8" From a4b36fb77686a043f86b11ebe06a4ce2ab31c45e Mon Sep 17 00:00:00 2001 From: James Gerity Date: Mon, 30 Oct 2023 10:19:31 -0400 Subject: [PATCH 3/3] doc, test: update pytest requirement, drop py.test references This bump to `pytest` is primarily to eliminate some deprecation warnings from inside of `pytest` itself, but note that this relaxes our dependency to 2 release fields instead of 3, meaning that we will automatically get 'minor' upgrades to `pytest` (up to 8.0 exclusive) As of `pytest` 7.2.0, `py` is no longer in our dependency graph, so we should not refer to this older and sorta-deprecated library, especially when invoking `pytest`. --- Makefile | 8 ++++---- dev-requirements.txt | 2 +- docs/source/plugin/test.rst | 2 +- sopel/tests/mocks.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a94641616..94f35a7d3 100644 --- a/Makefile +++ b/Makefile @@ -12,20 +12,20 @@ lint-type: .PHONY: test test_norecord test_novcr vcr_rerecord test: - coverage run -m py.test -v . + coverage run -m pytest -v . test_norecord: # error if VCR recording for a web request is missing (useful on CI) - coverage run -m py.test -v . --vcr-record=none + coverage run -m pytest -v . --vcr-record=none test_novcr: # disable VCR completely; useful to check if recordings are outdated - coverage run -m py.test -v . --disable-vcr + coverage run -m pytest -v . --disable-vcr vcr_rerecord: # clear VCR cassettes and run tests to record fresh ones rm -rf ./test/vcr/* - coverage run -m py.test -v . --vcr-record=all + coverage run -m pytest -v . --vcr-record=all .PHONY: coverage_report coverage_html coverages coverage_report: diff --git a/dev-requirements.txt b/dev-requirements.txt index c83774327..39c25f980 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,7 +7,7 @@ flake8-import-order flake8-type-checking; python_version >= '3.8' # Sphinx theme furo==2023.9.10 -pytest~=7.1.0 +pytest~=7.4 pytest-vcr~=1.0.2 requests-mock~=1.9.3 sphinx>=7.1.0,<8; python_version <= '3.8' diff --git a/docs/source/plugin/test.rst b/docs/source/plugin/test.rst index ce77501b4..a5e5f233e 100644 --- a/docs/source/plugin/test.rst +++ b/docs/source/plugin/test.rst @@ -33,7 +33,7 @@ Assuming your test files are in the ``test`` folder in your project directory:: You can run your test suite with:: - py.test -v test/ + pytest -v test/ .. __: https://docs.pytest.org/en/stable/getting-started.html diff --git a/sopel/tests/mocks.py b/sopel/tests/mocks.py index 94738d233..429fb68e0 100644 --- a/sopel/tests/mocks.py +++ b/sopel/tests/mocks.py @@ -108,7 +108,7 @@ class MockIRCServer: ``blocking`` arguments to the instance methods below. The :class:`~sopel.tests.factories.IRCFactory` factory can be used to - create such mock object, either directly or by using ``py.test`` and the + create such mock object, either directly or by using ``pytest`` and the :func:`~sopel.tests.pytest_plugin.ircfactory` fixture. .. versionadded:: 7.1 @@ -361,7 +361,7 @@ class MockUser: :param str host: user's host The :class:`~sopel.tests.factories.UserFactory` factory can be used to - create such mock object, either directly or by using ``py.test`` and the + create such mock object, either directly or by using ``pytest`` and the :func:`~sopel.tests.pytest_plugin.userfactory` fixture. """ def __init__(self, nick=None, user=None, host=None):