浏览代码

require python 3.8+, fixes #5975

if you do not have py38+ yet, just use borg 1.1.x.
Thomas Waldmann 3 年之前
父节点
当前提交
59b6dc5442
共有 6 个文件被更改,包括 15 次插入28 次删除
  1. 3 8
      .github/workflows/ci.yml
  2. 8 11
      Vagrantfile
  3. 1 1
      docs/development.rst
  4. 1 2
      setup.py
  5. 1 5
      src/borg/helpers/misc.py
  6. 1 1
      tox.ini

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

@@ -51,12 +51,9 @@ jobs:
     strategy:
       matrix:
         include:
-            - os: ubuntu-20.04
-              python-version: '3.7'
-              toxenv: py37-fuse2
             - os: ubuntu-20.04
               python-version: '3.8'
-              toxenv: py38-fuse3
+              toxenv: py38-fuse2
             - os: ubuntu-20.04
               python-version: '3.9'
               toxenv: py39-fuse3
@@ -64,10 +61,8 @@ jobs:
               python-version: '3.10-dev'
               toxenv: py310-fuse3
             - os: macos-latest
-              # note: it seems that 3.8 and 3.9 are currently broken,
-              # neverending RuntimeError crashes...
-              python-version: '3.7'
-              toxenv: py37-fuse2
+              python-version: '3.8'
+              toxenv: py38-fuse2
 
     env:
       # Configure pkg-config to use OpenSSL from Homebrew

+ 8 - 11
Vagrantfile

@@ -52,10 +52,10 @@ def packages_freebsd
     pkg install -y fusefs-libs || true
     pkg install -y fusefs-libs3 || true
     pkg install -y git bash  # fakeroot causes lots of troubles on freebsd
-    # for building python:
-    pkg install -y python37 py37-sqlite3 py37-virtualenv py37-pip
+    # for building python (for the tests we use pyenv built pythons):
+    pkg install -y python38 py38-sqlite3 py38-virtualenv py38-pip
     # make sure there is a python3 command
-    ln -sf /usr/local/bin/python3.7 /usr/local/bin/python3
+    ln -sf /usr/local/bin/python3.8 /usr/local/bin/python3
     # make bash default / work:
     chsh -s bash vagrant
     mount -t fdescfs fdesc /dev/fd
@@ -129,12 +129,10 @@ def packages_openindiana
   return <<-EOF
     # needs separate provisioning step + reboot:
     #pkg update
-    # already installed:
-    #pkg install python-37 python-35 virtualenv-35 pip-35 clang-40 lz4 zstd git
-    pkg install gcc-7
-    ln -sf /usr/bin/python3.7 /usr/bin/python3
+    #pkg install gcc-7 python-39 setuptools-39
+    ln -sf /usr/bin/python3.9 /usr/bin/python3
     python3 -m ensurepip
-    ln -sf /usr/bin/pip3.7 /usr/bin/pip3
+    ln -sf /usr/bin/pip3.9 /usr/bin/pip3
     pip3 install virtualenv
   EOF
 end
@@ -164,7 +162,6 @@ def install_pythons(boxname)
     pyenv install 3.10-dev  # tests, version supporting openssl 1.1
     pyenv install 3.9.7  # tests, version supporting openssl 1.1, binary build
     pyenv install 3.8.0  # tests, version supporting openssl 1.1
-    pyenv install 3.7.0  # tests, version supporting openssl 1.1
     pyenv rehash
   EOF
 end
@@ -232,8 +229,8 @@ def run_tests(boxname, skip_env)
     . ../borg-env/bin/activate
     if which pyenv 2> /dev/null; then
       # for testing, use the earliest point releases of the supported python versions:
-      pyenv global 3.7.0 3.8.0 3.9.7 3.10-dev
-      pyenv local 3.7.0 3.8.0 3.9.7 3.10-dev
+      pyenv global 3.8.0 3.9.7 3.10-dev
+      pyenv local 3.8.0 3.9.7 3.10-dev
     fi
     # otherwise: just use the system python
     # some OSes can only run specific test envs, e.g. because they miss FUSE support:

+ 1 - 1
docs/development.rst

@@ -182,7 +182,7 @@ Some more advanced examples::
   # verify a changed tox.ini (run this after any change to tox.ini):
   fakeroot -u tox --recreate
 
-  fakeroot -u tox -e py37  # run all tests, but only on python 3.7
+  fakeroot -u tox -e py38  # run all tests, but only on python 3.8
 
   fakeroot -u tox borg.testsuite.locking  # only run 1 test module
 

+ 1 - 2
setup.py

@@ -271,7 +271,6 @@ setup(
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Python',
         'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: 3.9',
         'Programming Language :: Python :: 3.10',
@@ -299,5 +298,5 @@ setup(
     setup_requires=['setuptools_scm>=1.7'],
     install_requires=install_requires,
     extras_require=extras_require,
-    python_requires='>=3.7',
+    python_requires='>=3.8',
 )

+ 1 - 5
src/borg/helpers/misc.py

@@ -79,11 +79,7 @@ def sysinfo():
     except AttributeError:
         uname = None
     if sys.platform.startswith('linux'):
-        try:
-            linux_distribution = platform.linux_distribution()  # noqa
-        except:
-            # platform.linux_distribution() is deprecated since py 3.5 and removed in 3.7.
-            linux_distribution = ('Unknown Linux', '', '')
+        linux_distribution = ('Unknown Linux', '', '')
     else:
         linux_distribution = None
     try:

+ 1 - 1
tox.ini

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