diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eef293fe8..06ec5bd4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,16 +84,21 @@ 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" + # 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: 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..ddd44dd5a 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] @@ -35,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', ] @@ -103,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/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? 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)