No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Macros to help in Python packaing using Virtualenv

This is a small set of RPM macros to help in packaging Python applications along with virtualenv. This project is following the ideas from

The available macros will be updated regularly, right now we have very limit macros.

Example usage

# Use our interpreter for brp-python-bytecompile script
%global __python /opt/venvs/%{name}/bin/python3

%setup -q

%{__pyvenvpip3} install --upgrade pip

%{__pyvenvpip3} install --upgrade pip


In Fedora 29, I also had to add the following to the spec file.

# Fedora 27 and newer, no need to build the debug package
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
%global debug_package %{nil}

We really don't need the debug package here, as the wheels are already compiled.

You can find more examples in the examples directory in the git repository.

Installing the executable(s)

Remember to install all of the executable(s) installed under virtualenv into /usr/bin/ or similar directory by creating symlinks.

Available macros

The following are the available macros/variables:


This points to the directory where the virtualenv has been created. Right now the default path is /opt/venvs/projectname.


The Python interpreter installed in the virtualenv.


The pip3 tool installed in the virtualenv.


This is the macro which creates the actual virtualenv. We have to call it twice in both %build and %installsection, because rpmbuild tool deletes the buildroot after %build and recreates it in %install section.


Use this macro to build the wheel for the project we are packaging.


Use this macro install the wheel we built into the RPM buildroot.

License: GPLv3+