Skip to content
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

Deprecate --interpreter-constraints option where it no-ops #10833

Merged
merged 2 commits into from
Sep 23, 2020

Conversation

Eric-Arellano
Copy link
Contributor

There are several places now where --interpreter-constraints is never used, or it's exceedingly rare to be used so it's misleading to have as an option.

This also fixes Pylint to ensure that no matter what, the tool Pex uses the same constraints as the requirements Pex. It looks like this was happening in practice, but it's important to enforce to avoid a Pex runtime error about "Missing Wheels".

Finally, this fixes setuptools to have default constraints, which it needs.

[ci skip-build-wheels]
[ci skip-rust]

[ci skip-build-wheels]
[ci skip-rust]
@Eric-Arellano
Copy link
Contributor Author

Broken out of #10820, as that implementation is going to change a lot. This should have been a dedicated PR either way.

[ci skip-build-wheels]
[ci skip-rust]
@Eric-Arellano Eric-Arellano merged commit 9aec06f into pantsbuild:master Sep 23, 2020
@Eric-Arellano Eric-Arellano deleted the interp-constraints branch September 23, 2020 00:35
@Eric-Arellano
Copy link
Contributor Author

This seems to have broken the Build Wheels shards.

@Eric-Arellano
Copy link
Contributor Author

Eric-Arellano commented Sep 23, 2020

This seems to have broken the Build Wheels shards.

It's for some reason fixed by this change:

diff --git a/src/python/pants/backend/python/subsystems/setuptools.py b/src/python/pants/backend/python/subsystems/setuptools.py
index 6f08409af..8c12a8b51 100644
--- a/src/python/pants/backend/python/subsystems/setuptools.py
+++ b/src/python/pants/backend/python/subsystems/setuptools.py
@@ -12,5 +12,5 @@ class Setuptools(PythonToolBase):
     options_scope = "setuptools"
     default_version = "setuptools>=50.3.0,<50.4"
     default_extra_requirements = ["wheel==0.35.1"]
-    register_interpreter_constraints = True
-    default_interpreter_constraints = ["CPython>=3.5"]
+    # register_interpreter_constraints = True
+    # default_interpreter_constraints = ["CPython>=3.5"]

I have no idea why that would be. Why does the interpreter we run setuptools.pex with have an impact on whether the built wheel is compatible with Python 3.7? cc @benjyw if you have ideas

Note that the failure is only when using PY=python3.7 and PY=python3.8. The default, which uses python3.6, passes.

@Eric-Arellano
Copy link
Contributor Author

Okay, I think I see the issue. We only run setup-py with bdist_wheel for pantsbuild.pants. No --python-tag. This means that setuptools uses the interpreter it's running with to determine the ABI, afaict, e.g. cp36-cp36m-macosx_10_15_x86_64.

Now that we've set the interpreter constraints for setuptools, it's always using the minimum version of 3.6 no matter what. I'm still unclear on why it was working previously; I don't see why us setting PY=python3.7 and --python-setup-interpreter-constraints=['==3.7.*'] would influence what setuptools is run with. It seems finicky that this was working in the first place.

The solution is for our release script to set --setuptools-interpreter-constraints to the interpreter we want. That's fine for us. But this doesn't seem ideal for end users. I think we need to make some improvements to setup-py, including:

  1. Start embedding more information like bdist_wheel args in the BUILD file.
  2. Figure out this story on interpreter constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants