Compare commits

..

15 Commits
i9ce ... epel9

Author SHA1 Message Date
Miro Hrončok 50c53d7319 CI: Add Python 3.12
2 months ago
Miro Hrončok 2ecd9f5d91 Amend a fix for --download with old Pythons not to break --seeder pip with new Pythons
2 months ago
Lumir Balhar 37281f6553 Prevent command injection by quoting template strings in activation scripts
3 months ago
Miro Hrončok d0c252f259 Allow to use the bootstrap bcond to disable tests
3 months ago
Benjamin A. Beasley ca9d11073f Backport a builtin interpreter discovery fix
3 months ago
Karolina Surma aa42e3cbdc Update Python 3.13 compat patch: 3.13.0a6 renamed pathmod to parser
3 months ago
Lumir Balhar 52abb4851f Fix compatibility with Python 3.13
3 months ago
Miro Hrončok 2fba530738 CI: Test virtualenv with --download
10 months ago
Miro Hrončok 5cc394ff5c When getting wheels for /usr/bin/python3 interpreter, look for them in proper directories
10 months ago
Miro Hrončok 26bd9d7b9e Convert to %autorelease and %autochangelog
10 months ago
Miro Hrončok 88d3b2809d EPEL 9 CI: Add test for Python 3.11
1 year ago
Miro Hrončok 228905dc5b EPEL 9 only: Add RPM Requires needed for Python 3.12
1 year ago
Miro Hrončok 7fadf9a5e4 Backports from 20.23.0 (bugfix + Python 3.12 behavior change)
1 year ago
Miro Hrončok b84b972e53 Update to 20.21.1
1 year ago
Lumir Balhar f9a19a9b30 Update to 20.21.0 (rhbz#2177543)
1 year ago

5
.gitignore vendored

@ -1 +1,4 @@
SOURCES/virtualenv-20.21.1.tar.gz
/virtualenv-*.tar.gz
/virtualenv-*/
/results_python-virtualenv/
*.rpm

@ -1 +0,0 @@
ee10bef35332c6d7a9c9c82e11c5e5d081ddbdbd SOURCES/virtualenv-20.21.1.tar.gz

@ -1,227 +1,8 @@
## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 14;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%bcond bootstrap 0
%bcond tests %{without bootstrap}
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
# Quote template strings in activation scripts
# to prevent possible command injection.
# https://github.com/pypa/virtualenv/issues/2768
# Backported from 20.26.6
Patch7: prevent_command_injection.patch
BuildArch: noarch
BuildRequires: python3-devel
%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}
# 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
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
## START: Generated by rpmautospec
* Thu Dec 05 2024 Miro Hrončok <miro@hroncok.cz> - 20.21.1-14
- CI: Add Python 3.12
* Thu Dec 05 2024 Miro Hrončok <miro@hroncok.cz> - 20.21.1-13
- Amend a fix for --download with old Pythons not to break --seeder pip
with new Pythons
* Tue Nov 26 2024 Lumir Balhar <lbalhar@redhat.com> - 20.21.1-12
- Prevent command injection by quoting template strings in activation
scripts
- Fixes: rhbz#2328747
* Tue Nov 26 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 20.21.1-10
- Backport a builtin interpreter discovery fix
* Tue Nov 26 2024 Karolina Surma <ksurma@redhat.com> - 20.21.1-9
- Update Python 3.13 compat patch: 3.13.0a6 renamed pathmod to parser
* Tue Nov 26 2024 Lumir Balhar <lbalhar@redhat.com> - 20.21.1-8
- Fix compatibility with Python 3.13
* Fri Apr 05 2024 Miro Hrončok <miro@hroncok.cz> - 20.21.1-6
- When getting wheels for /usr/bin/python3 interpreter, look for them in
proper directories
- Fixes: rhbz#2272958
* Wed Jan 03 2024 Miro Hrončok <mhroncok@redhat.com> - 20.21.1-1
- Update to 20.21.1
- Backport from 20.23.0: Don't install setuptools and wheel to Python 3.12+ environments
- Add RPM Requires needed for Python 3.12
* Thu Aug 24 2023 Sergey Cherevko <s.cherevko@msvsphere.ru> - 20.20.0-2
- Rebuilt for MSVSphere 9.2
* Thu Jul 27 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 20.20.0-2
- Remove workarounds for old hatchling
@ -607,5 +388,3 @@ unset PYTHONHOME envioronment variable -- first step towards fixing the PYTHONHO
* Tue Aug 26 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1-1
- Initial Version
## END: Generated by rpmautospec

@ -0,0 +1,180 @@
%bcond bootstrap 0
%bcond tests %{without bootstrap}
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
# Quote template strings in activation scripts
# to prevent possible command injection.
# https://github.com/pypa/virtualenv/issues/2768
# Backported from 20.26.6
Patch7: prevent_command_injection.patch
BuildArch: noarch
BuildRequires: python3-devel
%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}
# 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
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

@ -0,0 +1 @@
SHA512 (virtualenv-20.21.1.tar.gz) = 5f5c4ce677feffe24b87ff4b3837e6f7cda6a5017eea122ac089be2066b74c7eaf452dbc0ab7723e9433716aeca13e6f85ea23d02fb28a83d76df5db0068572a

@ -0,0 +1,57 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
repositories:
- repo: "https://src.fedoraproject.org/tests/python.git"
dest: "python"
tests:
- smoke39:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv ./venv.sh
- smoke39nd:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv-no-download ./venv.sh
- smoke39d:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv-download TOX=false ./venv.sh
- smoke39sp:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv-seeder-pip ./venv.sh
- smoke311:
dir: python/smoke
run: VERSION=3.11 METHOD=virtualenv ./venv.sh
- smoke311d:
dir: python/smoke
run: VERSION=3.11 METHOD=virtualenv-download TOX=false ./venv.sh
- smoke311nd:
dir: python/smoke
run: VERSION=3.11 METHOD=virtualenv-no-download ./venv.sh
- smoke311sp:
dir: python/smoke
run: VERSION=3.11 METHOD=virtualenv-seeder-pip ./venv.sh
- smoke312:
dir: python/smoke
run: VERSION=3.12 METHOD=virtualenv ./venv.sh
- smoke312d:
dir: python/smoke
run: VERSION=3.12 METHOD=virtualenv-download TOX=false ./venv.sh
- smoke312nd:
dir: python/smoke
run: VERSION=3.12 METHOD=virtualenv-no-download ./venv.sh
- smoke312sp:
dir: python/smoke
run: VERSION=3.12 METHOD=virtualenv-seeder-pip ./venv.sh
- rpm_qa:
run: rpm -qa | sort
required_packages:
- gcc
- virtualenv
- python3.9
- python3.11-devel
- python3.12-devel
- python3-devel
- python3-tox
- rpm
Loading…
Cancel
Save