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
Solidify Python 3 support in the manifest code #23733
Conversation
Oops, meant to mark this as a draft. Will certainly fail some tests |
79df9ed
to
f70b95f
Compare
f70b95f
to
2e99a78
Compare
2e99a78
to
363021b
Compare
363021b
to
c8130df
Compare
843d022
to
c091e4c
Compare
c091e4c
to
74a9e11
Compare
tools/manifest/download.py
Outdated
@@ -159,7 +159,8 @@ def download_manifest( | |||
fileobj = io.BytesIO(resp.read()) | |||
try: | |||
with gzip.GzipFile(fileobj=fileobj) as gzf: | |||
decompressed = gzf.read() # type: ignore | |||
data = read_gzf(gzf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need type: ignore
here too.
The goal here is to get mypy passing in Python 3; prior to this patch there were a lot of cases where Python 3 behaviour was broken but not picked up by the tests (e.g. because it only happened when updating the manifest or with certain caches or similar). Many of these issues were seen by mypy, but that had been disabled for Py3 specfically to avoid having to fix all the issues at the time the annotations were added. But now we do need that support. The general approach here is to use the same types for Py 2 and Py 3. In particular we use Text where possible (with a couple of exceptions where it was easier not to), rather than bytes. The native str type is avoided wherever possible since this introduces difficult to debug differences between Python versions. The preference for Text includes paths, which means we no longer support running in non-unicode directories (in practice it is likely to be broken if the path isn't UTF-8 compatible on Unix or UTF-16 compatible on Windows).
Seems like bare pip started defaulting to python 3
5c7a3dd
to
5fb7ee9
Compare
RUN pip3 install --upgrade pip | ||
RUN pip3 install virtualenv | ||
|
||
# Ensure we have up-to-date six |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that this still needs addressed as far as I can tell (as in, filing a followup issue or sending a followup PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR, the overall change LGTM. My only concerns back then were the mypy breakage which seems to have been addressed. I'm assuming Stephen's proposed fixes were adopted (not sure since the branch was rebased). These fixes LGTM, too. IMHO, they are not "horrific hacks", but thoughtful workarounds :) Thanks again for the in-depth investigation here and getting this unblocked, Stephen!
At least at times, we could end up with the rename limit warning being output (i.e., `inexact rename detection was skipped due to too many files`). This then caused our assert to fail, as it relied on the output following the -z argument and ending without any trailing out. This warning is absolutely useless for us, as we're just looking to find out what files have changed, so we don't care if the file is a rename or not, so we can avoid it by just outright disabling rename detection. This was previously fixed in web-platform-tests#18879 (30c42ec) by just outright ignoring stderr, but was regressed in web-platform-tests#23733 (6539f1e). Avoiding the warning being output in the first place seems like a better solution than ignoring any errors git might produce.
At least at times, we could end up with the rename limit warning being output (i.e., `inexact rename detection was skipped due to too many files`). This then caused our assert to fail, as it relied on the output following the -z argument and ending without any trailing out. This warning is absolutely useless for us, as we're just looking to find out what files have changed, so we don't care if the file is a rename or not, so we can avoid it by just outright disabling rename detection. This was previously fixed in #18879 (30c42ec) by just outright ignoring stderr, but was regressed in #23733 (6539f1e). Avoiding the warning being output in the first place seems like a better solution than ignoring any errors git might produce.
… on TC, a=testonly Automatic update from web-platform-tests Disable rename detection when looking for changed tests At least at times, we could end up with the rename limit warning being output (i.e., `inexact rename detection was skipped due to too many files`). This then caused our assert to fail, as it relied on the output following the -z argument and ending without any trailing out. This warning is absolutely useless for us, as we're just looking to find out what files have changed, so we don't care if the file is a rename or not, so we can avoid it by just outright disabling rename detection. This was previously fixed in web-platform-tests/wpt#18879 (30c42ecf9a) by just outright ignoring stderr, but was regressed in web-platform-tests/wpt#23733 (6539f1e343). Avoiding the warning being output in the first place seems like a better solution than ignoring any errors git might produce. -- Deal with the different semantics of A..B in git-diff in repo_files_changed At the moment on TaskCluster we pass something like {PR base}..{PR head} which is sometimes a small range when parsed as a range (see gitrevisions(7)), as it is everything reachable from PR head but not from PR base. By comparison, for git-diff, A..B gives all changes between the two trees A and B, which if the PR is filed with a merge-base a long way behind master would be a much larger change. As such, change repo_files_changed to use the merge-base of A..B, as this gives us the diff of the commits that are new on the PR branch. -- wpt-commits: 7cba72c881e666578f1f01c790d2298dd3ee756d, a7514a7da22289bccf9e0ce5e7bc28f75b9dc9bc wpt-pr: 31037
… on TC, a=testonly Automatic update from web-platform-tests Disable rename detection when looking for changed tests At least at times, we could end up with the rename limit warning being output (i.e., `inexact rename detection was skipped due to too many files`). This then caused our assert to fail, as it relied on the output following the -z argument and ending without any trailing out. This warning is absolutely useless for us, as we're just looking to find out what files have changed, so we don't care if the file is a rename or not, so we can avoid it by just outright disabling rename detection. This was previously fixed in web-platform-tests/wpt#18879 (30c42ecf9a) by just outright ignoring stderr, but was regressed in web-platform-tests/wpt#23733 (6539f1e343). Avoiding the warning being output in the first place seems like a better solution than ignoring any errors git might produce. -- Deal with the different semantics of A..B in git-diff in repo_files_changed At the moment on TaskCluster we pass something like {PR base}..{PR head} which is sometimes a small range when parsed as a range (see gitrevisions(7)), as it is everything reachable from PR head but not from PR base. By comparison, for git-diff, A..B gives all changes between the two trees A and B, which if the PR is filed with a merge-base a long way behind master would be a much larger change. As such, change repo_files_changed to use the merge-base of A..B, as this gives us the diff of the commits that are new on the PR branch. -- wpt-commits: 7cba72c881e666578f1f01c790d2298dd3ee756d, a7514a7da22289bccf9e0ce5e7bc28f75b9dc9bc wpt-pr: 31037
At least at times, we could end up with the rename limit warning being output (i.e., `inexact rename detection was skipped due to too many files`). This then caused our assert to fail, as it relied on the output following the -z argument and ending without any trailing out. This warning is absolutely useless for us, as we're just looking to find out what files have changed, so we don't care if the file is a rename or not, so we can avoid it by just outright disabling rename detection. This was previously fixed in web-platform-tests#18879 (30c42ec) by just outright ignoring stderr, but was regressed in web-platform-tests#23733 (6539f1e). Avoiding the warning being output in the first place seems like a better solution than ignoring any errors git might produce.
No description provided.