GithubHelp home page GithubHelp logo

Comments (6)

VojtechStep avatar VojtechStep commented on August 16, 2024

I think that might be a Python version issue - the list[int] generic syntax, which the error complains about, should be available since Python 3.9; which version are you using?

from agda-unimath.

emilyriehl avatar emilyriehl commented on August 16, 2024

I'm using ubuntu in case this is relevant.

When I type

python --version

it tells me the command is not found. When I type

python3 --version

it returns Python 3.8.10. I've just now managed to install python3.9 so

python3.9 --version

returns Python 3.9.16 (but the python3 version is unchanged).

I believe I may be using a package called "python-is-python3". I forget exactly why. The make pre-commit error message looks the same as before.

from agda-unimath.

VojtechStep avatar VojtechStep commented on August 16, 2024

I personally don't have experience with how Ubuntu handles Python updates, so take the following with a grain of salt.

If running python says that the command is not found, then that's perfectly fine - a Python script should specify whether it's using python3 or python2, and having the python command as a shorthand for one of them is more of a user-facing convenience. That's actually what the python-is-python3 package does - it creates a link so that running just python is the same as running python3 (and since python isn't found on your system, you don't have python-is-python3 installed).

Since you installed the python3.9 package, you now have two python installations on your system - the default Python 3.8 (accessible via python3), and the new Python 3.9 (accessible via python3.9). If you want to make Python 3.9 the default (thus a script beginning with #!/usr/bin/env python3, such as our pre-commit hooks, would run that instead of 3.8), then you can use Ubuntu's update-alternatives tool.

However, as I'm reading more into this, it seems that people usually caution against messing with the default python3 version, since pretty much all system components have a dependency on it, and who knows what changing the version would break.

I think the better solution would be for our pre-commit hooks to support Python 3.8, since that's the default for Ubuntu 20.04 LTS, which will be supported until mid-2024 (with "Extended Security Maintanance" period reaching into 2030). I'll look into it.

from agda-unimath.

emilyriehl avatar emilyriehl commented on August 16, 2024

Thanks! I'll wait for further instructions.

from agda-unimath.

VojtechStep avatar VojtechStep commented on August 16, 2024

Ok, so it seems like pre-commit actually uses its own python, not the system-wide version, which is good. But unfortunately I can't reproduce your issue, my hooks run just fine.

On my system, there's this directory ~/.cache/pre-commit/repoabbobbu8/py_env-python3.10/. Could you check if you have something similar? I'm not sure if the repoabbobbu8 part is deterministic, and there might be multiple such folders under ~/.cache/pre-commit, but could you look around and find one with a py_env-python-3.X subdirectory?

from agda-unimath.

VojtechStep avatar VojtechStep commented on August 16, 2024

Well, the Python version selection story is a little more disappointing than I thought, so I went and changed the offending piece of code to be compatible with Python 3.8; this PR should fix the issue: #634.

from agda-unimath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.