Explorar o código

Merge pull request #7592 from ThomasWaldmann/py312

support / test on Python 3.12
TW hai 1 ano
pai
achega
2943d1c11e
Modificáronse 5 ficheiros con 13 adicións e 4 borrados
  1. 3 0
      .github/workflows/ci.yml
  2. 3 2
      pyproject.toml
  3. 5 0
      src/borg/archiver/tar_cmds.py
  4. 1 1
      src/borg/helpers/msgpack.py
  5. 1 1
      tox.ini

+ 3 - 0
.github/workflows/ci.yml

@@ -60,6 +60,9 @@ jobs:
             - os: ubuntu-22.04
               python-version: '3.11'
               toxenv: py311-fuse3
+            - os: ubuntu-22.04
+              python-version: '3.12-dev'
+              toxenv: py312-fuse3
 
     env:
       TOXENV: ${{ matrix.toxenv }}

+ 3 - 2
pyproject.toml

@@ -24,12 +24,13 @@ classifiers = [
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
     "Topic :: Security :: Cryptography",
     "Topic :: System :: Archiving :: Backup",
 ]
 license = {text="BSD"}
 dependencies = [
-  "msgpack >=1.0.3, <=1.0.5",
+  "msgpack >=1.0.3, <=1.0.6rc1",
   "packaging",
   "platformdirs >=3.0.0, <4.0.0; sys_platform == 'darwin'",  # for macOS: breaking changes in 3.0.0,
   "platformdirs >=2.6.0, <4.0.0; sys_platform != 'darwin'",  # for others: 2.6+ works consistently.
@@ -53,7 +54,7 @@ borg = "borg.archiver:main"
 borgfs = "borg.archiver:main"
 
 [build-system]
-requires = ["setuptools", "pkgconfig", "Cython", "setuptools_scm[toml]>=6.2"]
+requires = ["setuptools", "wheel", "pkgconfig", "Cython", "setuptools_scm[toml]>=6.2"]
 build-backend = "setuptools.build_meta"
 
 [tool.setuptools_scm]

+ 5 - 0
src/borg/archiver/tar_cmds.py

@@ -29,6 +29,11 @@ from ..logger import create_logger
 
 logger = create_logger(__name__)
 
+# Python 3.12+ gives a deprecation warning if TarFile.extraction_filter is None.
+# https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter
+if hasattr(tarfile, "fully_trusted_filter"):
+    tarfile.TarFile.extraction_filter = staticmethod(tarfile.fully_trusted_filter)  # type: ignore
+
 
 def get_tar_filter(fname, decompress):
     # Note that filter is None if fname is '-'.

+ 1 - 1
src/borg/helpers/msgpack.py

@@ -209,7 +209,7 @@ def is_supported_msgpack():
 
     if msgpack.version in []:  # < add bad releases here to deny list
         return False
-    return (1, 0, 3) <= msgpack.version <= (1, 0, 5)
+    return (1, 0, 3) <= msgpack.version < (1, 0, 7)
 
 
 def get_limited_unpacker(kind):

+ 1 - 1
tox.ini

@@ -2,7 +2,7 @@
 # fakeroot -u tox --recreate
 
 [tox]
-envlist = py{39,310,311}-{none,fuse2,fuse3},docs
+envlist = py{39,310,311,312}-{none,fuse2,fuse3},docs
 minversion = 3.2
 requires =
 	pkgconfig