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 9, 2021
1 parent f61a574 commit afbf9a0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Config file for automatic testing at travis-ci.com

language: python
dist: bionic # VirtualEnv is too old on xenial
dist: focal

matrix:
include:
- python: "3.6"
- python: "3.7"
- python: "3.8"
- python: "pypy3"
# - python: "pypy3" travis doesn't support pypy on Python 3.7 yet
- python: "3.8"
env: IPFS_VERSION=compat
- python: "3.8"
env: TOXENV=py3-httpx
dist: bionic
- python: "3.8"
env: TOXENV=styleck
before_install: ":"
- python: "3.8"
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.8.2-macosx10.9
Expand Down Expand Up @@ -109,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.8.2-macosx10.9) MD5_MACOS="f12203128b5c639dc08e5a43a2812cc7" ;;
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 @@ -18,6 +18,7 @@
VERSION_BLACKLIST = []
VERSION_MAXIMUM = "0.8.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 @@ -676,7 +676,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,11 +41,9 @@ 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"
]

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

0 comments on commit afbf9a0

Please sign in to comment.