-
-
Notifications
You must be signed in to change notification settings - Fork 640
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
Stop including type stubs in pex_binary
targets
#15454
Comments
I'd say yes, primarily in case a heuristic gets it wrong, it could be difficult to work around otherwise. But hmm, on second thought I disagree with my own argument here. Type stub classification ought to be directed at the source rather than at the dependent site (with a misleading option name, for that case as it wouldn't be a type stub to include and also may include more than desired). However I'm still +1 for the option, in case type stubs are indeed desired to be included. |
Agreed. I think you'd do that by setting |
We're hitting this, and the worst part is that mypy itself seems to be being included if any of the stubs depends on it (e.g. if a package is both a set of stubs and a plugin, like https://github.com/dropbox/sqlalchemy-stubs), and mypy is a large dependency (~50MB). This is particularly annoying for AWS Lambdas, which have a strict 250MB (unzipped) limit for the a code archive. Work around: it seems that setting Example (including work around): huonw/pants-awslambda-UndefinedEnvironmentName@182145d...94bdc6f |
Sorry for the delay in replying @huonw, I was OOO. And pardon the issue! Thank you for sharing the workaround. -- @thejcannon this ticket intersects a little bit with your proposals around dependencies, I think? What are your thoughts on my original proposed fix, vs. waiting for your proposals? |
I like forward progress but I also dislike churn. If we can stomach it, I'll blast out my proposal later this week for RFC. The two "starting points" can be assets and this. WDYT? |
This ticket is the type of polish I'm hoping to have more time to implement now that my life is stabilizing after 6 months hah. But I'm also unlikely to get to it in one week, so sounds good to me. I'll assign this ticket to both of us so we don't let it sit for too long. |
Hey, just curious if there was progress made on this that wasn't recorded here? |
Not explicitly, although #19155 gets us closer than we've been to a generic solution |
Highlighted changelogs: * https://github.com/pex-tool/pex/releases/tag/v2.4.0 * https://github.com/pex-tool/pex/releases/tag/v2.4.1 * https://github.com/pex-tool/pex/releases/tag/v2.5.0 * https://github.com/pex-tool/pex/releases/tag/v2.6.0 * https://github.com/pex-tool/pex/releases/tag/v2.7.0 * https://github.com/pex-tool/pex/releases/tag/v2.8.0 * https://github.com/pex-tool/pex/releases/tag/v2.8.1 * https://github.com/pex-tool/pex/releases/tag/v2.9.0 * https://github.com/pex-tool/pex/releases/tag/v2.10.0 * https://github.com/pex-tool/pex/releases/tag/v2.10.1 * https://github.com/pex-tool/pex/releases/tag/v2.11.0 (!) ``` Lockfile diff: 3rdparty/python/user_reqs.lock [python-default] == Upgraded dependencies == certifi 2024.6.2 --> 2024.7.4 exceptiongroup 1.2.1 --> 1.2.2 pex 2.3.3 --> 2.11.0 pydantic 1.10.16 --> 1.10.17 ``` NOTE: This updates the scrupulously backwards compatible Pex, but does not use any new features yet. The minimum version is unchanged. Possibly relevant for: #15704 #21103 #20852 #15454 #21100 #11324 #19256 #19552 #19681
We've heard from several users they only want type stubs like
types-requests
to be used with MyPy. It's a bummer to bundle w/ a PEX binary etc as it adds bloat.This could be a use case for "dependency scopes": #12794
But I think we can implement this more easily. Given any
python_requirement
target, we have a way to know if it's a type stub or not:type_stub_modules
is set, we can be 100% confident it ismodules
is set, we can be 100% confident it isproject_name
if it hastypes-
etcIf we decide it's a type stub, then leave it out of the PEX.
Unclear to me if we need a mechanism to force type stubs in the binary? Maybe a field on
pex_binary
calledinclude_type_stubs: bool
w/ default tofalse
?The text was updated successfully, but these errors were encountered: