From 01eaadf3daba10155c8a705527d4d1aef02029a8 Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Wed, 5 Jul 2023 12:10:58 +0200 Subject: [PATCH 1/3] add py3.12 to tests, replace pypy3.7&3.8 with pypy39&310 --- .github/workflows/ci.yml | 10 +++++----- CHANGELOG.md | 4 ++++ noxfile.py | 1 + setup.py | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eef293fe8..af2d6fafa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,16 +84,16 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0", "pypy-3.7", "pypy-3.8"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy-3.9", "pypy-3.10"] exclude: - os: "macos-latest" - python-version: "pypy-3.7" + python-version: "pypy-3.9" - os: "ubuntu-latest" - python-version: "pypy-3.7" + python-version: "pypy-3.9" - os: "macos-latest" - python-version: "pypy-3.8" + python-version: "pypy-3.10" - os: "windows-latest" - python-version: "pypy-3.8" + python-version: "pypy-3.10" steps: - uses: actions/checkout@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8761f3a6a..f2288240f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +* Declare official support of Python 3.12 + ### Deprecated * Deprecate `file_infos` argument. Use `file_info` instead. Old argument name won't be supported in v3. @@ -17,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fix crash on upload retry with unbound data source ### Infrastructure +* Remove unsupported PyPy versions (3.7, 3.8) from tests matrix and add PyPy 3.9 & 3.10 instead * Replaced `pyflakes` with `ruff` for linting * Refactored logic for resuming large file uploads to unify code paths, correct inconsistencies, and enhance configurability (#381) * Automatically set copyright date when generating the docs diff --git a/noxfile.py b/noxfile.py index 0c3af5811..c38822f45 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,6 +22,7 @@ '3.9', '3.10', '3.11', + '3.12', ] if NOX_PYTHONS is None else NOX_PYTHONS.split(',') PYTHON_DEFAULT_VERSION = PYTHON_VERSIONS[-1] diff --git a/setup.py b/setup.py index 16db078e2..350c1c9a9 100644 --- a/setup.py +++ b/setup.py @@ -85,6 +85,8 @@ def read_requirements(extra=None): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], # What does your project relate to? From a7b17ffed432a3ae7c2a167f4af3af51c82938fb Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Wed, 5 Jul 2023 12:55:29 +0200 Subject: [PATCH 2/3] remove pyfakefs dependency as it is currently incompatible with python3.12 and we dont really need it --- noxfile.py | 3 +-- test/unit/account_info/test_sqlite_account_info.py | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index c38822f45..ddd44dd5a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -36,7 +36,6 @@ "pytest-cov==3.0.0", "pytest-mock==3.6.1", 'pytest-lazy-fixture==0.6.3', - 'pyfakefs==4.5.6', 'pytest-xdist==2.5.0', 'pytest-timeout==2.1.0', ] @@ -104,7 +103,7 @@ def unit(session): """Run unit tests.""" install_myself(session) session.run('pip', 'install', *REQUIREMENTS_TEST) - args = ['--doctest-modules', '-p', 'pyfakefs', '-n', 'auto'] + args = ['--doctest-modules', '-n', 'auto'] if not SKIP_COVERAGE: args += ['--cov=b2sdk', '--cov-branch', '--cov-report=xml'] # TODO: Use session.parametrize for apiver diff --git a/test/unit/account_info/test_sqlite_account_info.py b/test/unit/account_info/test_sqlite_account_info.py index b3f34697a..4e0ff91fe 100644 --- a/test/unit/account_info/test_sqlite_account_info.py +++ b/test/unit/account_info/test_sqlite_account_info.py @@ -67,7 +67,11 @@ def test_migrate_to_4(self): class TestSqliteAccountProfileFileLocation: @pytest.fixture(autouse=True) - def setup(self, monkeypatch, fs): + def setup(self, monkeypatch, tmpdir): + monkeypatch.setenv( + 'HOME', str(tmpdir) + ) # this affects .expanduser() and protects the real HOME folder + monkeypatch.setenv("USERPROFILE", str(tmpdir)) # same as HOME, but for Windows monkeypatch.delenv(B2_ACCOUNT_INFO_ENV_VAR, raising=False) monkeypatch.delenv(XDG_CONFIG_HOME_ENV_VAR, raising=False) From 29d857a266d1327e7b52cd4ae3f580c3eb412cdc Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Wed, 5 Jul 2023 13:33:04 +0200 Subject: [PATCH 3/3] exclude 3.12-dev from testing for time being --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af2d6fafa..06ec5bd4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,11 @@ jobs: python-version: "pypy-3.10" - os: "windows-latest" python-version: "pypy-3.10" + # FIXME remove these exclusions after 3.12 release; 3.12-dev setlocale(...) is broken on Windows & Mac + - os: "macos-latest" + python-version: "3.12-dev" + - os: "windows-latest" + python-version: "3.12-dev" steps: - uses: actions/checkout@v3 with: