From 71bf0d71f1a34ade910f749770163d3b2c15b648 Mon Sep 17 00:00:00 2001 From: c0llab0rat0r <78339685+c0llab0rat0r@users.noreply.github.com> Date: Sun, 4 Apr 2021 21:04:47 -0500 Subject: [PATCH] Bump min Python version from 3.6.2 to 3.7.2 --- .travis.yml | 11 +++++------ ipfshttpclient/filescanner.py | 16 +++++----------- pyproject.toml | 7 ++----- verify.sh | 1 - 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 294cc8fd..3a504aa8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,14 @@ # Config file for automatic testing at travis-ci.com language: python -dist: bionic +dist: focal matrix: include: - - python: "3.6" - python: "3.7" - python: "3.8" - python: "3.9" - - python: "pypy3" # Python 3.6.12-7.3.3 as of April 2021 + # - python: "pypy3" travis doesn't support pypy on Python 3.7 yet - python: "3.9" env: IPFS_VERSION=compat - python: "3.9" @@ -20,14 +19,14 @@ matrix: - python: "3.9" env: TOXENV=typeck before_install: ":" - + # Testing on macOS/Darwin tends to be much slower so only test the bare minimum # # When changing any version here also update the relevant checksum below with # the values found on the https://python.org/ website. - os: osx language: shell - env: PYTHON_VERSION=3.6.8-macosx10.9 + env: PYTHON_VERSION=3.7.9-macosx10.9 - os: osx language: shell env: PYTHON_VERSION=3.9.0-macosx10.9 @@ -110,7 +109,7 @@ install: ### ====== MODIFY THIS WHEN CHANGING MACOS PYTHON TEST VERSIONS ====== ### case "${PYTHON_VERSION}" in - 3.6.8-macosx10.9) MD5_MACOS="786c4d9183c754f58751d52f509bc971" ;; + 3.7.9-macosx10.9) MD5_MACOS="4b544fc0ac8c3cffdb67dede23ddb79e" ;; 3.9.0-macosx10.9) MD5_MACOS="16ca86fa3467e75bade26b8a9703c27f" ;; esac ### ------------------------------ END ------------------------------- ### diff --git a/ipfshttpclient/filescanner.py b/ipfshttpclient/filescanner.py index 7c315bde..d845b4df 100644 --- a/ipfshttpclient/filescanner.py +++ b/ipfshttpclient/filescanner.py @@ -19,14 +19,10 @@ # This will get inlined if/when PyCharm no longer flags typing.AnyStr. AnyStr = ty.TypeVar('AnyStr', bytes, str) -if sys.version_info >= (3, 7): #PY37+ - re_pattern_type = re.Pattern - if ty.TYPE_CHECKING: - re_pattern_t = re.Pattern[AnyStr] - else: - re_pattern_t = re.Pattern -else: #PY36- - re_pattern_t = re_pattern_type = type(re.compile("")) +if ty.TYPE_CHECKING: + re_pattern_t = re.Pattern[AnyStr] +else: + re_pattern_t = re.Pattern # Windows does not have os.O_DIRECTORY O_DIRECTORY: int = getattr(os, "O_DIRECTORY", 0) @@ -475,7 +471,7 @@ def _matcher_from_spec(spec: match_spec_t[AnyStr], *, def _recursive_matcher_from_spec(spec: match_spec_t[AnyStr], *, period_special: bool = True) -> Matcher[AnyStr]: - if isinstance(spec, re_pattern_type): + if isinstance(spec, re.Pattern): return ReMatcher(spec) elif isinstance(spec, (str, bytes)): return GlobMatcher(spec, period_special=period_special) @@ -576,8 +572,6 @@ def __init__( os.stat(directory_str) # … and possibly open it as a FD if this is supported by the platform - # - # Note: `os.fwalk` support for binary paths was only added in 3.7+. directory_str_or_fd: ty.Union[AnyStr, int] = directory_str if HAVE_FWALK and (not isinstance(directory_str, bytes) or HAVE_FWALK_BYTES): fd = os.open(directory_str, os.O_RDONLY | O_DIRECTORY) diff --git a/pyproject.toml b/pyproject.toml index 96387bef..e52067d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,10 @@ description-file = "README.md" # Notes: `typing.NoReturn` was introduced post-release in Python 3.5.4 and 3.6.2 and had # a critical bug (https://bugs.python.org/issue34921) in 3.7.0 to 3.7.1. So the # compatible versions below reflect the range of Python versions with working -# `typing.NoReturn` function signature support. (Also, many other `typing` module -# items were only introduced post-release in 3.6 and version restrictions on these -# versions ensure that those are all available as well.) +# `typing.NoReturn` function signature support. # # Maintain this concurrently with verify.sh -requires-python = ">=3.6.2,!=3.7.0,!=3.7.1" +requires-python = ">=3.7.2" requires = [ "multiaddr (>=0.0.7)", "requests (>=2.11)" @@ -45,7 +43,6 @@ classifiers = [ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", diff --git a/verify.sh b/verify.sh index 11b44439..5e987a0e 100755 --- a/verify.sh +++ b/verify.sh @@ -10,7 +10,6 @@ if [ -z "$1" ]; then echo "Validating minimum point release of each supported minor version..." # Maintain this concurrently with [tool.flit.metadata].requires-python in pyproject.toml. - validate 3.6.2 validate 3.7.2 validate 3.8.0 validate 3.9.0