热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

SupportedCPythonversions,installationmethods?

Firstofall,whatversionsofPythonaresupported?

First of all, what versions of Python are supported?

1
pre-commit

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,

1
pip

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 (

1
http://

scheme, fetch of a script from your website instead of from a curated package index) and the extra customer installer script

1
install-local.py

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




1
curl

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

1
pre-commit

should always be installed in the unconventional (in my view, unattractive for the reasons stated) way. Also,

1
npm

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

1
pip

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.


   



推荐阅读
author-avatar
三砖先生
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有