Skip to content

Commit

Permalink
Bump min Python version from 3.6.2 to 3.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
c0llab0rat0r committed May 17, 2021
1 parent 91bdaba commit 9e3ef09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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 ------------------------------- ###
Expand Down
16 changes: 5 additions & 11 deletions ipfshttpclient/filescanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@

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)
Expand Down Expand Up @@ -476,7 +472,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)
Expand Down Expand Up @@ -577,8 +573,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)
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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",
Expand Down
1 change: 0 additions & 1 deletion verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e3ef09

Please sign in to comment.