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

Update CI to Python 3.9 #28713

Merged
merged 13 commits into from May 3, 2021
Merged

Update CI to Python 3.9 #28713

merged 13 commits into from May 3, 2021

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented Apr 27, 2021

This uses 3.6 and 3.9 as the min/max supported configuration rather than 3.6/3.8

This uses 3.6 and 3.9 as the min/max supported configuration rather than 3.6/3.8
@wpt-pr-bot wpt-pr-bot added testharness.js wave wpt wptrunner The automated test runner, commonly called through ./wpt run labels Apr 27, 2021
@foolip
Copy link
Member

foolip commented Apr 27, 2021

I've pushed a bunch of changes and would be shocked if I got them all right, @jgraham please review for things that our CI don't actually test that need manual confirmation.

tools/tox.ini Outdated Show resolved Hide resolved
@foolip
Copy link
Member

foolip commented Apr 29, 2021

The remaining problem now is this:

py36-mypy3 create: /home/test/web-platform-tests/tools/.tox/py36-mypy3
py36-mypy3 installdeps: -rrequirements_mypy.txt
py36-mypy3 installed: mypy==0.812,mypy-extensions==0.4.3,typed-ast==1.4.3,typing-extensions==3.7.4.3
py36-mypy3 run-test-pre: PYTHONHASHSEED='1082800144'
py36-mypy3 run-test: commands[0] | mypy --config-file=/home/test/web-platform-tests/tools/mypy.ini --no-incremental -p tools.manifest -p tools.lint -p tools.gitignore
tools/lint/lint.py:847: error: "object" has no attribute "__enter__"
tools/lint/lint.py:847: error: "object" has no attribute "__exit__"
Found 2 errors in 1 file (checked 32 source files)

I'm having trouble running this locally and don't know how to fix this.

@jgraham
Copy link
Contributor Author

jgraham commented Apr 29, 2021

The remaining problem now is this:

py36-mypy3 create: /home/test/web-platform-tests/tools/.tox/py36-mypy3
py36-mypy3 installdeps: -rrequirements_mypy.txt
py36-mypy3 installed: mypy==0.812,mypy-extensions==0.4.3,typed-ast==1.4.3,typing-extensions==3.7.4.3
py36-mypy3 run-test-pre: PYTHONHASHSEED='1082800144'
py36-mypy3 run-test: commands[0] | mypy --config-file=/home/test/web-platform-tests/tools/mypy.ini --no-incremental -p tools.manifest -p tools.lint -p tools.gitignore
tools/lint/lint.py:847: error: "object" has no attribute "__enter__"
tools/lint/lint.py:847: error: "object" has no attribute "__exit__"
Found 2 errors in 1 file (checked 32 source files)

I'm having trouble running this locally and don't know how to fix this.

In theory cd tools; tox -e py36-mypy. The problem is that the nullcontext implementation for Python3.6 isn't recognised as a ContextManager. I tried fixing this locally but it didn't work well. Maybe @gsnedders has an idea.

@foolip
Copy link
Member

foolip commented Apr 29, 2021

I have tried tox -e py36-mypy on a machine with a python3.6 binary, but to no avail.

Since both flake8 and mypy are linters of sorts, is there really any point in ensuring they also work with 3.6, or should we just stop running them and ignore the problem?

@jgraham
Copy link
Contributor Author

jgraham commented Apr 29, 2021

Well in theory running mypy with 3.6 reduces the chance we end up with 3.6 specific breakage in a case where we don't have other test coverage. So I'm somewhat in favour of keeping that on (I perhaps care less about flake8, but could be convinced it's worth the small cost). In this case if we don't have a better solution we can always add type: ignore to the line with the error, although that also reduces our type coverage in later Python versions, which isn't ideal.

@foolip
Copy link
Member

foolip commented Apr 29, 2021

Yeah, since mypy is clever enough to understand the sys.version_info >= (3, 7) condition, there does seem to be some value in running it on 3.6. I just found https://mypy.readthedocs.io/en/stable/common_issues.html#spurious-errors-and-locally-silencing-the-checker and type: ignore seems like an option ultimately.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with landing with the tools/lint/lint.py hack if none of us can figure out a better way today. If so it would be nice to file an issue about it though.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works now, remaining failures are #28745

Maybe best to land on Monday though

@foolip
Copy link
Member

foolip commented May 3, 2021

It's Monday!

@foolip foolip merged commit ebc9eba into master May 3, 2021
@foolip foolip deleted the py39 branch May 3, 2021 08:11
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 8, 2021
…void mypy type confusion, a=testonly

Automatic update from web-platform-tests
[lint] Simplify check_file_contents to avoid mypy type confusion

Unblocks web-platform-tests/wpt#28713.

--

wpt-commits: 5530464127b7d7aabebdafe4590a37b84d9cc7c0
wpt-pr: 28762
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.

None yet

4 participants