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

PythonInterperter should support creating bare interpreters. #510

Closed
jsirois opened this issue Jun 6, 2018 · 0 comments · Fixed by #518
Closed

PythonInterperter should support creating bare interpreters. #510

jsirois opened this issue Jun 6, 2018 · 0 comments · Fixed by #518
Assignees

Comments

@jsirois
Copy link
Member

jsirois commented Jun 6, 2018

Discovered working pantsbuild/pants#5910. The only remaining public APIs (the constructor is fapp not public) all route through from_binary which creates a PythonInterpreter with all the extras installed in that interpreter's site_packages, etc. As such, creating a bare interpreter requires something like:

interpreter_with_extras = PythonInterpreter.from_binary(binary_path)
bare_interpreter = PythonInterpreter(binary_path, interpreter_with_extras.identity, extras=None)

It's perhaps enough to plumb an include_site_extras=True parameter through from_binary that, when passed as false, could produce a bare interpreter.

jsirois added a commit to jsirois/pants that referenced this issue Jun 6, 2018
This hacks around a few issues with the 1.4.x pex API. We concoct a
minimal local `Platform` to pass to `resolve` where a local interpreter
is passed to work around pex-tool/pex#511.
We also now consolidate `PythonInterpreter` construction in production
code to helper that ensures the interpreters we create are bare
(isolated) except for the specific extras we require to work around
pex-tool/pex#510.

Upgrading pex to take advantage of the worked around issues noted above
is tracked by pantsbuild#5922.

Fixes pantsbuild#5906
jsirois added a commit to jsirois/pants that referenced this issue Jun 6, 2018
This hacks around a few issues with the 1.4.x pex API. We concoct a
minimal local `Platform` to pass to `resolve` where a local interpreter
is passed to work around pex-tool/pex#511.
We also now consolidate `PythonInterpreter` construction in production
code to helper that ensures the interpreters we create are bare
(isolated) except for the specific extras we require to work around
pex-tool/pex#510.

Upgrading pex to take advantage of the worked around issues noted above
is tracked by pantsbuild#5922.

Fixes pantsbuild#5906
jsirois added a commit to jsirois/pants that referenced this issue Jun 6, 2018
This hacks around a few issues with the 1.4.x pex API. We concoct a
minimal local `Platform` to pass to `resolve` where a local interpreter
is passed to work around pex-tool/pex#511.
We also now consolidate `PythonInterpreter` construction in production
code to helper that ensures the interpreters we create are bare
(isolated) except for the specific extras we require to work around
pex-tool/pex#510.

Upgrading pex to take advantage of the worked around issues noted above
is tracked by pantsbuild#5922.

Fixes pantsbuild#5906
jsirois added a commit to jsirois/pants that referenced this issue Jun 7, 2018
This hacks around a few issues with the 1.4.x pex API. We concoct a
minimal local `Platform` to pass to `resolve` where a local interpreter
is passed to work around pex-tool/pex#511.
We also now consolidate `PythonInterpreter` construction in production
code to helper that ensures the interpreters we create are bare
(isolated) except for the specific extras we require to work around
pex-tool/pex#510.

Upgrading pex to take advantage of the worked around issues noted above
is tracked by pantsbuild#5922.

Fixes pantsbuild#5906
jsirois added a commit to pantsbuild/pants that referenced this issue Jun 7, 2018
This hacks around a few issues with the 1.4.x pex API. We concoct a
minimal local `Platform` to pass to `resolve` where a local interpreter
is passed to work around pex-tool/pex#511.
We also now consolidate `PythonInterpreter` construction in production
code to helper that ensures the interpreters we create are bare
(isolated) except for the specific extras we require to work around
pex-tool/pex#510.

Upgrading pex to take advantage of the worked around issues noted above
is tracked by #5922.

Fixes #5906
@jsirois jsirois self-assigned this Jun 7, 2018
jsirois added a commit to jsirois/pex that referenced this issue Jun 15, 2018
The `PythonInterpreter.from_binary` method now caches by a full stable
key over all input parameters fixing previously order-dependent caching.
In addition, an `include_site_extras` argument is added to allow the
caller to request a bare interpreter (by passing `False`) with none of
the extra distributions installed in the interpeter `site-packages`
directory.

Fixes pex-tool#509
Fixes pex-tool#510
jsirois added a commit that referenced this issue Jun 16, 2018
The `PythonInterpreter.from_binary` method now caches by a full stable
key over all input parameters fixing previously order-dependent caching.
In addition, an `include_site_extras` argument is added to allow the
caller to request a bare interpreter (by passing `False`) with none of
the extra distributions installed in the interpeter `site-packages`
directory.

Fixes #509
Fixes #510
@jsirois jsirois mentioned this issue Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant