Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Sep 18, 2020
1 parent bca7b97 commit b87a9c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 33 deletions.
15 changes: 3 additions & 12 deletions apeye/_requests_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,16 @@
# Licensed under the Apache License, Version 2.0

# stdlib
from typing import (
IO,
Any,
Iterable,
Mapping,
MutableMapping,
Optional,
Tuple,
Union,
)
from typing import IO, Any, Iterable, Mapping, MutableMapping, Optional, Tuple, Union

# 3rd party
import requests
from apeye._url import URL

# this package
from apeye._url import URL

__all__ = ["RequestsURL"]


_ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
_Data = Union[None, str, bytes, MutableMapping[str, Any], Iterable[Tuple[str, Optional[str]]], IO]
_ParamsType = Optional[Union[Mapping[Union[str, bytes, int, float], "_ParamsMappingValueType"],
Expand Down
22 changes: 7 additions & 15 deletions apeye/_slumber_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,23 @@

# stdlib
import copy
from typing import (
Callable,
Dict,
MutableMapping,
Optional,
Tuple,
Union,
)
from typing import Callable, Dict, MutableMapping, Optional, Tuple, Union

# 3rd party
import requests
import slumber # type: ignore
from requests.structures import CaseInsensitiveDict
from slumber import Serializer
from requests import Request
from requests.auth import AuthBase
from slumber import exceptions
from apeye._url import URL
from apeye._requests_url import _Data
from requests.structures import CaseInsensitiveDict
from slumber import Serializer, exceptions

# this package
from apeye._requests_url import _Data
from apeye._url import URL

__all__ = ["SlumberURL"]



class SlumberURL(URL):
"""
Subclass of :class:`~apeye.url.URL` with support for interacting with
Expand Down Expand Up @@ -127,7 +119,7 @@ def __init__(
proxies: Optional[MutableMapping[str, str]] = None,
verify: Union[None, bool, str] = None,
cert: Union[str, Tuple[str, str], None] = None,
):
):
super().__init__(url)

if serializer is None:
Expand Down
6 changes: 2 additions & 4 deletions apeye/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
# Licensed under the Apache License, Version 2.0
#

# 3rd party
# this package
from apeye._requests_url import RequestsURL
from apeye._slumber_url import SlumberURL
from apeye._url import Domain, URL, URLPath

from apeye._url import URL, Domain, URLPath

__all__ = ["URL", "URLPath", "Domain", "RequestsURL", "SlumberURL"]

4 changes: 2 additions & 2 deletions tests/test_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_division__store(self):
)
l_url.timeout = 42
l_url.cert = "cert"
l_url.proxies = "proxies"
l_url.proxies = "proxies" # type: ignore
l_url.allow_redirects = False
l_url.verify = "verify"
new_url = l_url / "news"
Expand All @@ -573,7 +573,7 @@ def test_division__store(self):
assert new_url.timeout == 42
assert new_url.cert == "cert"
assert new_url.proxies == "proxies"
assert new_url.allow_redirects == False
assert new_url.allow_redirects is False
assert new_url.verify == "verify"


Expand Down

0 comments on commit b87a9c0

Please sign in to comment.