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

Test on Python 3.9-dev #1393

Merged
merged 2 commits into from May 8, 2020
Merged

Test on Python 3.9-dev #1393

merged 2 commits into from May 8, 2020

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented May 8, 2020

Python 3.9 is currently in alpha with a beta due in a couple of weeks (2020-05-18).

This PR tests 3.9-dev on Travis CI, currently Python 3.9.0a6+.

However, it's failing, so as a pre-release I put it in the allow_failures so it won't turn the whole CI red.

The error is:

======================================================================
ERROR: tests.test_black (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_black
Traceback (most recent call last):
  File "/opt/python/3.9-dev/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/python/3.9-dev/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/travis/build/hugovk/black/tests/test_black.py", line 20, in <module>
    import black
  File "/home/travis/build/hugovk/black/black.py", line 140, in <module>
    TMatchResult = TResult[Index]
  File "/opt/python/3.9-dev/lib/python3.9/typing.py", line 244, in inner
    return func(*args, **kwds)
  File "/opt/python/3.9-dev/lib/python3.9/typing.py", line 704, in __getitem__
    arg = arg[subargs]
  File "/opt/python/3.9-dev/lib/python3.9/typing.py", line 244, in inner
    return func(*args, **kwds)
  File "/opt/python/3.9-dev/lib/python3.9/typing.py", line 695, in __getitem__
    _check_generic(self, params)
  File "/opt/python/3.9-dev/lib/python3.9/typing.py", line 194, in _check_generic
    raise TypeError(f"{cls} is not a generic class")
TypeError: black.Err[black.CannotTransform] is not a generic class

https://travis-ci.org/github/hugovk/black/jobs/684724917

@JelleZijlstra
Copy link
Collaborator

Thanks! The error looks like a CPython bug; I'll try to distill it into a bug report unless somebody else gets to it.

@JelleZijlstra JelleZijlstra merged commit 362b722 into psf:master May 8, 2020
@hugovk hugovk deleted the add-3.9-dev branch May 8, 2020 15:26
@hugovk
Copy link
Contributor Author

hugovk commented May 8, 2020

Oh, good to find it :)

@brettcannon will be happy, I was following his suggestion of testing dev versions!

https://snarky.ca/how-to-use-your-project-travis-to-help-test-python-itself/

@JelleZijlstra
Copy link
Collaborator

Posted in https://bugs.python.org/issue40397

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

I might put a PR up to see if anyone else agrees.

@@ -27,6 +27,10 @@ matrix:
python: 3.7
- name: "3.8"
python: 3.8
- name: "3.9"
python: 3.9-dev
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm more of a fan of nightly for failure allowed testing:

    - python: nightly
  allow_failures:
    - python: nightly

Then we get signal on the net versions fixes sooner :)

Copy link
Contributor Author

@hugovk hugovk May 9, 2020

Choose a reason for hiding this comment

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

Is it so that nightly and 3.9-dev are the same thing at the moment? And at some point in the future, nightly will be 3.10?

Sounds like a good idea to add it.

I'd suggest also keeping 3.9-dev as a gating check which can fail the whole build, ie. not in allowed_failures, to make sure new PRs pass on 3.9. (But only when the CPython bug is fixed and released.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants