Skip to content
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

Yum broken when RPM from this requirement with underscores. #43

Closed
mosquito opened this issue Sep 21, 2016 · 5 comments
Closed

Yum broken when RPM from this requirement with underscores. #43

mosquito opened this issue Sep 21, 2016 · 5 comments

Comments

@mosquito
Copy link

Please never use underscores in python-packages names.

PEP-008 conatins

Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

We have a really problem. When our build system convert all dependencies to RPM (using FPM) yum is broken. We are can't use this package in our projects.

@rutsky
Copy link
Member

rutsky commented Oct 19, 2016

@mosquito thanks for spotting this, I didn't know that part of PEP8.

This is indeed contradict with PEP8 advices, but this is how (at least some) packages in aiohttp_* already named (e.g. aiohttp_admin, aiohttp_session).
@asvetlov we can raise discussion about renaming them or distributing both with underscore and hyphen versions (some of aiohttp packages indeed called with hyphen: aiohttp-riak, aiohttp-jrpc).

We are not only one who used underscore in packages names and underscores are disallowed in package names in RedHat based and Debian based distros, so FPM at least tries to replace underscores with hyphen: jordansissel/fpm#65 , but looks like there are bugs in FPM with that: jordansissel/fpm#1201 , jordansissel/fpm#1016

Bottom line: at this point this is a bug of FPM (so in order to use aiohttp_cors with FPM you need to fix FPM), but also we should consider renaming aiohttp_* to aiohttp-* to line up with PEP8.

@mosquito
Copy link
Author

Actually you should see how PyPi and PIP works. When you try to fetch packages which contains underscores in names PYPI will return redirect.

$ curl -I 'https://pypi.python.org/simple/aiohttp_cors/'
HTTP/1.1 301 Moved Permanently
Location: /simple/aiohttp-cors
...
$ curl -I 'https://pypi.python.org/simple/aiohttp-cors/'
HTTP/1.1 200 OK
Server: nginx/1.10.1
Content-Type: text/html; charset=utf-8
Content-Length: 1864
Date: Thu, 20 Oct 2016 10:22:42 GMT
...

But PyPi XML-RPC is "underscore sensitive". And you can't find this by pip search aiohttp-cors

When I developed my PyPI server this caused some difficulties (have to search twice).

@rutsky
Copy link
Member

rutsky commented Oct 20, 2016

@mosquito if PyPI/pip/setptools make such conversions, does it mean that we can just rename packages on PyPI to have hyphen instead of underscore, and nothing will break?

Does it mean, that currently all aiohttp_cors users can specify in their dependencies that they require aiohttp-cors and it will still download aiohttp_cors and everything will work?

@asvetlov
Copy link
Member

Let's rename the package -- looks like it is safe and backward compatible operation

@asvetlov
Copy link
Member

Fixed by c34202e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants