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

Cherry-pick setup_py fixes #6472

Merged
merged 6 commits into from Sep 10, 2018

Conversation

Projects
None yet
5 participants
@jsirois
Copy link
Member

jsirois commented Sep 7, 2018

There are two fixes to the setup_py task this change targets: #6428 & #6439.

In order to grab those changes ~cleanly, additional changes are picked: a small prod fix in #6453 and test setup_py support changes in #6440, #6469 and #6446.

The full list of cherry-picks:

  1. [fix] Pass full path to isdir rather than just basename. (#6453)
  2. Tighten travis matrix and python activation. (#6440)
  3. Remove broken pyenv shims from the PATH. (#6469)
  4. Fixup tests involving pexrc. (#6446)
  5. Detect ns packages using correct interpreter. (#6428):
  6. Fix setup.py rendering. (#6439)

OniOni and others added some commits Sep 5, 2018

[fix] Pass full path to isdir rather than just basename. (#6453)
* [fix] Pass full path to isdir rather than just basename.

* [test] Add tests for fix.
Tighten travis matrix and python activation. (#6440)
A few improvements and fixes to the travis setup:
+ Upgrade to to python 2.7.14 via `python: "2.7"`.
+ Use `name` uniformly to name shards and kill the `SHARD` env var which
  was only used to achieve the same end.
+ Use anchors to DRY up python version and clippy shard failure
  ignoring.
+ Ensure travis `pyenv` pythons are on `PATH`. This works around
  travis-ci/travis-ci#8315 and nets us both
  python 2.7 and python 3.6 on all `language: python` shards.

This last is needed to support #6428 which fixes #6415.
Remove broken pyenv shims from the PATH. (#6469)
It turns out these would still get found in various contexts since the
interpreter cache tries to setup everything it finds on the PATH. Add
improved context in the wrapper script to show exactly which pythons
Pants will have access to.
Fixup tests involving pexrc. (#6446)
Previously these tests weren't reliably reading a pexrc and had fragile
workarounds and paper-overs as a result. pexrc_util now reliably injects
a pexrc with a temporary HOME.

Also cleanup the affected tests - use @skipIf, respect 100 cols, ensure
path comparisons with judicious application of `os.realpath`.
Detect ns packages using correct interpreter. (#6428)
Previously `__init__.py`s were parsed in the context of the ambient
interpreter executing the `SetupPy` task which could lead to parse
failures for new or removed language features used in those
`__init__.py`s. We now construct a PEX using the appropriate interpreter
and use it to run ns package detection.

Fixes #6415
@jsirois

This comment has been minimized.

Copy link
Member

jsirois commented Sep 7, 2018

NB: The picks all have their own commit here for sanity sake.

Fix setup.py rendering. (#6439)
We now render setup.py from both python 2 & 3 such that the result
is ingestible by both python 2 & 3.

Fixes #6401
Fixes #6392

@jsirois jsirois force-pushed the jsirois:setup_py/1.9.x/cherry-picks branch from 6e1edc5 to 97d2fa4 Sep 8, 2018

@jsirois jsirois requested review from stuhood and cosmicexplorer Sep 8, 2018

@stuhood

stuhood approved these changes Sep 8, 2018

Copy link
Member

stuhood left a comment

Thanks a lot for doing this John!

Looks good to me.

@jsirois

This comment has been minimized.

Copy link
Member

jsirois commented Sep 9, 2018

@cosmicexplorer IIUC you're in charge of 1.9.x and if that's right I'd like to get your sign-off before submitting.

@Eric-Arellano
Copy link
Contributor

Eric-Arellano left a comment

Thanks John!

@cosmicexplorer
Copy link
Contributor

cosmicexplorer left a comment

I learned a nontrivial amount of python reading through this! I apologize for the delayed review.

@jsirois jsirois merged commit f953cdc into pantsbuild:1.9.x Sep 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jsirois jsirois deleted the jsirois:setup_py/1.9.x/cherry-picks branch Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment