On 17 August 2017 at 23:02, Richard Shaw <hobbes1...@gmail.com> wrote:
> I'm not a python developer but I do maintain several packages that use python 
> and I've been unable to find clear documentation / guidelines for Fedora on 
> how to package software that requires pip...
>
> The closest I've found is:
> https://fedoraproject.org/wiki/PythonWheels
>
> Traditionally building a package should not require internet access as 
> everything needed to build the package is supposed to be in the source RPM. 
> It looks like with the increase in use of things like GO, nodejs, and now 
> pip, that's no longer appears to be really practical.

This is mixing up a few different points:

1. Python level requirements can be translated to RPM level "Requires:
pythonXYdist(PyPI-package-name)" requirements if the dependency is
packaged in Fedora (where "XY" = the target Python version)
2. pyp2rpm (see https://pypi.python.org/pypi/pyp2rpm) will attempt to
generate appropriate dependency entries for you
3. Application software that is designed to be deployed as a
standalone Python virtual environment can still be packaged as a
(non-Fedora) SRPM that doesn't require internet access during the
build phase by doing the following:

- use pip download to get all the relevant source packages
- add the project *and its dependencies* to the SRPM as SourceN
entries (alternatively, bundle the deps into a single archive for ease
of extraction)
- create the virtual environment in %build, install the project and
its dependencies, and package *that* as the RPM

We're actually having some occasional discussions about how we might
be able to incorporate that last approach into the official Fedora
guidelines for cases where a Python level dependency *isn't* shared,
and is instead specific to that application.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org

Reply via email to