Skip to content

Commit

Permalink
Fix black / isort / mypy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing Wang committed Aug 29, 2020
1 parent 51581c4 commit 6bd787b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 7 additions & 3 deletions pyhdfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,10 @@ def create_snapshot(self, path: str, **kwargs: _PossibleArgumentTypes) -> str:
return response

def delete_snapshot(
self, path: str, snapshotname: str, **kwargs: _PossibleArgumentTypes,
self,
path: str,
snapshotname: str,
**kwargs: _PossibleArgumentTypes,
) -> None:
"""Delete a snapshot of a directory"""
response = self._delete(
Expand Down Expand Up @@ -967,7 +970,7 @@ def copy_to_local(
Takes all arguments that :py:meth:`open` takes.
"""
with self.open(src, **kwargs) as fsrc:
with open(localdest, "wb") as fdst:
with open(localdest, "wb") as fdst: # type: IO[bytes]
shutil.copyfileobj(fsrc, fdst)

def get_active_namenode(self, max_staleness: Optional[float] = None) -> str:
Expand Down Expand Up @@ -1008,7 +1011,8 @@ def _json(response: requests.Response) -> Dict[str, Any]:


def _check_response(
response: requests.Response, expected_status: HTTPStatus = HTTPStatus.OK,
response: requests.Response,
expected_status: HTTPStatus = HTTPStatus.OK,
) -> None:
if response.status_code == expected_status:
return
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ pyhdfs = py.typed
tag_build = dev

[tool:isort]
profile = black
case_sensitive = true
force_grid_wrap = 0
force_single_line = true
include_trailing_comma = true
line_length = 88
multi_line_output = 3
order_by_type = false
use_parentheses = true

[tool:pytest]
addopts = --random --tb=short --cov pyhdfs --cov test_pyhdfs --cov-report html --cov-report term
Expand Down
7 changes: 5 additions & 2 deletions test_pyhdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ def test_webhdfs_off(self) -> None:
self.fail("should have raised something") # pragma: no cover

def test_unrecognized_exception(self) -> None:
"""An exception that we don't have a python class for should fall back to HdfsHttpException
"""An exception that we don't have a python class for should fall back to
HdfsHttpException.
"""
client = make_client()

Expand Down Expand Up @@ -607,7 +608,9 @@ def test_flake8(self) -> None:
subprocess.check_call(["flake8"], cwd=os.path.dirname(__file__))

def test_isort(self) -> None:
subprocess.check_call(["isort", "--check-only"], cwd=os.path.dirname(__file__))
subprocess.check_call(
["isort", "--check-only", "--diff", os.path.dirname(__file__)]
)

def test_mypy(self) -> None:
subprocess.check_call(["mypy", os.path.dirname(__file__)])

0 comments on commit 6bd787b

Please sign in to comment.