From eba0b24331fdc2a06fee0e0170d6b2d103ad6677 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 10 Sep 2023 10:27:54 -0500 Subject: [PATCH 1/3] Resolve a Python 3.12 `DeprecationWarning` --- tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2ede2e5..162781b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -219,7 +219,10 @@ def root(standardize_tmp): finally: [patch.stop() for patch in patches] os.chdir(current_working_directory) - rmtree(current_root, onerror=rmtree_error_handler) + if sys.version_info >= (3, 12): + rmtree(current_root, onexc=rmtree_error_handler) + else: + rmtree(current_root, onerror=rmtree_error_handler) @pytest.fixture From 9bb82306f49ad4edc1a40421373b64543d74ecbe Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 10 Sep 2023 10:28:14 -0500 Subject: [PATCH 2/3] Configure pytest to escalate warnings to errors during testing --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4c3e7ae..cd19754 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,3 +10,8 @@ exclude = ''' | lib )/ ''' + +[tool.pytest.ini_options] +filterwarnings = [ + "error", +] From 26720b826479b9f4d201478f6f6416c13d6b502c Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 10 Sep 2023 10:34:20 -0500 Subject: [PATCH 3/3] Add Python 3.12 to the test suite; mark it as supported --- .github/workflows/build.yml | 5 ++++- setup.py | 1 + tox.ini | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc2f485..810092f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-20.04", "macos-latest"] - python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.9"] + python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.9"] include: - os: "windows-latest" python: "3.8" @@ -22,6 +22,8 @@ jobs: python: "3.10" - os: "windows-latest" python: "3.11" + - os: "windows-latest" + python: "3.12" runs-on: ${{ matrix.os }} name: "Test: Python ${{ matrix.python }} on ${{ matrix.os }}" steps: @@ -31,6 +33,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} + allow-prereleases: true - name: "Install dependencies" run: | python -m pip install --upgrade pip setuptools diff --git a/setup.py b/setup.py index 3153aae..06bc7bf 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ setup( "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Utilities", ], keywords="dotfiles", diff --git a/tox.ini b/tox.ini index 711fba3..43c926d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ ; All older versions, and PyPy, lack full symlink support. envlist = coverage_erase - py{38, 39, 310, 311}-all_platforms + py{38, 39, 310, 311, 312}-all_platforms py{36, 37}-most_platforms pypy3-most_platforms coverage_report @@ -64,6 +64,7 @@ python = 3.9: py39-all_platforms 3.10: py310-all_platforms 3.11: py311-all_platforms + 3.12: py312-all_platforms ; Run on most platforms (Linux and Mac) pypy-3.9: pypy3-most_platforms