Skip to content

Commit

Permalink
Miscellaneous cleanup from ipfs-shipyard#260 and ipfs-shipyard#262
Browse files Browse the repository at this point in the history
  • Loading branch information
c0llab0rat0r committed Apr 9, 2021
1 parent 2cb91f7 commit 26977db
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions ipfshttpclient/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
VERSION_BLACKLIST = []
VERSION_MAXIMUM = "0.8.0"

from . import base
from . import bitswap
from . import block
from . import bootstrap
Expand Down
2 changes: 0 additions & 2 deletions ipfshttpclient/filescanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
else: #PY36-
re_pattern_t = re_pattern_type = type(re.compile(""))


# 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
6 changes: 3 additions & 3 deletions ipfshttpclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
PREFER_HTTPX = (os.environ.get("PY_IPFS_HTTP_CLIENT_PREFER_HTTPX", "no").lower()
not in ("0", "f", "false", "n", "no"))
if PREFER_HTTPX: # pragma: http-backend=httpx
try: #PY36+
try:
from . import http_httpx as _backend
except (ImportError, SyntaxError): #PY35
except ImportError:
from . import http_requests as _backend # type: ignore[no-redef]
else: # pragma: http-backend=requests
try:
from . import http_requests as _backend # type: ignore[no-redef]
except ImportError: # pragma: no cover
from . import http_httpx as _backend

ClientSync = _backend.ClientSync
ClientSync = _backend.ClientSync
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -721,4 +721,4 @@ def download(
tf.extractall(path=utils.convert_path(target))
finally:
for closable in closables:
closable.close()
closable.close()
1 change: 1 addition & 0 deletions ipfshttpclient/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,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(utils.convert_path(directory))

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ classifiers = [

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

0 comments on commit 26977db

Please sign in to comment.