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

Python versions below 3.10 not supported #146

Closed
ADarkDividedGem opened this issue Jun 27, 2024 · 1 comment
Closed

Python versions below 3.10 not supported #146

ADarkDividedGem opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ADarkDividedGem
Copy link

ADarkDividedGem commented Jun 27, 2024

I am using Python 3.9.13 and ran into the following error when I run auto-archiver --help

auto-archiver --help
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Dave\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\auto-archiver.exe_main
.py", line 4, in
from auto_archiver.main import main
File "C:\Users\Dave\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\auto_archiver_init
.py", line 1, in
from . import archivers, databases, enrichers, feeders, formatters, storages, utils, core
File "C:\Users\Dave\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\auto_archiver\archivers_init.py", line 3, in
from .twitter_archiver import TwitterArchiver
File "C:\Users\Dave\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\auto_archiver\archivers\twitter_archiver.py", line 15, in
class TwitterArchiver(Archiver):
File "C:\Users\Dave\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\auto_archiver\archivers\twitter_archiver.py", line 65, in TwitterArchiver
def download_snscrape(self, item: Metadata, url: str, tweet_id: str) -> Union[Metadata|bool]:
TypeError: unsupported operand type(s) for |: 'type' and 'type'

This happens because union types are only support in Python 3.10:
https://peps.python.org/pep-0604/

To get round the issue I added from __future__ import annotations to the top of the twitter_archiver.py file.
fastapi/typer#371 (comment)

Given your readme asks that "python 3.8 or higher" is installed I thought I would report this bug.

@GalenReich GalenReich added the bug Something isn't working label Jun 27, 2024
@msramalho
Copy link
Contributor

Hey @ADarkDividedGem I've had a look at this and there are indeed several uses of the union notation for types across the project. While changing them could be a quick fix I suspect there may be other issues with python 3.8 namely in dependencies as this project has been mostly developed with python 3.10.

As such, I'll update the min version of the project to 3.10 for now, since having the support means always testing with 3.8 and we're not doing that atm. The ideal future scenario will be a set of CI tests that run on multiple python versions and would allow us to expand to support older versions too.

Thanks for noticing and adding good reference materials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants