2008-09-17 21:43:14 +02:00
|
|
|
#
|
2011-09-23 09:04:42 +02:00
|
|
|
# spec file for package python-setuptools
|
2008-09-17 21:43:14 +02:00
|
|
|
#
|
2020-02-04 15:34:09 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2008-09-17 21:43:14 +02:00
|
|
|
#
|
|
|
|
# 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.
|
2013-07-18 12:09:01 +02:00
|
|
|
|
2018-10-01 09:05:28 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2008-09-17 21:43:14 +02:00
|
|
|
#
|
|
|
|
|
2009-07-30 18:02:49 +02:00
|
|
|
|
2017-02-24 15:33:59 +01:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2017-02-23 14:35:50 +01:00
|
|
|
%define oldpython python
|
2019-08-21 15:08:44 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
2020-11-10 13:57:57 +01:00
|
|
|
%bcond_with wheel
|
2019-08-21 15:08:44 +02:00
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
2020-11-10 13:57:57 +01:00
|
|
|
%bcond_without wheel
|
2019-08-21 15:08:44 +02:00
|
|
|
%endif
|
2020-03-13 14:17:24 +01:00
|
|
|
%bcond_without python2
|
2019-08-21 15:08:44 +02:00
|
|
|
Name: python-setuptools%{psuffix}
|
2020-08-13 13:09:10 +02:00
|
|
|
Version: 44.1.1
|
2011-09-23 09:04:42 +02:00
|
|
|
Release: 0
|
2018-08-25 22:09:10 +02:00
|
|
|
Summary: Enhancements to distutils for building and distributing Python packages
|
2020-04-06 19:14:21 +02:00
|
|
|
License: MIT
|
2020-11-10 13:57:57 +01:00
|
|
|
Group: Development/Languages/Python
|
2018-05-07 15:48:53 +02:00
|
|
|
URL: https://github.com/pypa/setuptools
|
2017-11-27 10:57:16 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip
|
2020-02-04 15:34:09 +01:00
|
|
|
Source3: testdata.tar.gz
|
2019-10-16 14:00:39 +02:00
|
|
|
Patch0: sort-for-reproducibility.patch
|
2019-11-15 09:58:26 +01:00
|
|
|
Patch1: importlib.patch
|
2017-02-23 14:35:50 +01:00
|
|
|
BuildRequires: %{python_module appdirs}
|
2019-10-16 14:00:39 +02:00
|
|
|
BuildRequires: %{python_module ordered-set}
|
2017-02-23 14:35:50 +01:00
|
|
|
BuildRequires: %{python_module packaging}
|
2019-10-16 16:24:01 +02:00
|
|
|
BuildRequires: %{python_module pyparsing >= 2.0.2}
|
2020-03-13 14:17:24 +01:00
|
|
|
BuildRequires: %{python_module six}
|
2017-02-17 16:46:38 +01:00
|
|
|
BuildRequires: %{python_module xml}
|
2017-02-23 14:35:50 +01:00
|
|
|
BuildRequires: fdupes
|
2017-02-17 16:46:38 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2017-02-23 14:35:50 +01:00
|
|
|
BuildRequires: unzip
|
|
|
|
Requires: python-appdirs
|
2019-10-18 16:05:58 +02:00
|
|
|
Requires: python-base
|
2019-10-16 14:00:39 +02:00
|
|
|
Requires: python-ordered-set
|
2017-02-23 14:35:50 +01:00
|
|
|
Requires: python-packaging
|
2020-03-13 14:17:24 +01:00
|
|
|
Requires: python-six
|
2016-03-09 17:22:46 +01:00
|
|
|
Requires: python-xml
|
2013-07-18 12:09:01 +02:00
|
|
|
Requires(post): update-alternatives
|
2014-02-10 16:34:07 +01:00
|
|
|
Requires(postun): update-alternatives
|
2018-03-19 11:57:18 +01:00
|
|
|
BuildArch: noarch
|
2020-03-13 14:17:24 +01:00
|
|
|
# The dependency download feature may require SSL, which is in python3-base and python(2)
|
|
|
|
%ifpython2
|
|
|
|
Requires: python
|
|
|
|
%endif
|
2019-08-21 15:08:44 +02:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module Paver}
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module mock}
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module pytest-fixture-config}
|
|
|
|
BuildRequires: %{python_module pytest-virtualenv}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module setuptools >= %{version}}
|
|
|
|
BuildRequires: %{python_module wheel}
|
2020-03-13 14:17:24 +01:00
|
|
|
%if %{with python2}
|
2019-08-21 15:08:44 +02:00
|
|
|
BuildRequires: python-futures
|
|
|
|
%endif
|
2020-03-13 14:17:24 +01:00
|
|
|
%endif
|
2018-03-19 11:57:18 +01:00
|
|
|
%if 0%{?suse_version} || 0%{?fedora_version} >= 24
|
2017-11-27 10:57:16 +01:00
|
|
|
Recommends: ca-certificates-mozilla
|
2018-02-27 17:52:49 +01:00
|
|
|
%endif
|
2017-02-23 14:35:50 +01:00
|
|
|
%ifpython2
|
|
|
|
Provides: %{oldpython}-distribute = %{version}
|
|
|
|
Obsoletes: %{oldpython}-distribute < %{version}
|
|
|
|
%endif
|
2020-11-10 13:57:57 +01:00
|
|
|
%if %{with wheel}
|
|
|
|
BuildRequires: %{python_module wheel}
|
|
|
|
%endif
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_subpackages
|
|
|
|
|
2006-10-27 14:17:57 +02:00
|
|
|
%description
|
2008-09-17 21:43:14 +02:00
|
|
|
setuptools is a collection of enhancements to the Python distutils that
|
2017-11-17 17:46:23 +01:00
|
|
|
allow you to build and distribute Python packages,
|
2008-09-17 21:43:14 +02:00
|
|
|
especially ones that have dependencies on other packages.
|
|
|
|
|
2020-11-10 13:57:57 +01:00
|
|
|
%if %{with wheel}
|
|
|
|
%package wheel
|
|
|
|
Summary: Wheels for %{name}
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description wheel
|
|
|
|
Generated wheels for %{name}.
|
|
|
|
%endif
|
|
|
|
|
2006-10-27 14:17:57 +02:00
|
|
|
%prep
|
2013-06-25 11:01:42 +02:00
|
|
|
%setup -q -n setuptools-%{version}
|
2020-02-04 15:34:09 +01:00
|
|
|
tar -xzvf %{SOURCE3}
|
2019-10-16 14:00:39 +02:00
|
|
|
%patch0 -p1
|
2019-11-15 08:49:54 +01:00
|
|
|
%patch1 -p1
|
2013-06-25 11:01:42 +02:00
|
|
|
find . -type f -name "*.orig" -delete
|
2006-10-27 14:17:57 +02:00
|
|
|
|
2016-08-31 17:37:24 +02:00
|
|
|
# fix rpmlint spurious-executable-perm
|
|
|
|
chmod -x README.rst
|
|
|
|
|
|
|
|
# strip shebangs to fix rpmlint warnings
|
|
|
|
# "explain the sed":
|
|
|
|
# 1 = first line only
|
|
|
|
# s@...@...@ = same as s/.../.../ except with @ instead of /
|
|
|
|
# ^ = start; #!/ = shebang leading characters; .* = rest of line; $ = end
|
|
|
|
# replace with nothing
|
2017-02-23 14:35:50 +01:00
|
|
|
sed -r -i '1s@^#!/.*$@@' setuptools/command/easy_install.py
|
2016-08-31 17:37:24 +02:00
|
|
|
|
2019-10-16 16:24:01 +02:00
|
|
|
# replace the bundled stuff
|
|
|
|
find ./ -type f -name \*.py -exec sed -i \
|
|
|
|
-e 's:from setuptools\.extern\.:from :g' \
|
|
|
|
-e 's:from pkg_resources\.extern\.:from :g' \
|
|
|
|
-e 's:pkg_resources\.extern\.::g' \
|
|
|
|
-e 's:setuptools\.extern\.::g' \
|
|
|
|
{} \;
|
|
|
|
find ./ -type f -name \*.py -exec sed -i \
|
|
|
|
-e 's:from setuptools\.extern ::g' \
|
|
|
|
-e 's:from pkg_resources\.extern ::g' \
|
|
|
|
{} \;
|
|
|
|
find ./ -type f -name \*.py -exec sed -i \
|
|
|
|
-e 's:from .extern ::g' \
|
|
|
|
{} \;
|
|
|
|
|
2006-10-27 14:17:57 +02:00
|
|
|
%build
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_build
|
2020-11-10 13:57:57 +01:00
|
|
|
%if %{with wheel}
|
|
|
|
%python_exec setup.py bdist_wheel --universal
|
|
|
|
%endif
|
2006-10-27 14:17:57 +02:00
|
|
|
|
|
|
|
%install
|
2019-08-21 15:08:44 +02:00
|
|
|
%if !%{with test}
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_install
|
|
|
|
%prepare_alternative easy_install
|
2020-11-10 13:57:57 +01:00
|
|
|
|
|
|
|
%if %{with wheel}
|
|
|
|
%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl
|
|
|
|
%endif
|
|
|
|
|
2018-12-06 13:04:15 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-08-21 15:08:44 +02:00
|
|
|
%endif
|
2007-06-13 10:31:39 +02:00
|
|
|
|
2019-08-21 15:08:44 +02:00
|
|
|
%check
|
|
|
|
%if %{with test}
|
2019-10-17 10:51:25 +02:00
|
|
|
# the 4 skipped test rely on the bundled packages but they are
|
|
|
|
# not available on virtualenv; this is expected behaviour
|
2019-09-16 11:18:31 +02:00
|
|
|
export LANG=en_US.UTF-8
|
2020-06-23 18:44:57 +02:00
|
|
|
# tests need imports local source dir
|
|
|
|
export PYTHONPATH=$(pwd)
|
2019-10-17 10:51:25 +02:00
|
|
|
%pytest -k 'not (test_clean_env_install or test_pip_upgrade_from_source or test_test_command_install_requirements or test_no_missing_dependencies)'
|
2019-08-21 15:08:44 +02:00
|
|
|
%endif
|
2015-04-07 01:29:51 +02:00
|
|
|
|
2019-08-21 15:08:44 +02:00
|
|
|
%if !%{with test}
|
2013-07-18 12:09:01 +02:00
|
|
|
%post
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_install_alternative easy_install
|
2013-07-18 12:09:01 +02:00
|
|
|
|
2014-02-10 16:34:07 +01:00
|
|
|
%postun
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_uninstall_alternative easy_install
|
2013-07-18 12:09:01 +02:00
|
|
|
|
2017-11-27 10:57:16 +01:00
|
|
|
%files %{python_files}
|
2020-04-06 19:14:21 +02:00
|
|
|
%license LICENSE
|
2016-07-04 10:17:56 +02:00
|
|
|
%doc CHANGES.rst README.rst
|
2017-02-17 16:46:38 +01:00
|
|
|
%python_alternative %{_bindir}/easy_install
|
2013-06-25 11:01:42 +02:00
|
|
|
%{python_sitelib}/setuptools
|
2017-02-17 16:46:38 +01:00
|
|
|
%{python_sitelib}/setuptools-%{version}-py%{python_version}.egg-info
|
2014-02-10 15:53:17 +01:00
|
|
|
%{python_sitelib}/easy_install.py*
|
2017-02-17 16:46:38 +01:00
|
|
|
%pycache_only %{python_sitelib}/__pycache__/easy_install.*
|
2016-02-01 13:01:25 +01:00
|
|
|
%dir %{python_sitelib}/pkg_resources
|
|
|
|
%{python_sitelib}/pkg_resources/*
|
2019-08-21 15:08:44 +02:00
|
|
|
%endif
|
2006-10-27 14:17:57 +02:00
|
|
|
|
2020-11-10 13:57:57 +01:00
|
|
|
%if %{with wheel}
|
|
|
|
%files %{python_files wheel}
|
|
|
|
%dir %{python_sitelib}/../wheels
|
|
|
|
%{python_sitelib}/../wheels/*
|
|
|
|
%endif
|
|
|
|
|
2006-10-27 14:17:57 +02:00
|
|
|
%changelog
|