You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-virtualenv/python-virtualenv.spec

174 lines
6.0 KiB

Name: python-virtualenv
Version: 20.21.1
Release: %autorelease
Summary: Tool to create isolated Python environments
License: MIT
URL: http://pypi.python.org/pypi/virtualenv
Source0: %{pypi_source virtualenv}
# Add /usr/share/python-wheels to extra_search_dir
Patch1: rpm-wheels.patch
## Backports from virtualenv 20.22+
## We cannot update yet as we want to preserve support for Python 2.7 and 3.6 environments
## Patches in https://github.com/fedora-python/virtualenv/commits/20.21.x
# (20.23.0) prevent PermissionError when using venv creator on some systems
# https://github.com/pypa/virtualenv/pull/2543
Patch2: prevent-PermissionError-when-using-venv-creator-on-s.patch
# (20.23.0) 3.12 support and no setuptools/wheel on 3.12+
# freezgun and typing changes stripped
# files missing in sdist removed from the path file
# https://github.com/pypa/virtualenv/pull/2558
Patch3: 3.12-support-and-no-setuptools-wheel-on-3.12-2558.patch
# Fix compatibility with Python 3.13
# https://github.com/pypa/virtualenv/pull/2673
# https://github.com/pypa/virtualenv/pull/2702
Patch5: py3.13.patch
# Allow builtin interpreter discovery to find specific Python versions given a
# general spec
# https://github.com/pypa/virtualenv/pull/2709
# which contains regressions (mostly but perhaps not exclusively on Windows)
# that are fixed by:
# Fix PATH-based Python discovery on Windows
# https://github.com/pypa/virtualenv/pull/2712
#
# Backported to 20.21.1.
Patch6: prs-2709-and-2712.patch
BuildArch: noarch
BuildRequires: python3-devel
%bcond_without tests
%if %{with tests}
BuildRequires: fish
BuildRequires: tcsh
BuildRequires: gcc
BuildRequires: python3-flaky
BuildRequires: python3-packaging
BuildRequires: python3-pytest
BuildRequires: python3-pytest-mock
BuildRequires: python3-pytest-randomly
BuildRequires: python3-pytest-timeout
%endif
# RPM installed wheels
BuildRequires: %{python_wheel_pkg_prefix}-pip-wheel
BuildRequires: %{python_wheel_pkg_prefix}-setuptools-wheel
BuildRequires: %{python_wheel_pkg_prefix}-wheel-wheel
%description
virtualenv is a tool to create isolated Python environments. virtualenv
is a successor to workingenv, and an extension of virtual-python. It is
written by Ian Bicking, and sponsored by the Open Planning Project. It is
licensed under an MIT-style permissive license.
%package -n python3-virtualenv
Summary: Tool to create isolated Python environments
# This virtualenv requires the "venv" install scheme on Pythons
# where we patch "posix_prefix".
# Explicitly conflict with Pythons where we don't have it yet.
Conflicts: python3.11 < 3.11.0~a2
%if 0%{?fedora} >= 36
Conflicts: python3.10 < 3.10.0-3
%endif
Obsoletes: python3-virtualenv-python26 < 16.6
%{?python_provide:%python_provide python3-virtualenv}
# Provide "virtualenv" for convenience
Provides: virtualenv = %{version}-%{release}
# RPM installed wheels
Requires: %{python_wheel_pkg_prefix}-pip-wheel
Requires: %{python_wheel_pkg_prefix}-setuptools-wheel
Requires: %{python_wheel_pkg_prefix}-wheel-wheel
# For Python 3.11
Requires: (python3.11-pip-wheel if python3.11)
Requires: (python3.11-setuptools-wheel if python3.11)
Requires: (python3.11-wheel-wheel if python3.11)
# For Python 3.12
# (setuptools and wheel is not installed by default, but still possible with --wheel/setuptools=bundle)
Requires: (python3.12-pip-wheel if python3.12)
Requires: (python3.12-setuptools-wheel if python3.12)
Requires: (python3.12-wheel-wheel if python3.12)
%description -n python3-virtualenv
virtualenv is a tool to create isolated Python environments. virtualenv
is a successor to workingenv, and an extension of virtual-python. It is
written by Ian Bicking, and sponsored by the Open Planning Project. It is
licensed under an MIT-style permissive license
%prep
%autosetup -p1 -n virtualenv-%{version}
4 years ago
# Remove the wheels provided by RPM packages
rm src/virtualenv/seed/wheels/embed/pip-*
rm src/virtualenv/seed/wheels/embed/setuptools-*
rm src/virtualenv/seed/wheels/embed/wheel-*
test ! -f src/virtualenv/seed/embed/wheels/*.whl
# Relax the upper bounds of some dependencies to their known available versions in EL 9
# We run tests and CI to verify nothing broke
sed -i -e 's/distlib<1,>=0.3.6/distlib<1,>=0.3.2/' \
-e 's/filelock<4,>=3.4.1/filelock<4,>=3.3.1/' \
-e 's/platformdirs<4,>=2.4/platformdirs<4,>=2.3/' \
pyproject.toml
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files virtualenv
# EPEL 9: old version of setuptools_scm produces files incompatible with
# assumptions in virtualenv code, we append the expected attributes:
echo '__version__, __version_tuple__ = version, version_tuple' >> %{buildroot}%{python3_sitelib}/virtualenv/version.py
%if %{with tests}
%check
# Skip tests which requires internet or some extra dependencies
# Requires internet:
# - test_download_*
# - test_can_build_c_extensions (on Python 3.12+)
# Uses disabled functionalities around bundled wheels:
# - test_wheel_*
# - test_seed_link_via_app_data
# - test_base_bootstrap_via_pip_invoke
# - test_acquire.py (whole file)
# - test_bundle.py (whole file)
# Uses disabled functionalities around automatic updates:
# - test_periodic_update.py (whole file)
# Requires Python 2:
# - test_py_pyc_missing
4 years ago
PIP_CERT=/etc/pki/tls/certs/ca-bundle.crt \
%pytest -vv -k "not test_bundle and \
not test_acquire and \
not test_periodic_update and \
not test_wheel_ and \
not test_download_ and \
%if v"%{python3_version}" >= v"3.12"
not test_can_build_c_extensions and \
%endif
not test_base_bootstrap_via_pip_invoke and \
not test_seed_link_via_app_data and \
not test_py_pyc_missing"
%endif
%files -n python3-virtualenv -f %{pyproject_files}
%doc README.md
%{_bindir}/virtualenv
%changelog
%autochangelog