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

4.1.2 test suite regressions with Python 3.10.0b4: TypeError: isinstance() arg 2 must be a type, a tuple of types or a union #9505

Closed
mgorny opened this issue Jul 27, 2021 · 9 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented Jul 27, 2021

Describe the bug

Sphinx 4.1.2's test suite has 367 test failures and 13 errors with Python 3.10.0b4. They all seem to have a common cause in:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = <class 'autodoc_target.Class'>

    def isNewType(obj: Any) -> bool:
        """Check the if object is a kind of NewType."""
        if sys.version_info >= (3, 10):
>           return isinstance(obj, typing.NewType)
E           TypeError: isinstance() arg 2 must be a type, a tuple of types or a union

obj        = <class 'autodoc_target.Class'>

sphinx/util/inspect.py:215: TypeError

How to Reproduce

$ git clone https://github.com/sphinx-doc/sphinx
$ cd sphinx
$ tox -e py310

Expected behavior

No response

Your project

n/a

Screenshots

No response

OS

Gentoo Linux

Python version

3.10.0b4

Sphinx version

4.1.2 (+ git master)

Sphinx extensions

No response

Extra tools

No response

Additional context

Full superverbose build log (17M): dev-python:sphinx-4.1.2:20210727-064745.log

@mgorny
Copy link
Contributor Author

mgorny commented Jul 27, 2021

This is how a similar problem was fixed in hypothesis: https://github.com/HypothesisWorks/hypothesis/pull/3044/files

@tk0miya
Copy link
Member

tk0miya commented Jul 27, 2021

Oops... the change of NewType was introduced after b4 release. It will be included in the next release (rc1?). Could you wait for it for a while?

@mgorny
Copy link
Contributor Author

mgorny commented Jul 27, 2021

That would effectively mean we can't package new Sphinx version until it happens. Can't you just extend sys.version_info check to include beta5?

@psss
Copy link

psss commented Jul 28, 2021

Hi, seems one of our tests is failing on this on Fedora Rawhide.

Could you wait for it for a while?

Sure, but how roughly long is "a while"? :) Is it worth disabling failing tests or will it be fixed soon?

@abravalheri
Copy link

Hello, I also found the same error when running sphinx-build ... / python -m sphinx ... on Python 3.10.0b4 on my project (not related to sphinx test suite).

@tk0miya
Copy link
Member

tk0miya commented Jul 29, 2021

3.10.0rc1 will be released next Monday. IMO, it's not too far.
https://www.python.org/dev/peps/pep-0619/#schedule

@abravalheri
Copy link

Aaah, OK, I see, so sphinx should be compatible with 3.10.0rc1, right?

That is wonderful news, thank you very much @tk0miya 👏

@tk0miya
Copy link
Member

tk0miya commented Jul 30, 2021

Yes, we're using the HEAD of 3.10 for testing. So it will be compat with 3.10.0rc1. (But I can't promise that because it's still fragile)

@mgorny
Copy link
Contributor Author

mgorny commented Aug 3, 2021

And so it turns out that due to other last minute changes, sphinx 4.1.2 is compatible neither with 3.10.0b4 nor with 3.10.0rc1.

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

No branches or pull requests

6 participants