forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Port contrib python to py3 #11
Closed
GoingTharn
wants to merge
35
commits into
foursquare:master
from
GoingTharn:port-contrib-python-to-py3
Closed
Port contrib python to py3 #11
GoingTharn
wants to merge
35
commits into
foursquare:master
from
GoingTharn:port-contrib-python-to-py3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This only served to set interpreter constraints we already express in pants.ini, and at a higher precedence, making attempted overrides via environment variable silently fail.
Fixing issue from the port of buildgen of missing dependency in BUILD file from pantsbuild#6110. While technically everything runs correctly without this declaration, that is an implementation detail that should not be relied upon.
### Problem update for py3 compatiibility ### Solution Just need future and builtins import.
just needs builtins imports ### Problem Port mypy to py3 just imports at issue ### Solution Futurize script is it.
Followup for pantsbuild#6062. Almost all automated changes, the exception of the change from using `map()` to a for loop.
Port python contrib to py3
Remove map, replace with a for loop
…we don't use the first cached one (pantsbuild#6022) ### Problem I made pantsbuild#5479 because the dist resolved for a `python_dist()` would not change after changing any of the source files, and this persisted even after a `clean-all`. This issue is more thoroughly explained in pantsbuild#5449 (which I literally didn't see before making this PR, but describes almost exactly what this PR does, it seems -- great minds think alike?). We were building the `python_dist()` targets each time they were invalidated, but caching the package locally in `~/.cache/pants/` after we built it the first time and using that instead, because the version string was the same for both the first and subsequent builds of the `python_dist()` target. ### Solution - Move argv generation for setup.py invocations into `BuildLocalPythonDistributions`. - Append the `python_dist()` target's fingerprint to the version string using `--tag-build`. This conforms to the "local" version specifier format as per [PEP 440](https://www.python.org/dev/peps/pep-0440/#local-version-identifiers). This tagged version is then used in the synthetic `PythonRequirement` stitched into the build graph for the local dist. - Add an integration test `test_invalidation()` using `mock_buildroot()` (which fails on master, but not in this PR) where we run a binary depending on a `python_dist()`, rewrite the contents of a source file to change the output, then run pants again to verify that the new dist is resolved. *Separately:* - Made `PythonDistribution` subclass `PythonTarget` to avoid duplicated logic. It's not clear what the original reason for not subclassing it was at first, but it seems to be not be in effect anymore. - Changed the `dir` field name for the `Manager` namedtuple in `mock_buildroot()` to be `new_buildroot` so it doesn't get highlighted as a builtin in certain text editors. ### Result When we resolve local dists in any python requirements task, we get the dist corresponding to the target we just built. Resolves pantsbuild#5449.
took futurize ### Problem Port scrooge to py3 -- took futurize suggestions ### Solution ported
### Problem Porting to py3 ### Solution futurize
### Problem Porting contrib/cpp to py3 ### Solution just added an import
### Problem Upgrading go to be compat w/py3 ### Solution Very few, script handled 100% but I did revert a couple of excess lists.
This picks up python3 std lib module knowledge. In addition, remove the un-needed isort 3rdparty dep and the contrib/python/src/python/pants/contrib/python/isort binary. The isort pex is now directly built via script in pantsbuild/binaries. Fixes pantsbuild#6149
We were running `--write-mode=diff` which used to exit 4 if your code as incorrectly formatted, and now doesn't. It now only exits non-0 if your code doesn't parse. `--write-mode=check` *does* exit non-zero if your code isn't correctly formatted, but provides no way of distinguishing "Your code is incorrectly formatted" from "your code doesn't parse". So that's nice of it.
Port python contrib to py3
Remove map, replace with a for loop
…nts into port-contrib-python-to-py3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
checking if it fails here
Solution
Failed on pants internal, checking here