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

TypeError when resolving local platforms. #1043

Closed
jsirois opened this issue Sep 25, 2020 · 1 comment · Fixed by #1048
Closed

TypeError when resolving local platforms. #1043

jsirois opened this issue Sep 25, 2020 · 1 comment · Fixed by #1048
Assignees
Labels

Comments

@jsirois
Copy link
Member

jsirois commented Sep 25, 2020

As seen in https://github.com/pantsbuild/example-python CI:

raceback (most recent call last):
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 423, in execute
    exit_code = self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 356, in _wrap_coverage
    return runner(*args)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 387, in _wrap_profiling
    return runner(*args)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 474, in _execute
    return self.execute_entry(self._pex_info.entry_point)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 576, in execute_entry
    return runner(entry_point)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.bootstrap/pex/pex.py", line 592, in execute_pkg_resources
    return runner()
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.deps/pex-2.1.16-py2.py3-none-any.whl/pex/bin/pex.py", line 970, in main
    pex_builder = build_pex(reqs, options, cache=ENV.PEX_ROOT)
  File "/home/travis/.pex/unzipped_pexes/49b4b32295a60a0a4dfc0659c3a44f93560c4a81/.deps/pex-2.1.16-py2.py3-none-any.whl/pex/bin/pex.py", line 762, in build_pex
    resolved_platforms = candidate_interpreter.supported_platforms.intersection(
AttributeError: 'tuple' object has no attribute 'supported_platforms'
@jsirois jsirois added the bug label Sep 25, 2020
@jsirois jsirois self-assigned this Sep 25, 2020
@jsirois
Copy link
Member Author

jsirois commented Sep 25, 2020

This bug was introduced here: #1028 (comment)

jsirois added a commit to jsirois/pex that referenced this issue Sep 27, 2020
Restructure iter_interpreters to be directly useable by the Pex CLI
and the PEX runtime bootstrap so that the heterogeneous usage of
PythonInterpreter.iter_candidates can be fully self contained.

Fixes pex-tool#1043
This was referenced Sep 27, 2020
jsirois added a commit to jsirois/pex that referenced this issue Sep 27, 2020
This adds support for a path filter to allow unification of Pex
buildtime and runtime interpreter discovery. The PythonInterpreter
public API family of `iter`, `iter_candidates` and `all` is
type-annotated and tests are added for `iter_candidates`. To support
proper annotation of iter_candidates helpers, `@overload` support is
added for Python 2.7.

Work towards pex-tool#1043
jsirois added a commit to jsirois/pex that referenced this issue Sep 27, 2020
This adds support for a path filter to allow unification of Pex
buildtime and runtime interpreter discovery. The PythonInterpreter
public API family of `iter`, `iter_candidates` and `all` is
type-annotated and tests are added for `iter_candidates`. To support
proper annotation of iter_candidates helpers, `@overload` support is
added for Python 2.7.

Work towards pex-tool#1043
jsirois added a commit that referenced this issue Sep 27, 2020
This adds support for a path filter to allow unification of Pex
buildtime and runtime interpreter discovery. The PythonInterpreter
public API family of `iter`, `iter_candidates` and `all` is
type-annotated and tests are added for `iter_candidates`. To support
proper annotation of iter_candidates helpers, `@overload` support is
added for Python 2.7.

Work towards #1043
jsirois added a commit to jsirois/pex that referenced this issue Sep 28, 2020
Previously, `iter_compatible_interpreters` let its use of
`PythonIntepreter.iter_candidates` leak outside its direct control.
This allowed the heterogenous iterator returned by `iter_candidates` to
end up in places that did not know about its heterogenous nature.

Expand `iter_compatible_interpreters` to accept an optional
`valid_basenames` filter so that interpreter selection at Pex buildtime
and at PEX runtime can share the same code path and use this unification
to localize consumption of the heteogenous iterator.

Fixes pex-tool#1043.
jsirois added a commit that referenced this issue Oct 1, 2020
Previously, `iter_compatible_interpreters` let its use of
`PythonIntepreter.iter_candidates` leak outside its direct control.
This allowed the heterogenous iterator returned by `iter_candidates` to
end up in places that did not know about its heterogenous nature.

Expand `iter_compatible_interpreters` to accept an optional
`valid_basenames` filter so that interpreter selection at Pex buildtime
and at PEX runtime can share the same code path and use this unification
to localize consumption of the heteogenous iterator.

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

Successfully merging a pull request may close this issue.

1 participant