-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Support extras in stubtest_third_party.py #8467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks! Do any of our stubs packages that currently have |
This comment has been minimized.
This comment has been minimized.
I've updated all the stubs that currently use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extras_dependencies
is a little confusing to me, since it's not clear whether it's a list of names of extras or a list of names of dependencies. Maybe extras
or extras_to_install
?
dist_req = f"{dist.name}=={dist_version}" | ||
assert isinstance(extras_dependencies, list) | ||
dist_extras = ", ".join(extras_dependencies) | ||
dist_req = f"{dist.name}[{dist_extras}]=={dist_version}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, didn't realise this, but pip install pkg[]
does work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, as long as you conform to the structure, the behavior will work. It's only if you break the calling structure that it fails to execute :)
I'm perfectly happy with those, but will through out a few others in case they help:
Just let me know the preference, and I can proceed with that |
* master: Add `urllib3.contrib.socks`; improve `urllib3.connectionpool` (#8457) Improve `multiprocessing.context` module (#8466) Always return `True` from `xml.dom.minidom.Node.__bool__` (#8480) Adds missing `__dir__` definitions (#8479) Various pyvmomi improvements (#8469) Bump pytype version. (#8478) Remove `Enum.__hash__`, improve `Enum.__reduce_ex__` (#8477) refactor: prefer f-strings to other format/concatentation styles (#8474) Remove redundant `__str__` methods (#8475) Add some missing stubs in datetimerange (#8470) tkinter: get rid of unnecessary Incomplete (#8471) Improve urllib3.util.url annotations (#8460) Fix `complex` constructor (#8473) [pre-commit.ci] pre-commit autoupdate (#8461) Use typeshed.Incomplete and object instead of Any in tkinter stubs (#8458) `io.IOBase`: correct metaclass (#8468)
Updated:
|
This comment has been minimized.
This comment has been minimized.
#8439 will, if merged, also be a candidate for this via https://github.com/psf/requests/blob/main/setup.py#L125 EDIT: fix the links |
* master: (51 commits) Update pytype_test to be compatible with the latest pytype version. (#8551) Normalise use of `Never` vs `NoReturn` (#8549) Add stubs for tree-sitter-languages (#8548) Add SAFE_RESTARTABLE strategy to ldap3 Connection client_strategy parameter (#8547) Add stubs for tree_sitter (#8533) Additional return types for psycopg2 connections (#8528) fpdf2: fix for 2.5.6 changes (#8546) cryptography: Rename parameter of serialize_key_and_certificates (#8543) Add `_threading_local.local.__delattr__` back to the stub (#8526) Fix `UDPServer` to correctly inherit from `TCPServer` (#8542) Upgrade pyright (#8541) Add "Naming convention" to `test_cases/README.md` (#8521) Improve `.keys()`, `.values()`, `.items()` methods for `TypedDict`s (#8532) setuptools: fix stubtest (#8540) Annotate Model in SQLAlchemy (#8535) Unpin stubtest from 3.10.5 (#8523) [stubsabot] Bump setuptools to 64.0.* (#8534) Add `@type_check_only` to two fictional classes in `builtins.pyi` (#8531) Enable flake8-pyi's Y034 check in `stdlib/typing.pyi` (#8530) setuptools: delete _distutils.command.check.HAS_DOCUTILS (#8529) ...
Merge request updated with the extras for requests since #8485 was merged. This is using the |
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating, sorry for the delay here! :-)
No worries, life happens 🙂 thanks for your time |
X-Ref: #8457 (comment)
This pull request adds a new key to the METADATA.toml file, under the
tool.stubtest
key, namedextras_dependencies
. This key is to allow the use of extras when running stubtest in upstream tests.For example, the current schema would change from:
to:
The reason for this is that when a stub, such as urllib3, which provides contributor functionality based on other libraries, such as PySock, may have a complex version dependency. In those cases, rather than trying to ensure that the version specification is manually or automatically detected as updated, this bypasses the issue by ensuring that we're using the version specification defined by the upstream library, tracking it as it changes.