-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to Lint or Render the PEPs Using Older Python Versions #2402
Comments
Rendering PEPs requires 3.9 or later, I can't speak to linting.
I thought using the A |
How necessary is this? That presents a degree of inconvenience and could be dealt with without much fuss (it took me ten minutes to get it running under 3.6, e.g. wrapping problematic annotations in string literals. If it is necessary then how can I make /usr/bin/python3 point to a 3.9+ install? |
FWIW, the message I'm getting is that I shouldn't be running |
It is my understanding that pre-commit sees itself as a command line tool that happens to be written in Python, rather than a Python tool, so their reccomended invocation is A |
No! I'm sorry if I gave this impression. I would happily take suggestions on how to make this better for unix users -- I just don't know what to do to best fix this. A |
Hmm, it worked fine for me on 3.6 after I fixed the pep_sphinx_extensions code. |
I wasgoing from pre-commit/pre-commit@04de6a2, though I don't doubt you. A |
Their shbang is hard-coded to /usr/bin/python3, which is super problematic. If they want to be used as a command-line tool then they should not support |
The broader point here is that our guidance for PEP authors is clearly not good enough, leading to #2402, #2403, #2404. Firstly there's the (hopefully simple) fix of changing the python invocations in Eric -- I'd appreciate any general comment as to pain points -- happy to take full responsibility for my where changes have caused you headaches. A |
Thanks! My suggestions:
It's not all that bad. It hasn't caused me any real problems. Mostly I have ended up avoiding doing much with PEPs because of these things. |
Regardless, I appreciate your effort! |
Sorry for the delay in responding; I've been dealing with urgent family matters most of today. I maintain the linting infra, so I can speak to that part. As it seems you've discussed, it ultimately depends on the Python versions supported by pre-commit, which should include any supported version (i.e. currently 3.7+). If you're using Python 3.6, which is end of life and no longer supported by the Python team (i.e. this organization), older versions of pre-commit should (IIRC) still support it—though that is not guaranteed and may change eventually.
Oh, I initially wasn't clear on the specific issue being reported, and thought you were describing an error in the linting system itself, rather than a check failure, and wrote a response accordingly. What I'm guessing this is referring to, however, is that As for the Finally, as to the rendering system requiring Python 3.9+, I personally think it would be reasonable to accept a PR extending support to 3.7+ (i.e. the supported versions of Python) and maintain it on a best-effort basis, but I'd ultimately defer to @AA-Turner 's judgement, as its volunteer creator and maintainer. 3.6 is a different story, though, since it is no longer supported by the core team (i.e. this org) and an increasing amount of the dep stack, so supporting it here would be an issue both in principle and in practice. |
You can override it like this: make PYTHON=python3.7 lint
make PYTHON=/Users/huvankem/.pyenv/shims/python3.8 lint
Good point, please see PR #2408. |
I don't think any effort should be made to support 3.6 since we as a project don't even support that version of Python anymore. Whether to support versions that are no longer receiving bug fixes I leave to the folks managing the infrastructure code now. I will say that PEP authorship is niche enough that asking folks to install a modern version of Python isn't unreasonable (and if it is then we should fix our installation story). |
I also agree we don't need to support EOL versions such as 3.6, and am fine with requiring 3.9+. |
FYI, #2484 fixes the lint-side failure with the Python AST not being considered valid under older Python versions by disabling the check |
I'll close this now -- we currently test on Python 3.9 and newer, with no plans to remove support for Python 3.9 any time soon! A |
Context: my /usr/bin/python3 is 3.6. I've also tried with 3.7 and 3.8. I've tried it with venvs and without.
There are a number of problems here:
$(PYTHON)
to /usr/bin/python3make lint
fails (assignment expressions)make sphinx
fails (no "from future import __annotations__
", missing "from future" statements, no str.removeprefix, no__class_getitem__
)pre-commit
rather than `$(PYTHON) -m pre_commitI would expect to be able to do all of the above using older Python versions. 3.8+ would be good, but 3.6+ would be better.
The text was updated successfully, but these errors were encountered: