Skip to content

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Nov 20, 2020

Summary:
We dropped official support for Python 2.7 early this year, but our
Python build rules still had srcs_version = "PY2AND3" in many places
due to lingering Google dependents. Now is the time to fix that, so that
we may move forward with even more conviction.

Generated with:

buildozer '//...:%py_library' 'set srcs_version PY3' &&
bazel query 'filter(expect.*installed, //tensorboard:all)' \
    | xargs buildozer 'remove srcs_version' &&
git ls-files -z | xargs -0 sed -i s/PY2AND3/PY3/

…which skips adding it to binaries and tests that don’t yet have it.
(They don’t pose a problem with reverse dependencies.) The global sed
hits third_party/*.BUILD and the *.bzl files.

Test Plan:
After syncing into Google, a global presubmit only includes failures
that seem to be false positives.

wchargin-branch: build-srcs-version-py3

Summary:
We dropped official support for Python 2.7 early this year, but our
Python build rules still had `srcs_version = "PY2AND3"` in many places
due to lingering Google dependents. Now is the time to fix that, so that
we may move forward with even more conviction.

Generated with:

```
buildozer '//...:%py_library' 'set srcs_version PY3' &&
bazel query 'filter(expect.*installed, //tensorboard:all)' \
    | xargs buildozer 'remove srcs_version' &&
git ls-files -z | xargs -0 sed -i s/PY2AND3/PY3/
```

…which skips adding it to binaries and tests that don’t yet have it.
(They don’t pose a problem with reverse dependencies.) The global `sed`
hits `third_party/*.BUILD` and the `*.bzl` files.

Test Plan:
Sync into Google, run a global presubmit, and see what happens. Last
time I did this, only three targets failed (out of all our transitive
reverse dependencies), and they all looked like false positives.

wchargin-branch: build-srcs-version-py3
wchargin-source: ac12d89ae6ba74b57e243e3cfaafd789931b5f3d
@wchargin
Copy link
Contributor Author

Googlers, see: http://cl/343401587

@wchargin
Copy link
Contributor Author

We’re happy with the global presubmit results. Plan to merge this on
Monday.

@wchargin wchargin requested a review from bileschi November 20, 2020 20:33
@wchargin wchargin merged commit be76611 into master Nov 23, 2020
@wchargin wchargin deleted the wchargin-build-srcs-version-py3 branch November 23, 2020 21:13
@wchargin wchargin mentioned this pull request Dec 22, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants