Skip to content

Commit

Permalink
Update dependency pins for testing and linting (#789)
Browse files Browse the repository at this point in the history
* Remove mypy pin and 'tox r -e freezedeps'

* Fix typing bug in PaginatorTable declarations

A `Paginator[T]` when `T` is unbound is effectively the same as
`Paginator[Any]` but does not allow any other use of the same unbound
`T` to match. It's unclear if this should be allowed -- in fact, the
use of the unbound type var is the main issue here.
To resolve, switch the unbound type var to `Any`.

* Apply upadup updates

blacken-docs[black]: 23.1.0 -> 23.7.0
flake8[flake8-bugbear]: 23.2.13 -> 23.7.10
flake8[flake8-comprehensions]: 3.10.1 -> 3.14.0
  • Loading branch information
sirosen authored Jul 18, 2023
1 parent e435e6d commit d023fc9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ repos:
rev: 1.15.0
hooks:
- id: blacken-docs
additional_dependencies: ['black==23.1.0']
additional_dependencies: ['black==23.7.0']
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
name: "Lint python files"
additional_dependencies:
- 'flake8-bugbear==23.2.13'
- 'flake8-comprehensions==3.10.1'
- 'flake8-bugbear==23.7.10'
- 'flake8-comprehensions==3.14.0'
- 'flake8-typing-as-t==0.0.3'
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
Expand Down
10 changes: 5 additions & 5 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ beautifulsoup4==4.12.2
# via furo
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
docutils==0.19
# via sphinx
Expand All @@ -24,15 +24,15 @@ imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
markupsafe==2.1.2
markupsafe==2.1.3
# via jinja2
packaging==23.1
# via sphinx
pygments==2.15.1
# via
# furo
# sphinx
pyyaml==6.0
pyyaml==6.0.1
# via responses
requests==2.31.0
# via
Expand All @@ -52,7 +52,7 @@ sphinx==6.2.1
# sphinx-copybutton
# sphinx-design
# sphinx-issues
sphinx-basic-ng==1.0.0b1
sphinx-basic-ng==1.0.0b2
# via furo
sphinx-copybutton==0.5.2
# via -r docs.in
Expand All @@ -74,7 +74,7 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
types-pyyaml==6.0.12.10
# via responses
urllib3==2.0.2
urllib3==2.0.3
# via
# requests
# responses
10 changes: 5 additions & 5 deletions requirements/test-mindeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ cffi==1.15.1
# via cryptography
chardet==3.0.4
# via requests
coverage==7.2.5
coverage==7.2.7
# via -r test.in
cryptography==3.3.1
# via -r test-mindeps.in
execnet==1.9.0
execnet==2.0.2
# via pytest-xdist
idna==2.8
# via requests
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
pluggy==1.0.0
pluggy==1.2.0
# via pytest
pycparser==2.21
# via cffi
pyjwt==2.0.0
# via -r test-mindeps.in
pytest==7.3.1
pytest==7.4.0
# via
# -r test.in
# pytest-xdist
pytest-xdist==3.3.1
# via -r test.in
pyyaml==6.0
pyyaml==6.0.1
# via responses
requests==2.22.0
# via
Expand Down
14 changes: 7 additions & 7 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
#
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
coverage==7.2.5
coverage==7.2.7
# via -r test.in
execnet==1.9.0
execnet==2.0.2
# via pytest-xdist
idna==3.4
# via requests
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
pluggy==1.0.0
pluggy==1.2.0
# via pytest
pytest==7.3.1
pytest==7.4.0
# via
# -r test.in
# pytest-xdist
pytest-xdist==3.3.1
# via -r test.in
pyyaml==6.0
pyyaml==6.0.1
# via responses
requests==2.31.0
# via responses
responses==0.23.1
# via -r test.in
types-pyyaml==6.0.12.10
# via responses
urllib3==2.0.2
urllib3==2.0.3
# via
# requests
# responses
10 changes: 5 additions & 5 deletions requirements/typing-mindeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
idna==3.4
# via requests
mypy==0.991
mypy==1.4.0
# via -r typing.in
mypy-extensions==1.0.0
# via mypy
pyyaml==6.0
pyyaml==6.0.1
# via responses
requests==2.31.0
# via responses
Expand All @@ -28,7 +28,7 @@ types-jwt==0.1.3
# via -r typing.in
types-pyyaml==6.0.12.10
# via responses
types-requests==2.31.0.0
types-requests==2.31.0.1
# via -r typing.in
types-urllib3==1.26.25.13
# via types-requests
Expand All @@ -37,7 +37,7 @@ typing-extensions==4.0.0
# -r typing-mindeps.in
# -r typing.in
# mypy
urllib3==2.0.2
urllib3==2.0.3
# via
# requests
# responses
3 changes: 1 addition & 2 deletions requirements/typing.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# TODO: update to remove mypy pin
mypy==0.991
mypy
types-docutils
types-jwt
types-requests
Expand Down
12 changes: 6 additions & 6 deletions requirements/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
charset-normalizer==3.2.0
# via requests
idna==3.4
# via requests
mypy==0.991
mypy==1.4.1
# via -r typing.in
mypy-extensions==1.0.0
# via mypy
pyyaml==6.0
pyyaml==6.0.1
# via responses
requests==2.31.0
# via responses
Expand All @@ -28,15 +28,15 @@ types-jwt==0.1.3
# via -r typing.in
types-pyyaml==6.0.12.10
# via responses
types-requests==2.31.0.0
types-requests==2.31.0.1
# via -r typing.in
types-urllib3==1.26.25.13
# via types-requests
typing-extensions==4.6.0
typing-extensions==4.7.1
# via
# -r typing.in
# mypy
urllib3==2.0.2
urllib3==2.0.3
# via
# requests
# responses
8 changes: 4 additions & 4 deletions src/globus_sdk/paging/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from globus_sdk.response import GlobusHTTPResponse

from .base import PageT, Paginator
from .base import Paginator

C = t.TypeVar("C", bound=t.Callable[..., GlobusHTTPResponse])

Expand Down Expand Up @@ -40,14 +40,14 @@ def __init__(self, client: t.Any):
self._client = client
# _bindings is a lazily loaded table of names -> callables which
# return paginators
self._bindings: dict[str, t.Callable[..., Paginator[PageT]]] = {}
self._bindings: dict[str, t.Callable[..., Paginator[t.Any]]] = {}

def _add_binding(
self, methodname: str, bound_method: t.Callable[..., PageT]
self, methodname: str, bound_method: t.Callable[..., t.Any]
) -> None:
self._bindings[methodname] = Paginator.wrap(bound_method)

def __getattr__(self, attrname: str) -> t.Callable[..., Paginator[PageT]]:
def __getattr__(self, attrname: str) -> t.Callable[..., Paginator[t.Any]]:
if attrname not in self._bindings:
# this could raise AttributeError -- in which case, let it!
method = getattr(self._client, attrname)
Expand Down

0 comments on commit d023fc9

Please sign in to comment.