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 inconsistency? python 3.8 vs 3.9? #2797

Open
th3w1zard1 opened this issue Aug 30, 2024 · 3 comments
Open

Version inconsistency? python 3.8 vs 3.9? #2797

th3w1zard1 opened this issue Aug 30, 2024 · 3 comments
Labels
bug A crash or error in behavior.

Comments

@th3w1zard1
Copy link

th3w1zard1 commented Aug 30, 2024

Describe the bug

pre-commit is failing with the following error:

(.venv) PS C:\GitHub\toga> pre-commit run    
[INFO] Installing environment for https://github.com/asottile/pyupgrade.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\boden\\.cache\\pre-commit\\repo3thdqgvs\\py_env-python3.8\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing c:\users\boden\.cache\pre-commit\repo3thdqgvs
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Collecting tokenize-rt>=5.2.0 (from pyupgrade==3.17.0)
      Using cached tokenize_rt-6.0.0-py2.py3-none-any.whl.metadata (4.1 kB)
    INFO: pip is looking at multiple versions of pyupgrade to determine which version is compatible with other requirements. This could take a while.
stderr:
    ERROR: Package 'pyupgrade' requires a different Python: 3.8.10 not in '>=3.9'
Check the log at C:\Users\boden\.cache\pre-commit\pre-commit.log

however toga documentation clearly states it should support 3.8?
image
https://github.com/beeware/toga#minimum-requirements

Expected behavior

pre-commit runs successfully, without complaining about my python version

Environment

  • Windows 10 x64
  • Python version: Python 3.8.10 (also happens on 3.8.18)
  • Software versions:
    • Toga: master

Logs

(.venv) PS C:\GitHub\toga> pre-commit run    
[INFO] Installing environment for https://github.com/asottile/pyupgrade.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\boden\\.cache\\pre-commit\\repo3thdqgvs\\py_env-python3.8\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing c:\users\boden\.cache\pre-commit\repo3thdqgvs
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Collecting tokenize-rt>=5.2.0 (from pyupgrade==3.17.0)
      Using cached tokenize_rt-6.0.0-py2.py3-none-any.whl.metadata (4.1 kB)
    INFO: pip is looking at multiple versions of pyupgrade to determine which version is compatible with other requirements. This could take a while.
stderr:
    ERROR: Package 'pyupgrade' requires a different Python: 3.8.10 not in '>=3.9'
Check the log at C:\Users\boden\.cache\pre-commit\pre-commit.log

Additional context

Putting all this information together I'm understanding that Toga contributors are required to have python 3.9, however if I'm testing and working around python 3.8 limitations, am I expected to test in 3.8, and then test again in 3.9, running pre-commit, before contributing a solution??

@th3w1zard1 th3w1zard1 added the bug A crash or error in behavior. label Aug 30, 2024
@freakboy3742
Copy link
Member

Thanks for the report, and apologies for the confusion around this.

Right now, Toga needs to be tested on Python 3.8; but that doesn't mean pre-commit needs to be run on Python 3.8. It looks like one of the recent releases of pre-commit has dropped Python 3.8 support; as a result, the pre-commit checks can't currently be run in a Python 3.8 environment

So - at least for the moment, the virtual environment where you perform your commits (or run pre-commit) needs to be Python 3.9 or later. However, you can use this Python3.9 environment to run tox -e py38, which will peform tests in the 3.8 environment.

That said - Toga's support for Python 3.8 support in Toga is not long for this world - we'll be dropping it before the end of October when 3.8 hits EOL.

I'll leave this ticket open as a guide for others; the "fix" is to finalise the deprecation of Python 3.8 in Toga.

@th3w1zard1
Copy link
Author

Ah that's too bad, I wasn't aware it was hitting EOL so soon. FWIW I believe Python 3.8 is the last python version supported on windows 7.

@freakboy3742
Copy link
Member

That's a bit of a moot point from Toga's perspective, as Windows 7 is also EOL, and Toga doesn't support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

2 participants