Skip to content

Commit 990f203

Browse files
authored
Merge pull request #312 from Backblaze/drop-3.5-3.6
Drop support for Python 3.5 and Python 3.6
2 parents 9a3f9ce + 154e0e3 commit 990f203

File tree

13 files changed

+34
-54
lines changed

13 files changed

+34
-54
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
fail-fast: false
8181
matrix:
8282
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
83-
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]
83+
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]
8484
exclude:
8585
- os: "macos-latest"
8686
python-version: "pypy-3.7"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
* Fix downloading files with unverified checksum
2828
* Fix decoding in filename and file info of `DownloadVersion`
2929

30+
### Removed
31+
* Drop support for Python 3.5 and Python 3.6
32+
3033
## [1.14.1] - 2022-02-23
3134

3235
### Fixed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ With `nox`, you can run different sessions (default are `lint` and `test`):
2727

2828
* `format` -> Format the code.
2929
* `lint` -> Run linters.
30-
* `test` (`test-3.5`, `test-3.6`, `test-3.7`, `test-3.8`, `test-3.9`, `test-3.10`) -> Run test suite.
30+
* `test` (`test-3.7`, `test-3.8`, `test-3.9`, `test-3.10`) -> Run test suite.
3131
* `cover` -> Perform coverage analysis.
3232
* `build` -> Build the distribution.
3333
* `deploy` -> Deploy the distribution to the PyPi.
@@ -50,15 +50,15 @@ For example:
5050
nox > Running session format
5151
...
5252

53-
Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.5-3.10 by default.
53+
Sessions `test` ,`unit`, and `integration` can run on many Python versions, 3.7-3.10 by default.
5454

5555
Sessions other than `test` use the last given Python version, 3.10 by default.
5656

5757
You can change it:
5858

59-
export NOX_PYTHONS=3.6,3.7
59+
export NOX_PYTHONS=3.7,3.8
6060

61-
With the above setting, session `test` will run on Python 3.6 and 3.7, and all other sessions on Python 3.7.
61+
With the above setting, session `test` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8.
6262

6363
Given Python interpreters should be installed in the operating system or via [pyenv](https://github.com/pyenv/pyenv).
6464

b2sdk/sync/scan_policies.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
logger = logging.getLogger(__name__)
2020

21-
try: # python 3.5 and 3.6 compatibility
22-
regex_class = re.Pattern
23-
except AttributeError:
24-
regex_class = re._pattern_type
25-
2621

2722
class RegexSet:
2823
"""
@@ -126,9 +121,9 @@ class ScanPoliciesManager:
126121

127122
def __init__(
128123
self,
129-
exclude_dir_regexes: Iterable[Union[str, regex_class]] = tuple(),
130-
exclude_file_regexes: Iterable[Union[str, regex_class]] = tuple(),
131-
include_file_regexes: Iterable[Union[str, regex_class]] = tuple(),
124+
exclude_dir_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
125+
exclude_file_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
126+
include_file_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
132127
exclude_all_symlinks: bool = False,
133128
exclude_modified_before: Optional[int] = None,
134129
exclude_modified_after: Optional[int] = None,

b2sdk/utils/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ def hex_sha1_of_unlimited_stream(input_stream, limit=None):
128128

129129

130130
def hex_sha1_of_file(path_):
131-
with open(
132-
str(path_), 'rb'
133-
) as file: # TODO: remove str() after dropping python 3.5 support, it's here in
134-
# case someone uses pathlib.Paths
131+
with open(path_, 'rb') as file:
135132
return hex_sha1_of_unlimited_stream(file)
136133

137134

b2sdk/v1/sync/scan_policies.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
from b2sdk import v2
1818
from b2sdk.v2 import exception as v2_exception # noqa
1919

20-
try: # python 3.5 and 3.6 compatibility
21-
regex_class = re.Pattern
22-
except AttributeError:
23-
regex_class = re._pattern_type
24-
2520

2621
# Override to retain old exceptions in __init__
2722
# and to provide interface for new should_exclude_* methods
@@ -41,9 +36,9 @@ class ScanPoliciesManager(v2.ScanPoliciesManager):
4136

4237
def __init__(
4338
self,
44-
exclude_dir_regexes: Iterable[Union[str, regex_class]] = tuple(),
45-
exclude_file_regexes: Iterable[Union[str, regex_class]] = tuple(),
46-
include_file_regexes: Iterable[Union[str, regex_class]] = tuple(),
39+
exclude_dir_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
40+
exclude_file_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
41+
include_file_regexes: Iterable[Union[str, re.Pattern]] = tuple(),
4742
exclude_all_symlinks: bool = False,
4843
exclude_modified_before: Optional[int] = None,
4944
exclude_modified_after: Optional[int] = None,

b2sdk/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
try:
1414
from importlib.metadata import version
15-
except ImportError: # ModuleNotFoundError is not available in Python 3.5
16-
from importlib_metadata import version
15+
except ModuleNotFoundError:
16+
from importlib_metadata import version # for python 3.7
1717

1818
VERSION = version('b2sdk')
1919

doc/source/contributing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ With ``nox``, you can run different sessions (default are ``lint`` and ``test``)
3333

3434
* ``format`` -> Format the code.
3535
* ``lint`` -> Run linters.
36-
* ``test`` (``test-3.5``, ``test-3.6``, ``test-3.7``, ``test-3.8``, ``test-3.9``, ``test-3.10``) -> Run test suite.
36+
* ``test`` (``test-3.7``, ``test-3.8``, ``test-3.9``, ``test-3.10``) -> Run test suite.
3737
* ``cover`` -> Perform coverage analysis.
3838
* ``build`` -> Build the distribution.
3939
* ``deploy`` -> Deploy the distribution to the PyPi.
@@ -56,15 +56,15 @@ For example::
5656
nox > Running session format
5757
...
5858

59-
Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.5-3.10 by default.
59+
Sessions ``test``, ``unit``, and ``integration`` can run on many Python versions, 3.7-3.10 by default.
6060

6161
Sessions other than ``test`` use the last given Python version, 3.10 by default.
6262

6363
You can change it::
6464

65-
export NOX_PYTHONS=3.6,3.7
65+
export NOX_PYTHONS=3.7,3.8
6666

67-
With the above setting, session ``test`` will run on Python 3.6 and 3.7, and all other sessions on Python 3.7.
67+
With the above setting, session ``test`` will run on Python 3.7 and 3.8, and all other sessions on Python 3.8.
6868

6969
Given Python interpreters should be installed in the operating system or via `pyenv <https://github.com/pyenv/pyenv>`_.
7070

noxfile.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@
1818
NOX_PYTHONS = os.environ.get('NOX_PYTHONS')
1919
SKIP_COVERAGE = os.environ.get('SKIP_COVERAGE') == 'true'
2020

21-
PYTHON_VERSIONS = ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'
22-
] if NOX_PYTHONS is None else NOX_PYTHONS.split(',')
21+
PYTHON_VERSIONS = ['3.7', '3.8', '3.9', '3.10'] if NOX_PYTHONS is None else NOX_PYTHONS.split(',')
2322
PYTHON_DEFAULT_VERSION = PYTHON_VERSIONS[-1]
2423

2524
PY_PATHS = ['b2sdk', 'test', 'noxfile.py', 'setup.py']
2625

2726
REQUIREMENTS_FORMAT = ['yapf==0.27']
2827
REQUIREMENTS_LINT = ['yapf==0.27', 'pyflakes==2.4.0', 'pytest==6.2.5', 'liccheck==0.6.2']
2928
REQUIREMENTS_TEST = [
30-
"pytest==6.2.5;python_version>'3.5'", "pytest==6.1.1;python_version=='3.5'",
31-
"pytest-cov==3.0.0;python_version>'3.5'", "pytest-cov==2.10.1;python_version=='3.5'",
32-
"pytest-mock==3.6.1;python_version>'3.5'", "pytest-mock==3.3.1;python_version=='3.5'",
33-
'pytest-lazy-fixture==0.6.3'
29+
"pytest==6.2.5",
30+
"pytest-cov==3.0.0",
31+
"pytest-mock==3.6.1",
32+
'pytest-lazy-fixture==0.6.3',
3433
]
3534
REQUIREMENTS_BUILD = ['setuptools>=20.2']
3635

requirements-doc.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sadisplay
2-
sphinx<4.0; python_version <= '3.5' # sphinx>=4.0 doesn't support Python 3.5
3-
sphinx<5.0; python_version > '3.5'
2+
sphinx<5.0
43
sphinx-autobuild
54
sphinx-rtd-theme
65
sphinxcontrib-plantuml

0 commit comments

Comments
 (0)