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
Add [mypy].extra_type_stubs
#13180
Add [mypy].extra_type_stubs
#13180
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Not sure if I should put this into the help message? It's a little weird to do because Pants 2.8 lockfile support isn't really there to begin with. |
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.
@Eric-Arellano thanks for resolving this
visually the code looks good, but i was unable to do an editable install so wasnt able to test
thanks again
Presumably this relates to #12794 ? Type stubs would be a "compile"-time dependency? |
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.
[ci skip-rust] [ci skip-build-wheels] # Conflicts: # src/python/pants/backend/python/typecheck/mypy/rules_integration_test.py
Follows up on pantsbuild#12597. While that change was necessary as explained there, we've had feedback from two users that they want to retain the ability to specify type stubs via option rather than normal runtime dependencies. For example, one user wants to avoid an increase in `.pex` size (because one of the stubs incorrectly depends on MyPy). Ideally, we should probably re-envision third-party type stubs wholesale so that our code distinguishes between normal dependencies vs. type stubs dependencies. When running MyPy, we use type stubs. When packaging, for example, we know to leave them off. But that requires design work and time to implement. In the meantime, we can add `[mypy].extra_type_stubs`, which satisfies the different requirements: * We don't install these into the "tool PEX", which is necessary per pantsbuild#12597. * Type stubs continue to work when done as a normal requirement. These are "extra". There is one weird edge: these type stubs don't have a lockfile associated with them. Those can't use the tool lockfile because we cannot tell MyPy to point into its tool lockfile (pantsbuild#12597). It would require a lot of new infrastructure to have a dedicated lockfile for `extra_type_stubs`. So, instead, if you do care about lockfiles, you should use type stubs like normal dependencies rather than using this option. [ci skip-rust] [ci skip-build-wheels]
Follows up on #12597. While that change was necessary as explained there, we've had feedback from two users that they want to retain the ability to specify type stubs via option rather than normal runtime dependencies. For example, one user wants to avoid an increase in `.pex` size (because one of the stubs incorrectly depends on MyPy). Ideally, we should probably re-envision third-party type stubs wholesale so that our code distinguishes between normal dependencies vs. type stubs dependencies. When running MyPy, we use type stubs. When packaging, for example, we know to leave them off. But that requires design work and time to implement. In the meantime, we can add `[mypy].extra_type_stubs`, which satisfies the different requirements: * We don't install these into the "tool PEX", which is necessary per #12597. * Type stubs continue to work when done as a normal requirement. These are "extra". There is one weird edge: these type stubs don't have a lockfile associated with them. Those can't use the tool lockfile because we cannot tell MyPy to point into its tool lockfile (#12597). It would require a lot of new infrastructure to have a dedicated lockfile for `extra_type_stubs`. So, instead, if you do care about lockfiles, you should use type stubs like normal dependencies rather than using this option. [ci skip-rust] [ci skip-build-wheels]
Follows up on #12597. While that change was necessary as explained there, we've had feedback from two users that they want to retain the ability to specify type stubs via option rather than normal runtime dependencies. For example, one user wants to avoid an increase in
.pex
size (because one of the stubs incorrectly depends on MyPy).Ideally, we should probably re-envision third-party type stubs wholesale so that our code distinguishes between normal dependencies vs. type stubs dependencies. When running MyPy, we use type stubs. When packaging, for example, we know to leave them off. But that requires design work and time to implement.
In the meantime, we can add
[mypy].extra_type_stubs
, which satisfies the different requirements:[mypy].extra_requirements
#12597.There is one weird edge: these type stubs don't have a lockfile associated with them. Those can't use the tool lockfile because we cannot tell MyPy to point into its tool lockfile (#12597). It would require a lot of new infrastructure to have a dedicated lockfile for
extra_type_stubs
. So, instead, if you do care about lockfiles, you should use type stubs like normal dependencies rather than using this option.[ci skip-rust]
[ci skip-build-wheels]