作者:三砖先生 | 来源:互联网 | 2023-07-02 18:33
First of all, what versions of Python are supported?
is being tested against a bunch of Python versions here. Assuming that declares the supported Python versions, any reason to keep supporting Python 2.6?
In current Python 2.7.z and 3.y,
should be available. This brings me to my main question.
The ‘Non-Administrative Installation’ and ‘System Level Install’ sections in the manual are not conventional as they stand. Why not these instructions instead:
1 2 3
| sh
python -m 'ensurepip' --user
python -m 'pip' --user 'pre-commit' |
The current instructions could be construed as a security risk (
scheme, fetch of a script from your website instead of from a curated package index) and the extra customer installer script
requires maintenance.
该提问来源于开源项目:pre-commit/pre-commit
Okay, interesting note about the user site-packages dir conflicting with the Python path. I hope you're fine with discussing this further to at least achieve a common understanding.
Based on my current knowledge, I think adding the user site-packages dir to the Python path is a fine design choice for non-isolated virtual environments. Why would it be a problem? Virtualenvs are a hack actually. But most importantly, I could not reproduce this issue in an isolated venv, didn't test it in a non-isolated one.
1 2 3 4
| sh
python -m venv /tmp/myvenv
. /tmp/myvenv/bin/activate
(myvenv) python -c 'from sys import path; print(path)' |
1 2
| python
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-linux', '/usr/lib/python3.5/lib-dynload', '/tmp/myvenv/lib/python3.5/site-packages'] |
Really, I think the Node.js shop argument is not very good. I do not see why it would be more difficult or unattractive to issue one or two very plain command line statements vs. one (slightly more complex). Also, the
dependency of the current instructions won't be available on Windows by default and needs to be installed on the CI host.
It's still okay if you think asking to install one or two OS packages on Debian makes things too difficult, but didn't I propose to reserve the special instructions (meaning, even if just the current ones) for Debian? At least, that would not suggest to users that
should always be installed in the unconventional (in my view, unattractive for the reasons stated) way. Also,
as known by the Node.js peeps works in the same way, also installing deps under the user home directory. The same is true for many other language impl dep managers. And on a final note, I'd say
itself is fairly well-known by anyone who ever did anything with CPython, even for some end-user use cases.
I agree that it's attractive to just fire off a script and that sorts out everything for installation. The problem is, this fails in a bare Alpine Linux Docker container, i.e. a common CI host, with cryptic error messages. That's related to #396, and not a problem per se. What I am getting at is that the benefits of keeping your script/custom installation commands that you feel do not bear out in practice for me.