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

[Bug]: Remove unnecessary 'type-extensions' requirement #2301

Closed
danphenderson opened this issue Feb 15, 2024 · 0 comments · Fixed by #2302
Closed

[Bug]: Remove unnecessary 'type-extensions' requirement #2301

danphenderson opened this issue Feb 15, 2024 · 0 comments · Fixed by #2302

Comments

@danphenderson
Copy link
Contributor

danphenderson commented Feb 15, 2024

I am using the latest version. This is more of a code smell than a bug.

Context

The setup.py specifies type-extensions as an unnecessary requirement when installing the library into a Python 3.8 environment.

The type-extensions package is referenced in various places as:

import sys
from typing import Any, Dict, List, Optional, Sequence, Union

if sys.version_info >= (3, 8):  # pragma: no cover
    from typing import Literal, TypedDict
else:  # pragma: no cover
    from typing_extensions import Literal, TypedDict

Note, sys.version_info >= (3, 8) is always True since playwright only supports versions >=3.8. Consequently, the else block is never executed. Additionally, Literal and TypeDict were introduced into the standard typing module in 3.8 and 3.6, respectively, and a patch should access them from typing.

Environment

- Operating System: macOS
- CPU: [arm64]
- Browser: [All, Chromium, Firefox, WebKit]
- Python Version: [3.9]
- Other info: N/A
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 a pull request may close this issue.

1 participant