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

👷 Add Python 3.10 beta to the CI #1682

Merged
merged 6 commits into from
Jun 15, 2021

Conversation

Kludex
Copy link
Sponsor Member

@Kludex Kludex commented Jun 13, 2021

Closes #1678.

EDIT: Failing due to mypy. - @Kludex
EDIT: Changed "Related to #...." to "Closes #...." - @tomchristie

@Kludex Kludex added enhancement New feature or request tooling Changes to our CI/CD, tests setup, etc. labels Jun 13, 2021
@tomchristie
Copy link
Member

Okay, so #1679 resolves the unrelated mypy failure, which is now merged in.

We've got a curious failure on the 3.10 test run, which I don't understand on first glance.

@Kludex
Copy link
Sponsor Member Author

Kludex commented Jun 14, 2021

It's due to pytest. We need to upgrade to the latest 6.2.4 if we want to add Python 3.10.

Can I proceed?

Reference:

@tomchristie
Copy link
Member

Yup, makes sense.

I'm assuming you'll want to update this line:

pytest==5.*

Switching it to pytest==6.*, and do that as part of this pull request.

@Kludex
Copy link
Sponsor Member Author

Kludex commented Jun 14, 2021

Now there's an issue with trio. 😅

Reference: python-trio/trio#1899

@tomchristie
Copy link
Member

tomchristie commented Jun 14, 2021

Hrrrmmm.... I'm not entirely surprised that we've got a different failure there. After all, we will have pinned pytest for a reason.

However, looking at the blame view for the requirements file isn't super helpful here...

The pin was introduced in this commit but it doesn't have an associated PR, and doesn't include the rationale. (We're way cleaner on process here now, as things have evolved nicely)

That one looks like it needs some further digging.

@tomchristie
Copy link
Member

I'd assume it's a pytest/trio interaction issue, rather than "an issue with trio" or "an issue with pytest", but... (?)

@tomchristie
Copy link
Member

Now there's an issue with trio. 😅

Reference: python-trio/trio#1899

Ah gotcha, thanks!

@tomchristie
Copy link
Member

Okay, so I think we're hard blocked by that one, on adding 3.10 to the matrix. Right?

(Which is totally okay, just making sure we've got the same assessment on that.)

@tomchristie
Copy link
Member

Looks to me like python-trio/trio#1921 will resolve this, and seems pretty much good to go.

@@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-beta.2"]
Copy link
Member

@tomchristie tomchristie Jun 14, 2021

Choose a reason for hiding this comment

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

Can we just use "3.10" here?

Why? / Why not?

Prompted by noticing the same in a Trio pull request.
Also, useful for context here... where does GitHub document the supported values for python-version?

Choose a reason for hiding this comment

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

Note the extra bit in trio.

https://github.com/python-trio/trio/pull/1921/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR44-R52

          # This allows the matrix to specify just the major.minor version while still
          # expanding it to get the latest patch version including alpha releases.
          # This avoids the need to update for each new alpha, beta, release candidate,
          # and then finally an actual release version.  actions/setup-python doesn't
          # support this for PyPy presently so we get no help there.
          # 
          # CPython -> 3.9.0-alpha - 3.9.X
          # PyPy    -> pypy-3.7
          python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}

Choose a reason for hiding this comment

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

Also https://github.com/actions/setup-python#available-versions-of-python and if you search for range you can see it show up in a couple comments. All around not entirely explicitly documented, but useful.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Should I follow trios lead and use the same logic?

Copy link
Member

Choose a reason for hiding this comment

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

Should I follow trios lead and use the same logic?

Perhaps, perhaps not, but either way let's not consider it as part of this pull request.

@@ -164,7 +165,7 @@ async def redirect_301(scope, receive, send):
await send({"type": "http.response.body"})


SERVER_SCOPE = "session"
SERVER_SCOPE: Literal["session"] = "session"
Copy link
Member

@tomchristie tomchristie Jun 14, 2021

Choose a reason for hiding this comment

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

Few questions, for thoroughness. 😁

  • What's prompting this change?
  • Is it strictly necessary for us to type this variable, here?
  • Do we have a build failure without it?
  • Can it simply be str?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

It's precisely because it identifies it as str that we need it. This is the mypy issue:

+ mypy httpx tests
tests/conftest.py:170: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:170: note: Possible overload variant:
tests/conftest.py:170: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:170: note:     <1 more non-matching overload not shown>
tests/conftest.py:175: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:175: note: Possible overload variant:
tests/conftest.py:175: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:175: note:     <1 more non-matching overload not shown>
tests/conftest.py:181: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:181: note: Possible overload variant:
tests/conftest.py:181: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:181: note:     <1 more non-matching overload not shown>
tests/conftest.py:186: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:186: note: Possible overload variant:
tests/conftest.py:186: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:186: note:     <1 more non-matching overload not shown>
tests/conftest.py:192: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:192: note: Possible overload variant:
tests/conftest.py:192: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:192: note:     <1 more non-matching overload not shown>
tests/conftest.py:198: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:198: note: Possible overload variant:
tests/conftest.py:198: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:198: note:     <1 more non-matching overload not shown>
tests/conftest.py:274: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:274: note: Possible overload variant:
tests/conftest.py:274: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:274: note:     <1 more non-matching overload not shown>
tests/conftest.py:281: error: No overload variant of "fixture" matches argument type "str"
tests/conftest.py:281: note: Possible overload variant:
tests/conftest.py:281: note:     def fixture(fixture_function: None = ..., *, scope: Union[Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']], Callable[[str, Config], Union[Literal['session'], Literal['package'], Literal['module'], Literal['class'], Literal['function']]]] = ..., params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]], None] = ..., name: Optional[str] = ...) -> FixtureFunctionMarker
tests/conftest.py:281: note:     <1 more non-matching overload not shown>
Found 8 errors in 1 file (checked 57 source files)

Do you have an alternative suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

Do you have an alternative suggestion?

Nope. Just making sure I understand e'rything going in, and we've got a super clear history in place throughout. 😀

@graingert
Copy link
Member

related: #1671

@pquentin
Copy link
Contributor

I just released Trio 0.19.0 with Python 3.10 support. ✨

@tomchristie
Copy link
Member

👏 Fantastic, thanks @pquentin - I've triggered a test re-run now.

@tomchristie tomchristie merged commit 3231211 into encode:master Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tooling Changes to our CI/CD, tests setup, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Python 3.10 to the build matrix
5 participants