PyPI 是否区分大小写? [英] Is PyPI case sensitive?
问题描述
PyPI 如何处理区分大小写?
How does PyPI handle case sensitivity?
例如,this SO question 记录了 PyPI 拒绝新的如果 FooBar
已经存在,则打包 foobar
.
For example, this SO question documents PyPI refusing a new package foobar
if FooBar
already exists.
针对 pypi.python.org 运行 pip
似乎转换为包的规范案例:
Running pip
against pypi.python.org seems to convert to the canonical case for a package:
$ pip install django
Downloading/unpacking django
Downloading Django-1.7.tar.gz (7.5MB): 7.5MB downloaded
或者:
$ pip install Django
Downloading/unpacking Django
Downloading Django-1.7.tar.gz (7.5MB): 7.5MB downloaded
但是,在我的 virtualenv 中,似乎只有一些文件属于规范案例:
However, only some files seem to be in the canonical case in my virtualenv:
$ ls ~/pyenvs/test_venv/lib/python2.7/site-packages/ | grep -i django
django/
Django-1.7-py2.7.egg-info/
XML-RPC API 期望什么?我可以总是假设 http://pypi.python.org/simple/foo 和
What does the XML-RPC API expect? Can I always assume that http://pypi.python.org/simple/foo and http://pypi.python.org/simple/FoO will both return HTTP 200?
PyPI 在区分大小写方面的立场是否记录在任何地方?
Is PyPI's position on case-sensitivity documented anywhere?
推荐答案
不,pip 不区分大小写.
No, pip is case insensitive.
分发名称的所有比较必须不区分大小写,并且必须将连字符和下划线视为等效.
All comparisons of distribution names MUST be case insensitive, and MUST consider hyphens and underscores to be equivalent.
来自 PEP 426
这篇关于PyPI 是否区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!