Skip to content

Commit

Permalink
Bump min Python version from 3.5.4 to 3.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
c0llab0rat0r committed Apr 14, 2021
1 parent 6b35fe8 commit d5ad5e8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 28 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
1 change: 1 addition & 0 deletions ipfshttpclient/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
VERSION_BLACKLIST = []
VERSION_MAXIMUM = "0.9.0"

from . import base
from . import bitswap
from . import block
from . import bootstrap
Expand Down
19 changes: 5 additions & 14 deletions ipfshttpclient/filescanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@

from . import utils


if sys.version_info >= (3, 7): #PY37+
re_pattern_type = re.Pattern
if ty.TYPE_CHECKING:
re_pattern_t = re.Pattern[ty.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[ty.AnyStr]
else:
re_pattern_t = re.Pattern

# Windows does not have os.O_DIRECTORY
O_DIRECTORY: int = getattr(os, "O_DIRECTORY", 0)


# Neither Windows nor MacOS have os.fwalk even through Python 3.9
HAVE_FWALK: bool = hasattr(os, "fwalk")
HAVE_FWALK_BYTES = HAVE_FWALK and sys.version_info >= (3, 7)
Expand Down Expand Up @@ -394,7 +387,7 @@ def matcher_from_spec(spec: match_spec_t[ty.AnyStr], *, # type: ignore[misc] #

if spec is None:
return MATCH_ALL # mypy bug: This should cause a type error but does not?
elif isinstance(spec, re_pattern_type):
elif isinstance(spec, re.Pattern):
return ReMatcher(spec)
elif isinstance(spec, (str, bytes)):
return GlobMatcher(spec, period_special=period_special)
Expand Down Expand Up @@ -510,8 +503,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[ty.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
2 changes: 1 addition & 1 deletion ipfshttpclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
except ImportError: # pragma: no cover
from . import http_httpx as _backend

ClientSync = _backend.ClientSync
ClientSync = _backend.ClientSync
2 changes: 1 addition & 1 deletion ipfshttpclient/http_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def download(
args
Positional parameters to be sent along with the HTTP request
opts
Query string paramters to be sent along with the HTTP request
Query string parameters to be sent along with the HTTP request
compress
Whether the downloaded file should be GZip compressed by the
daemon before being sent to the client
Expand Down
1 change: 1 addition & 0 deletions ipfshttpclient/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def __init__(self, directory: ty.Union[ty.AnyStr, utils.PathLike[ty.AnyStr], int

# Figure out the absolute path of the directory added
self.abspath = None

if not isinstance(directory, int):
self.abspath = os.path.abspath(directory)

Expand Down
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ 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.)
requires-python = ">=3.6.2,!=3.7.0,!=3.7.1"
# `typing.NoReturn` function signature support.
requires-python = ">=3.7.2"
requires = [
"multiaddr (>=0.0.7)",
"requests (>=2.11)"
Expand All @@ -43,12 +41,10 @@ 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",
]

[tool.flit.metadata.urls]
Documentation = "https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/docs/"

0 comments on commit d5ad5e8

Please sign in to comment.