Blob Blame History Raw
# Tests are disabled by default because they require network access.
# Try: fedpkg mockbuild --with tests --enable-network
%bcond tests 0

Name:           python-virtualenv-api
Version:        2.1.18
Release:        %autorelease
Summary:        An API for virtualenv/pip

License:        BSD-2-Clause
# The GitHub tarball contains tests and LICENSE absent from the PyPI sdist.
Source:         %{url}/archive/%{version}/virtualenv-api-%{version}.tar.gz

# Fix --system-site-packages tests
Patch:          %{url}/pull/52.patch
# Remove search test cases
Patch:          %{url}/pull/48.patch
# Always use the current interpreter for test_python_version
Patch:          %{url}/pull/56.patch
# Taken together, the above three patches fix:
#   2.1.18: pytest is failing in four units

BuildArch:      noarch

BuildRequires:  python3-devel

# Upstream does not name pip and virtualenv as dependencies, but they should
# be. See also:
#   Add virtualenv package to dependencies list
BuildRequires:  /usr/bin/virtualenv
BuildRequires:  /usr/bin/pip

%global common_description %{expand:
virtualenv is a tool to create isolated Python environments. Unfortunately, it
does not expose a native Python API. This package aims to provide an API in the
form of a wrapper around virtualenv.

It can be used to create and delete environments and perform package management
inside the environment.}

%description %{common_description}

%package -n     python3-virtualenv-api
Summary:        An API for virtualenv/pip

Requires:       /usr/bin/virtualenv
Requires:       /usr/bin/pip

%description -n python3-virtualenv-api %{common_description}

%autosetup -n virtualenv-api-%{version} -p1



%pyproject_save_files virtualenvapi

%if %{with tests}
PYTHONPATH='%{buildroot}%{python3_sitelib}' \
    '%{python3}' -m unittest -v

%files -n python3-virtualenv-api -f %{pyproject_files}
%doc README.rst