-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
0.981 Introduces unnecessary build requirements #14171
Comments
These are required for building mypyc compiled wheels of mypy, so they are valid build-time dependencies. I'm not aware of any configurable way to make some build dependencies optional, so I don't think we can make them optional either. |
But that is not the case for building the common wheels.
From a downstream distribution point of view: What are distributions supposed to do? Bootstrapping all of these packages poses a lot of extra work on distributions when updating the Python interpreter (e.g. from 3.10 to 3.11). |
Is this about bootstrapping the |
@JukkaL hm, so would you recommend to always have mypy be a mypyc compiled extension? Historically, we have abstained from starting to package typeshed packages, as it means even more packages to maintain and usually they are used in development environment where one can install them using mypy/pip (and frankly these files should really be maintained by their respective upstreams or be replaced by typing the projects, but I digress). While I understand the efficiency and speed benefits of using mypyc (also for itself), please note, that from a distribution point of view this may lead to many more packages that need to be bootstrapped for each interpreter update (we are currently even still struggling to wrap our heads around the rebuild order), depending on how many other projects go down this route. |
mypyc-compiled mypy is significantly faster than pure-Python mypy, so as a distributor, I'd want to distribute mypyc-compiled packages to help my users. |
As mentioned above, I clearly understand the benefits. However, coming from a setuptools-only setup ( I wonder if providing the default wheel package on pypi is still a good idea though, if you do not intend the project to be built that way at all. |
It's our fallback option on less commonly used platforms for which we don't provide compiled wheels yet (e.g. non-Intel Linux). We could vendor the typeshed stub packages needed to build mypy. That would add some friction to mypy development, but if that would make it easier to package mypy, it may be an acceptable compromise. Thoughts? |
I don't have a strong opinion either way -- but that would also have prevented #14037 from happening. |
If I understand the setup correctly, then the stub package versions should be equal to their respective counterparts, right? |
The stub package used for building mypy must be compatible with the corresponding non-stub package, but only for the library features mypy actually uses. Most of the time using an older stub package is fine, since packages don't arbitrarily change the APIs in backward incompatible ways, but there is a small risk. In that case you could perhaps cherry-pick some changes from the mypy the repo to build an older mypy version. |
Unless I'm missing something, I don't think this is true? If you run a PEP 517 build without telling mypy to use mypyc it should build a plain pure-python wheel (make sure to unset As a suggestion for a simpler work-around instead of packaging all of mypy's dependencies, if you only want to build a pure Python package, you could always patch |
I'm -1 on vendoring the stubs. I'd be happy to include a pyproject.toml.min file or something that contains minimal build requirements for a pure Python wheel, if that makes patching things easier for distributors. |
I'm kind of -1 on vendoring these packages as well. Distributions are almost certainly going to want to package stub packages from typeshed eventually, especially as more projects adopt compilation with mypyc. (e.g. black will also run into this problem I imagine). These packages are also rather stable (especially types-typed-ast, which we actually should be able to remove soon IIRC). I think providing a pyproject.toml.min seems reasonable. |
Bug Report
The changes in #13445 introduced a lot of additional
build-system
requirements for environments that use PEP517 build environments (e.g. pypa/build and pypa/installer). This finds application in downstream distributions of mypy (i.e. all Linux distributions are affected by this).If my understanding of PEP0517, PEP0518 and PEP0621 are correct, then apart from
setuptools
andwheel
none of the other entries should be listed and instead be moved to other places in the pyproject.toml file.To Reproduce
Run the following in e.g. this repo in a clean environment (only build, installer, setuptools and wheel installed) in this repository with release-0.980 or above:
Expected Behavior
The build process does not require test or runtime requirements to be installed.
Actual Behavior
Your Environment
mypy.ini
(and other config files): n/aThe text was updated successfully, but these errors were encountered: