fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
123 stars 39 forks source link

Use the new %pypi_source macro for Source URL #172

Closed hroncok closed 4 years ago

hroncok commented 6 years ago

See: https://pagure.io/packaging-committee/issue/759#comment-517444

Example:

%global pypi_name Jinja2

Name:           python-%{pypi_name}
Version:        2.8
...

Source0:        %pypi_source
gordonmessmer commented 4 years ago

Is that just a matter of replacing the Source0 line in some of the templates, or are there conditions under which %pypi_source wouldn't be correct for some packages on a platform that provides that macro?

It seems like we might want to check the URL extracted in pypi_metadata_extension to see if it ends in tar.gz and provide the macro alone if it matches, and the macro with arguments if it doesn't.

hroncok commented 4 years ago

Is that just a matter of replacing the Source0 line in some of the templates

I think so, yes.

Also, we should only do this if it actually matches a pattern. That is not always true for packages with non-canonical names (such as dashes vs. underscores).

gordonmessmer commented 4 years ago

Resolved in v3.3.4