File python3-virtualenv.spec of Package python3-virtualenv.36442

#
# spec file for package python3-virtualenv
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define skip_python2 1
Name:           python3-virtualenv
Version:        20.17.1
Release:        0
Summary:        Virtual Python Environment builder
License:        MIT
Group:          Development/Languages/Python
URL:            http://www.virtualenv.org/
Source:         https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
# PATCH-FIX-SLE revert-dependency-version-bump.patch bsc#1232072
Patch1:         revert-dependency-version-bump.patch
# PATCH-FIX-UPSTREAM CVE-2024-53899.patch gh#pypa/virtualenv#2771, bsc#1233706
Patch2:         CVE-2024-53899.patch
BuildRequires:  %{python_module mock}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module setuptools_scm}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module platformdirs}
BuildRequires:  %{python_module importlib-metadata}
BuildRequires:  %{python_module importlib_resources}
BuildRequires:  %{python_module filelock}
BuildRequires:  %{python_module distlib}
BuildRequires:  %{python_module flaky}
BuildRequires:  %{python_module packaging}
BuildRequires:  %{python_module pytest-timeout}
BuildRequires:  %{python_module pytest-mock}
BuildRequires:  python-rpm-macros
BuildRequires:  fdupes
Requires:       python3
Requires:       python3-setuptools
Requires:       python3-distlib
Requires:       python3-filelock
Requires:       python3-platformdirs
Requires:       python3-importlib-metadata
Requires:       python3-importlib_resources
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch
%python_subpackages

%description
virtualenv is a tool to create isolated Python environments.
The basic problem being addressed is one of dependencies and versions, and
indirectly permissions. Imagine you have an application that needs version 1
of LibFoo, but another application requires version 2.

Or more generally, what if you want to install an application and leave it be?
If an application works, any change in its libraries or the versions of those
libraries can break the application.

Also, what if you cant install packages into the global site-packages
directory? For instance, on a shared host.

In all these cases, virtualenv can help you. It creates an environment that
has its own installation directories, that doesnt share libraries with other
virtualenv environments (and optionally doesnt use the globally installed
libraries either).

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

# Dependencies on all those shells are too cumbersome.
rm -r tests/unit/activation

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/virtualenv

%check
export LANG="en_US.UTF8"
export PIP_CERT="%{_sysconfdir}/ssl/ca-bundle.pem"
export PYTHONPATH=$PWD/src
# online tests downloads from pypi
donttest="test_seed_link_via_app_data"
# gh#pypa/virtualenv!2431
donttest+=" or test_py_pyc_missing"
# No pytest-freezegun dependency
donttest+=" or test_get_wheel_download_cached"
donttest+=" or test_periodic_update_skip"
donttest+=" or test_periodic_update_trigger"
donttest+=" or test_do_update_first"
donttest+=" or test_do_update_skip_already_done"
donttest+=" or test_download_stop_with_embed"
donttest+=" or test_download_manual_stop_after_one_download"
donttest+=" or test_download_manual_ignores_pre_release"
donttest+=" or test_download_periodic_stop_at_first_usable"
donttest+=" or test_download_periodic_stop_at_first_usable_with_previous_minor"

# test broken upstream https://github.com/pypa/virtualenv/issues/530
%python_expand py.test-%{$python_bin_suffix} -k "not ($donttest)" -vv
%post
%python_install_alternative virtualenv

%postun
%python_uninstall_alternative virtualenv

%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/virtualenv
%{python_sitelib}/virtualenv-%{version}*-info
%python_alternative %{_bindir}/virtualenv

%changelog
openSUSE Build Service is sponsored by