Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
161 views
in Technique[技术] by (71.8m points)

python - Is PyPI case sensitive?

How does PyPI handle case sensitivity?

For example, this SO question documents PyPI refusing a new package foobar if FooBar already exists.

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

Alternatively:

$ pip install Django
Downloading/unpacking Django
  Downloading Django-1.7.tar.gz (7.5MB): 7.5MB downloaded

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/

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?

Is PyPI's position on case-sensitivity documented anywhere?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No, pip is case insensitive.

All comparisons of distribution names MUST be case insensitive, and MUST consider hyphens and underscores to be equivalent.

from PEP 426


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...