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

typing-related failure on Python 3.8 #67

Closed
pitrou opened this issue Apr 2, 2024 · 2 comments
Closed

typing-related failure on Python 3.8 #67

pitrou opened this issue Apr 2, 2024 · 2 comments
Labels

Comments

@pitrou
Copy link

pitrou commented Apr 2, 2024

Describe the bug

We've started to see CI failures due to typing annotations in pytest-cython on our Python 3.8 build:

  File "/opt/conda/envs/arrow/lib/python3.8/site-packages/pytest_cython/plugin.py", line 77, in <module>
    def _without_suffixes(path: str | pathlib.Path) -> pathlib.Path:
TypeError: unsupported operand type(s) for |: 'type' and 'type'

https://github.com/apache/arrow/actions/runs/8526575827/job/23356153535?pr=40949#step:6:5476

Installed Packages
The following Python and installed packages versions being used:

  • Python: 3.8.19
  • Cython: 3.0.9
  • Pytest: 8.1.1
  • Pytest-cython: 0.3.0
@pitrou pitrou added the bug label Apr 2, 2024
@pitrou
Copy link
Author

pitrou commented Apr 2, 2024

According to https://docs.python.org/3/library/typing.html#typing.Union, writing a union as X | Y is only supported from Python 3.10 onwards. Otherwise you need Union[X, Y] (which is admittedly much less pretty).

@pitrou
Copy link
Author

pitrou commented Apr 2, 2024

Well, apparently it was fixed in #66 . Thanks @nsoranzo @lgpage !

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

No branches or pull requests

1 participant