Repository: jordansissel/fpm

Issue #1771: Building Pint from PyPi to RPM wrongly resolves version
Created: 2021-03-12T15:46:19Z
Since Pint  version 1.10 fpm cannot build proper version of this project with distutils. It downloads proper version but in metadata it shows "version"=>"0.0.0". I guess it's not only with RPM, but only tried it with it.
I believe it's because Pint project changed distribution method to something called zest.releaser. They removed version from setup.py and moved it to different file which is used somehow in setup.cfg. I have no idea how it works and I'm not sure if this is solvable here.
I tried to use --version flag but it didn't changed the output package version. Maybe there is some different flag to set the output version so I could use it as a workaround?
{:timestamp=>"2021-03-12T11:18:32.169172+0000", :message=>"Setting workdir", :workdir=>"/tmp", :level=>:info}
{:timestamp=>"2021-03-12T11:18:32.172077+0000", :message=>"Trying to download", :package=>"Pint", :level=>:info}
{:timestamp=>"2021-03-12T11:18:32.550441+0000", :message=>"Collecting Pint", :level=>:info}
{:timestamp=>"2021-03-12T11:18:35.108201+0000", :message=>"  Downloading https://files.pythonhosted.org/packages/2b/d4/18becb51e9e242640010362b38dde187ecc0d5caeb0a689a2a60083b1ca3/Pint-0.16.1.tar.gz (261kB)", :level=>:info}
{:timestamp=>"2021-03-12T11:18:35.510602+0000", :message=>"  Saved ./Pint-0.16.1.tar.gz", :level=>:info}
{:timestamp=>"2021-03-12T11:18:40.601604+0000", :message=>"Successfully downloaded Pint", :level=>:info}
{:timestamp=>"2021-03-12T11:18:41.177734+0000", :message=>"fetching package metadata", :setup_cmd=>"env PYTHONPATH=/usr/local/share/gems/gems/fpm-1.11.0/lib/fpm/package python3.6 setup.py --command-packages=pyfpm get_metadata --output=/tmp/package-python-build-a21e16304cf8d6cbb1c124fa65d0e9643a13abd2114f3e2ccbe40cefdc11/metadata.json", :level=>:info}
{:timestamp=>"2021-03-12T11:18:41.435713+0000", :message=>"running get_metadata", :level=>:info}
{:timestamp=>"2021-03-12T11:18:41.459273+0000", :message=>"object output of get_metadata", :json=>{"name"=>"Pint", "version"=>"0.0.0", "author"=>"Hernan E. Grecco <hernan.grecco@gmail.com>", "description"=>"Physical quantities module", "license"=>"BSD", "url"=>"https://github.com/hgrecco/pint", "architecture"=>"all", "dependencies"=>["packaging"]}, :level=>:info}

Duplicate issue #1824: pip3 -> debian package being created with version 0.0.0 instead of the pip3 package version
Created: 2021-08-26T21:50:40Z
Running the following command that re-packages platformdirs 2.2.0 from the pip3 source and targeting debian results in the pip3 package being versioned as 0.0.0:
$ fpm --version
1.13.1
fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefix python3  --python-install-lib=/usr/lib/python3/dist-packages           --python-install-bin=/usr/bin -t deb --deb-no-default-config-files -v 2.2.0 platformdirs
Created package {:path=>"python3-platformdirs_2.2.0_all.deb"}
$ dpkg --contents python3-platformdirs_2.2.0_all.deb | grep egg
drwxrwxr-x 0/0               0 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/
-rw-rw-r-- 0/0              13 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/top_level.txt
-rw-rw-r-- 0/0            9172 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/PKG-INFO
-rw-rw-r-- 0/0             854 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/SOURCES.txt
-rw-rw-r-- 0/0             151 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/requires.txt
-rw-rw-r-- 0/0               1 2021-07-29 11:51 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/zip-safe
-rw-rw-r-- 0/0               1 2021-08-26 21:33 ./usr/lib/python3/dist-packages/platformdirs-0.0.0.egg-info/dependency_links.txt
Additionally the PKG-INFO file contains "Version: 0.0.0"
installing the fpm-created debian pkg, "pip3" list shows:
platformdirs (0.0.0)
However, when downloading the pip3 package directly
$ pip3 download platformdirs
$ unzip -l platformdirs-2.2.0-py3-none-any.whl | grep egg
Archive:  platformdirs-2.2.0-py3-none-any.whl
Length      Date    Time    Name

11051  2021-07-29 11:51   platformdirs/__init__.py
 1078  2021-07-29 11:51   platformdirs/__main__.py
 2830  2021-07-29 11:51   platformdirs/android.py
 4344  2021-07-29 11:51   platformdirs/api.py
 2156  2021-07-29 11:51   platformdirs/macos.py
    0  2021-07-29 11:51   platformdirs/py.typed
 4973  2021-07-29 11:51   platformdirs/unix.py
   80  2021-07-29 11:51   platformdirs/version.py
 5712  2021-07-29 11:51   platformdirs/windows.py
 1096  2021-07-29 11:51   platformdirs-2.2.0.dist-info/LICENSE.txt
 8162  2021-07-29 11:51   platformdirs-2.2.0.dist-info/METADATA
   92  2021-07-29 11:51   platformdirs-2.2.0.dist-info/WHEEL
   13  2021-07-29 11:51   platformdirs-2.2.0.dist-info/top_level.txt
    1  2021-07-29 11:51   platformdirs-2.2.0.dist-info/zip-safe
 1213  2021-07-29 11:51   platformdirs-2.2.0.dist-info/RECORD


42801                     15 files

In extracting the whl, the METADATA file contains "Version: 2.2.0"
So I'm not sure where fpm is inferring the "0.0.0" version from since it breaks anything dependent on platformdirs > 0.0.0 (such as pylint).

Closing comment (2021-11-05T15:47:18Z): this Issue seems to be duplicate of #1771