Browse Source

Merge pull request #7844 from ThomasWaldmann/py312-1.2

support python 3.12 (1.2-maint)
TW 1 year ago
parent
commit
4188e03ffc
5 changed files with 12 additions and 2 deletions
  1. 3 0
      .github/workflows/ci.yml
  2. 1 1
      pyproject.toml
  3. 1 0
      setup.py
  4. 6 0
      src/borg/archiver.py
  5. 1 1
      tox.ini

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

@@ -64,6 +64,9 @@ jobs:
             - os: ubuntu-20.04
             - os: ubuntu-20.04
               python-version: '3.11'
               python-version: '3.11'
               toxenv: py311-fuse2
               toxenv: py311-fuse2
+            - os: ubuntu-22.04
+              python-version: '3.12-dev'
+              toxenv: py312-fuse3
             - os: macos-12
             - os: macos-12
               python-version: '3.8'
               python-version: '3.8'
               toxenv: py38-none  # note: no fuse testing, due to #6099, see also #6196.
               toxenv: py38-none  # note: no fuse testing, due to #6099, see also #6196.

+ 1 - 1
pyproject.toml

@@ -1,3 +1,3 @@
 [build-system]
 [build-system]
-requires = ["setuptools", "pkgconfig", "Cython", "setuptools_scm>=1.7,<8"]
+requires = ["setuptools", "wheel", "pkgconfig", "Cython", "setuptools_scm>=1.7,<8"]
 build-backend = "setuptools.build_meta"
 build-backend = "setuptools.build_meta"

+ 1 - 0
setup.py

@@ -289,6 +289,7 @@ setup(
         'Programming Language :: Python :: 3.9',
         'Programming Language :: Python :: 3.9',
         'Programming Language :: Python :: 3.10',
         'Programming Language :: Python :: 3.10',
         'Programming Language :: Python :: 3.11',
         'Programming Language :: Python :: 3.11',
+        'Programming Language :: Python :: 3.12',
         'Topic :: Security :: Cryptography',
         'Topic :: Security :: Cryptography',
         'Topic :: System :: Archiving :: Backup',
         'Topic :: System :: Archiving :: Backup',
     ],
     ],

+ 6 - 0
src/borg/archiver.py

@@ -101,6 +101,12 @@ STATS_HEADER = "                       Original size      Compressed size    Ded
 PURE_PYTHON_MSGPACK_WARNING = "Using a pure-python msgpack! This will result in lower performance."
 PURE_PYTHON_MSGPACK_WARNING = "Using a pure-python msgpack! This will result in lower performance."
 
 
 
 
+# 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 argument(args, str_or_bool):
 def argument(args, str_or_bool):
     """If bool is passed, return it. If str is passed, retrieve named attribute from args."""
     """If bool is passed, return it. If str is passed, retrieve named attribute from args."""
     if isinstance(str_or_bool, str):
     if isinstance(str_or_bool, str):

+ 1 - 1
tox.ini

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