jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.09k stars 1.06k forks source link

[BUG?] rpm creation does not handle underscores in python packages properly #1201

Open sobolevn opened 7 years ago

sobolevn commented 7 years ago

I have faced this issue when working on https://github.com/dbcli/pgcli/issues/70#issuecomment-252417251

I have this setup.py file. Take a note that prompt_toolkit is spelled with _.

Now, when creating a rpm package for all the pip deps, everything goes fine:

[root@30722cfb4b5b repo]# fpm -s python -t rpm --python-pip pip prompt-toolkit Created package {:path=>"python-prompt_toolkit-1.0.7-1.noarch.rpm"} [root@30722cfb4b5b repo]# yum install python-prompt-toolkit

Redirecting to '/usr/bin/dnf install python-prompt-toolkit' (see 'man yum2dnf')

My Awesome Repo 3.0 MB/s | 8.1 kB 00:00
No package python-prompt-toolkit available. Error: Unable to find a match. [root@30722cfb4b5b repo]# yum install python-prompt_toolkit Redirecting to '/usr/bin/dnf install python-prompt_toolkit' (see 'man yum2dnf')

My Awesome Repo 4.0 MB/s | 8.1 kB 00:00
Dependencies resolved.

When checking for deps, that's what happens:

[root@30722cfb4b5b repo]# rpm -qRp python-pgcli-1.2.0-1.noarch.rpm ... python-prompt-toolkit >= 1.0.0 python-prompt-toolkit < 1.1.0 ...

When trying to install all fails:

[root@30722cfb4b5b repo]# yum install -y python-pgcli Redirecting to '/usr/bin/dnf install -y python-pgcli' (see 'man yum2dnf')

My Awesome Repo 3.3 MB/s | 8.1 kB 00:00
Error: nothing provides python-prompt-toolkit >= 1.0.0 needed by python-pgcli-1.2.0-1.noarch (try to add '--allowerasing' to command line to replace conflicting packages)

I have tried almost everything. Specifying -n and other options (even -e with sed). The only workaround I found is to remove auto-deps with --no-auto-deps and specify them manually.

Maybe related https://github.com/jordansissel/fpm/issues/65

rutsky commented 7 years ago

Maybe related https://github.com/jordansissel/fpm/issues/1016

jhermann commented 7 years ago

PyPI canonizes package names to use '-', if RPM packages use the non-canon name, that is somewhat broken (e.g. Debian uses python-prompt-toolkit). Also make sure you use a current pip.

Glandos commented 5 years ago

See pypa/setuptools#1597

Glandos commented 5 years ago

See https://github.com/jordansissel/fpm/issues/1016#issuecomment-440581634 for a possible workaround.