#1 Use sdist from PyPI to build the package to correct version metadata
Closed 5 months ago by churchyard. Opened a year ago by churchyard.
rpms/ churchyard/python-lacrosse pypi  into  rawhide

file modified
+2
@@ -1,1 +1,3 @@ 

  /pylacrosse-0.4.tar.gz

+ /AUTHORS

+ /COPYING

file modified
+15 -5
@@ -3,12 +3,16 @@ 

  

  Name:           python-%{pkg_name}

  Version:        0.4

- Release:        9%{?dist}

+ Release:        10%{?dist}

  Summary:        LaCrosse Python sensor library

  

  License:        LGPLv2+

  URL:            http://github.com/hthiery/python-lacrosse

- Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz

+ # Cannot use a git tarball as a Source, see https://github.com/hthiery/python-lacrosse/issues/11

+ Source0:        %{pypi_source %{pypi_name}}

+ # The following files are missing from the sdist

+ Source1:        https://github.com/hthiery/python-lacrosse/raw/%{version}/AUTHORS

+ Source2:        https://github.com/hthiery/python-lacrosse/raw/%{version}/COPYING

  BuildArch:      noarch

  

  %description
@@ -29,7 +33,8 @@ 

  Python libray to work with the Jeelink USB RF adapter.

  

  %prep

- %autosetup -n %{name}-%{version}

+ %autosetup -n %{pypi_name}-%{version}

+ cp -p %{SOURCE1} %{SOURCE2} .

  rm -rf %{pypi_name}.egg-info

  

  %build
@@ -46,11 +51,16 @@ 

  %license COPYING

  %{_bindir}/pylacrosse

  %{python3_sitelib}/%{pypi_name}/

- # Unversioned egg-info: https://github.com/hthiery/python-lacrosse/issues/11

- %{python3_sitelib}/%{pypi_name}*py%{python3_version}.egg-info/

+ %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/

  %exclude %{python3_sitelib}/tests

  

  %changelog

+ * Tue Jan 24 2023 Miro Hrončok <mhroncok@redhat.com> - 0.4-10

+ - Use sdist from PyPI to build the package to correct version metadata

+ - This makes the package provide python3dist(pylacrosse) = 0.4 instead of python3dist(pylacrosse) = unknown

+ - This makes the package build with packaging 22+

+ 

+ 

  * Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-9

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

  

file modified
+3 -1
@@ -1,1 +1,3 @@ 

- SHA512 (pylacrosse-0.4.tar.gz) = ef60c69ba288e11827fac864ac6e8f8b0ef32ecf06168e89cc1ddac81c84e57909d27260165c12106001c6bf5a5e9f2c0c98803a739b5545931b723002890294

+ SHA512 (pylacrosse-0.4.tar.gz) = 3b638aa8569fae6056d4d6d872d864e5b6215fbe2e6f11ef50e2cdc630aa173ec9beff3705a144857242490b13147b8604fb4b54813ae35f29443bd62d117d8a

+ SHA512 (AUTHORS) = 1793b06b12d99d7789753382310046fb74e8dc55f9fb4339a209be412f6a60daa3c7bae93b4febd4d67812143e40fc4103756105c8011901a3543be24979dfa0

+ SHA512 (COPYING) = eb774e355f5d2c2cc2e314d36184055a4c4fb03cb87640c3f3eb78fb70675e452c213470a624c4cf51daa870da9160d07c60e9d1b60ca2ec37fb921e3bb8c2a3

The upstream setup.py tries to:

  • use git to determine version (but git is missing as well as git metadata)
  • use a file available from sdist only to get the version (but git archive was used)

Hence,t he version was "unknown". This is not even incorrect,
but since packaging 22 also considered invalid and the package would FTBFS without the fix.

Wouldn't constructing pylacrosse/version.py manually be better than supplementing files from the sdist like this?

That is obviously also an option. I don't know if better or not. I went with the PyPI tarball option and only realized the fils were missing along the way. Either way, some files are missing (version.py or AUTHORS/COPYING).

The easiest way is to sed-replace unknown with %{version} but that might break later if the default is changed or if the logic moves somewhere else :/

I will now wait for @fab for their opinion. As I am afraid I won't get any, I decided not to rework this in 3 different ways. This package will FTBFS eventually if not fixed.

Looks like that the URL should point somewhere else than the AUTHORS file.

The AUTHORS file was renamed a long the way. Looks like that an update of the %doc section is needed.

Typo: mussing -> missing

Upstream is not every active, thus I'm fine with that solution.

On it. Thanks for responding!

rebased onto 02e4de6

a year ago

Amended this way to fix bad link (copy pasta error) and the typo:

diff --git a/python-lacrosse.spec b/python-lacrosse.spec
index 15b45cc..7e8077b 100644
--- a/python-lacrosse.spec
+++ b/python-lacrosse.spec
@@ -8,9 +8,9 @@ Summary:        LaCrosse Python sensor library

 License:        LGPLv2+
 URL:            http://github.com/hthiery/python-lacrosse
-# Cannot use a git tarball as a Source, see https://github.com/hthiery/python-lacrosse/raw/0.4/AUTHORS
+# Cannot use a git tarball as a Source, see https://github.com/hthiery/python-lacrosse/issues/11
 Source0:        %{pypi_source %{pypi_name}}
-# The following files are mussing from the sdist
+# The following files are missing from the sdist
 Source1:        https://github.com/hthiery/python-lacrosse/raw/%{version}/AUTHORS
 Source2:        https://github.com/hthiery/python-lacrosse/raw/%{version}/COPYING
 BuildArch:      noarch

The AUTHORS file was renamed a long the way. Looks like that an update of the %doc section is needed.

I don't understand this comment, sorry. In the packaged version as well as in upstream master branch, AUTHORS is named AUTHORS. This is used the Source definition (and was downloaded by spectool -g) and in %doc as well.

Upstream is not every active, thus I'm fine with that solution.

Which solution do you refer to as "that solution"? There are 3 solutions:

  1. use sdist and list AUTHORS and COPYING as separate sources (currently pushed here)
  2. construct pylacrosse/version.py manually
  3. sed unknown to %{version}

Let me know which solution you prefer and I'll do that.

@fab Let me know which solution you prefer and I'll do that.

Pull-Request has been closed by churchyard

5 months ago