python-setuptools/python-setuptools.spec

182 lines
5.9 KiB
RPMSpec
Raw Normal View History

#
# spec file
#
# Copyright (c) 2021 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/
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%bcond_with wheel
%else
%if "%{flavor}" == "wheel"
%define psuffix -wheel
%bcond_without wheel
%else
%define psuffix %{nil}
%bcond_with test
%bcond_with wheel
%endif
%endif
# in order to avoid rewriting for subpackage generator
%define mypython python
Name: python-setuptools%{psuffix}
Version: 57.0.0
Release: 0
Summary: Download, build, install, upgrade, and uninstall Python packages
License: MIT
URL: https://github.com/pypa/setuptools
Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz
Patch0: sort-for-reproducibility.patch
# PATCH-FIX-OPENSUSE remove_mock.patch mcepl@suse.com
Patch1: remove_mock.patch
# PATCH-FIX-OPENSUSE remove-more-itertools-dependency-cycle.patch alarrosa@suse.com
Patch2: remove-more-itertools-dependency-cycle.patch
BuildRequires: %{python_module appdirs >= 1.4.3}
BuildRequires: %{python_module ordered-set >= 3.1.1}
BuildRequires: %{python_module packaging >= 20.4}
BuildRequires: %{python_module pyparsing >= 2.2.1}
BuildRequires: %{python_module xml}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
Requires: python-appdirs >= 1.4.3
Requires: python-base >= 3.6
Requires: python-ordered-set >= 3.1.1
Requires: python-packaging >= 20.4
Requires: python-pyparsing >= 2.2.1
Accepting request 368985 from home:tbechtold:branches:devel:languages:python - update to 20.2.2: * Issue #502: Correct regression in parsing of multiple version specifiers separated by commas and spaces. * Issue #499: Restore compatiblity for legacy versions by bumping to packaging 16.4. * Changelog now includes release dates and links to PEPs. * Pull Request #173: Replace dual PEP 345 _markerlib implementation and PEP 426 implementation of environment marker support from packaging 16.1 and PEP 508. Fixes Issue #122. See also Pull Request #175, Pull Request #168, and Pull Request #164. Additionally: - ``Requirement.parse`` no longer retains the order of extras. - ``parse_requirements`` now requires that all versions be PEP-440 compliant, as revealed in #499. Packages released with invalid local versions should be re-released using the proper local version syntax, e.g. ``mypkg-1.0+myorg.1``. * Update ``upload_docs`` command to also honor keyring for password resolution. * Added support for using passwords from keyring in the upload command. * Issue #118: Once again omit the package metadata (egg-info) from the list of outputs in ``--record``. This version of setuptools can no longer be used to upgrade pip earlier than 6.0. * `Off-project PR <https://github.com/jaraco/setuptools/pull/32>`_: For FreeBSD, also honor root certificates from ca_root_nss. OBS-URL: https://build.opensuse.org/request/show/368985 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=93
2016-03-09 17:22:46 +01:00
Requires: python-xml
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module Paver}
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module jaraco.envs}
BuildRequires: %{python_module jaraco.path >= 3.2.0}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-fixture-config}
BuildRequires: %{python_module pytest-virtualenv}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools >= %{version}}
BuildRequires: %{python_module virtualenv >= 13.0.0}
BuildRequires: %{python_module wheel}
%endif
%if 0%{?suse_version} || 0%{?fedora_version} >= 24
Recommends: ca-certificates-mozilla
%endif
%if %{with wheel}
BuildRequires: %{python_module wheel}
%endif
%if !%{with test} && !%{with wheel}
# work around boo#1186870
Provides: %{mypython}%{python_version}dist(setuptools) = %{version}
Provides: %{mypython}%{python_version}dist(pkg_resources) = %{version}
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Provides: %{mypython}3dist(pkg_resources) = %{version}
Provides: %{mypython}3dist(setuptools) = %{version}
%endif
%endif
%python_subpackages
%description
setuptools is a collection of enhancements to the Python distutils that
allow you to build and distribute Python packages,
especially ones that have dependencies on other packages.
%prep
%autosetup -p1 -n setuptools-%{version}
# 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
sed -r -i '1s@^#!/.*$@@' pkg_resources/_vendor/appdirs.py
%if ! %{with wheel}
# 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' \
{} \;
%endif
%build
%if ! %{with wheel}
%python_build
%else
%python_exec setup.py bdist_wheel --universal
%endif
%install
%if !%{with test} && !%{with wheel}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with wheel}
%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl
%endif
%check
%if %{with test}
# the 4 skipped test rely on the bundled packages but they are
# not available on virtualenv; this is expected behaviour
donttest="test_clean_env_install or test_pip_upgrade_from_source or test_test_command_install_requirements or test_no_missing_dependencies"
# these 3 tests try to download the wheel wheel from PyPI
donttest="$donttest or (test_distutils_adoption and (distutils_stdlib or distutils_local))"
export LANG=en_US.UTF-8
# tests need imports local source dir
export PYTHONPATH=$(pwd)
%pytest -rfE -n auto -k "not ($donttest)"
%endif
%if !%{with test}
%files %{python_files}
%if !%{with wheel}
%license LICENSE
Accepting request 405571 from home:tbechtold:branches:devel:languages:python - update to 23.1.0: * #619: Deprecated ``tag_svn_revision`` distribution option. * #611: Removed ARM executables for CLI and GUI script launchers on Windows. If this was a feature you cared about, please comment in the ticket. * #604: Removed docs building support. The project now relies on documentation hosted at https://setuptools.readthedocs.io/. * #604: Restore repository for upload_docs command to restore publishing of docs during release. * #589: Upload releases to pypi.io using the upload hostname and legacy path. * #589: Releases are now uploaded to pypi.io (Warehouse) even when releases are made on Twine via Travis. * #589: Releases are now uploaded to pypi.io (Warehouse). * #190: On Python 2, if unicode is passed for packages to ``build_py`` command, it will be handled just as with text on Python 3. * #598: Setuptools now lists itself first in the User-Agent for web requests, better following the guidelines in `RFC 7231 <https://tools.ietf.org/html/rfc7231#section-5.5.3>`_. * Minor fixes to changelog and docs. * #261: Exclude directories when resolving globs in package_data. * #539: In the easy_install get_site_dirs, honor all paths found in ``site.getsitepackages``. * #572: In build_ext, now always import ``_CONFIG_VARS`` from ``distutils`` rather than from ``sysconfig`` OBS-URL: https://build.opensuse.org/request/show/405571 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=95
2016-07-04 10:17:56 +02:00
%doc CHANGES.rst README.rst
%{python_sitelib}/setuptools
%{python_sitelib}/setuptools-%{version}-py%{python_version}.egg-info
%dir %{python_sitelib}/pkg_resources
%{python_sitelib}/pkg_resources/*
%{python_sitelib}/_distutils_hack
%{python_sitelib}/distutils-precedence.pth
%endif
%if %{with wheel}
%dir %{python_sitelib}/../wheels
%{python_sitelib}/../wheels/*
%endif
%endif
%changelog