RPM macros for PEP 517 Python packages
Go to file
Miro Hrončok a94281a5df %pyproject_install: Add --no-warn-script-location
Otherwise you see:

    WARNING: The scripts py.test and pytest are installed in '/builddir/build/BUILDROOT/pytest-4.6.4-1.fc31.x86_64/usr/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

And that is not relevant for us.
2019-07-02 13:58:24 +02:00
.gitignore initial import (#1717389) 2019-07-02 12:41:04 +02:00
LICENSE initial import (#1717389) 2019-07-02 12:41:04 +02:00
macros.pyproject %pyproject_install: Add --no-warn-script-location 2019-07-02 13:58:24 +02:00
pyproject-rpm-macros.rpmlintrc Add rpmlint RC file and URL 2019-07-02 13:06:11 +02:00
pyproject-rpm-macros.spec Add rpmlint RC file and URL 2019-07-02 13:06:11 +02:00
README.md README nitpick: The %pyproject_install macro installs from PWD 2019-07-02 13:56:49 +02:00
sources initial import (#1717389) 2019-07-02 12:41:04 +02:00

pyproject RPM macros

This is a provisional implementation of pyproject RPM macros for Fedora 30+.

These macros are useful for packaging Python projects that use the PEP 517 pyproject.toml file, which specifies the package's build dependencies (including the build system, such as setuptools, flit or poetry).

Usage

If your upstream sources include pyproject.toml and you want to use these macros, BuildRequire them:

BuildRequires: pyproject-rpm-macros

This will bring in python3-devel, so you don't need to require python3-devel explicitly.

Then, build a wheel in %build:

%build
%pyproject_wheel

And install the wheel in %install:

%install
%pyproject_install

Limitations

%pyproject_install currently installs all wheels in $PWD. We are working on a more explicit solution.

This macro changes shebang lines of every Python script in %{buildroot}%{_bindir} to #! %{__python3} %{py3_shbang_opt} (#! /usr/bin/python -s). We plan to preserve exisiting Python flags in shebangs, but the work is not yet finished.

Currently, the macros do not automatically generate BuildRequires. We are working on that as well.