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

Version 4.8.0rc1 fails on Python 3.7 with SyntaxError in typing_extensions.py line 874 #282

Closed
andy-maier opened this issue Sep 10, 2023 · 4 comments

Comments

@andy-maier
Copy link

andy-maier commented Sep 10, 2023

    from typing import SupportsIndex  # type: ignore
ImportError: cannot import name 'SupportsIndex' from 'typing' (/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/typing.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/runner/work/nocaselist/nocaselist/nocaselist/__init__.py", line 8, in <module>
    from ._nocaselist import *  # noqa: F403,F401
  File "/home/runner/work/nocaselist/nocaselist/nocaselist/_nocaselist.py", line 11, in <module>
    from typing_extensions import SupportsIndex  # Python <=3.7
  File "/home/runner/work/nocaselist/nocaselist/tmp_installtest/virtualenvs/nocaselist_test_test2/lib/python3.7/site-packages/typing_extensions-4.8.0rc1-py3.7.egg/typing_extensions.py", line 874
    def TypedDict(typename, fields=_marker, /, *, total=True, **kwargs):
                                            ^
SyntaxError: invalid syntax

Test run, for details: https://github.com/pywbem/nocaselist/actions/runs/6134182604/job/16646764117#step:19:72

Also, why does version 4.8.0rc1 even get installed? This happens during our install test, where we use different mechanisms for installing our package, and the issue happens in setup.py based install from the repo root directory. Is this another thing that broke in setup.py?

@AlexWaygood
Copy link
Member

4.8.0rc1 no longer supports Python 3.7 (as Python 3.7 is now end-of-life), and this is stated in our pyproject.toml file:

requires-python = ">=3.8"

@andy-maier
Copy link
Author

andy-maier commented Sep 10, 2023

Thanks for the quick response.
That explains why the error appears.

And the setup.py based install that happily installs 4.8.0rc1 on Python 3.7 is not really your problem, I guess. It is just another indicator that we should get off of setup.py based installs.

As far as I'm concerned, this issue can be closed.

@AlexWaygood
Copy link
Member

Looks like you're doing some complicated stuff here: https://github.com/pywbem/nocaselist/blob/master/tests/installtest/test_install.sh

All I can say is that pip install typing_extensions on Python 3.7 should cause pip's resolver to pick an older version of typing_extensions, as pip looks at the requires-python field before selecting which version to install. That means one of the following must be going on:

  1. There's a bug in pip's resolver
  2. you're doing something... Strange in your script that's confusing pip's resolver somehow and meaning that it's selecting a version of typing_extensions that's incompatible with Python 3.7 :-)

I haven't looked too deeply here, but I suspect it's (2) ;-)

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@andy-maier
Copy link
Author

andy-maier commented Sep 10, 2023

The pip based install process correctly does pick up an older version.
It is only the setup.py based install that ends up installing 4.8.0rc1 on Python 3.7, and the install folks have long recommended to no longer use setup.py for install. I'll remove the setup.py based install from our install tests.

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

No branches or pull requests

2 participants