Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37572972
en ru br
ALT Linux repositórios
S:68.2.2-alt1

Group :: Development/Python3
RPM: python3-module-setuptools

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

%define _unpackaged_files_terminate_build 1
%define pypi_name setuptools
%define system_wheels_path %(%__python3 -c 'import os, sys, system_seed_wheels; sys.stdout.write(os.path.dirname(system_seed_wheels.__file__))' 2>/dev/null || echo unknown)

%def_with check

# bootstrap note: it doesn't work for now

# see https://github.com/pypa/setuptools/issues/2986

Name: python3-module-%pypi_name
Epoch: 1
Version: 68.2.2
Release: alt1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
License: MIT
Group: Development/Python3
Url: https://pypi.org/project/setuptools/
VCS: https://github.com/pypa/setuptools
Source: %name-%version.tar
Source1: %pyproject_deps_config_name
Patch0: %name-%version-alt.patch

Requires: python3-module-pkg_resources = %EVR
# setuptools has commands for doing binary builds; for them to work always:
Requires: python3-dev
Provides: python3-module-distribute = %EVR

# skip requires of self

%filter_from_requires /python3\(\.[[:digit:]]\)\?(pkg_resources\.extern\..*)/d
%filter_from_requires /python3\(\.[[:digit:]]\)\?(setuptools\.extern\..*)/d
# switch to 'local' copy of distutils
%filter_from_requires /python3(distutils\(\..*\)\?)/d
# don't allow vendored distributions have deps other than stdlib
%add_findreq_skiplist %python3_sitelibdir/setuptools/_vendor/*
# ms windows compilers (some packages want to import these modules)
%add_findreq_skiplist %python3_sitelibdir/setuptools/_distutils/*msvc*compiler*.py*
# hide bundled packages
%add_findprov_skiplist %python3_sitelibdir/setuptools/_vendor/*
%add_findprov_skiplist %python3_sitelibdir/setuptools/_distutils/*msvc*compiler*.py*

BuildRequires(pre): rpm-build-pyproject
%pyproject_builddeps_build

%if_with check
BuildRequires: /dev/shm
# For the tests of the setuptools commands to do binary builds:
BuildPreReq: python3-dev
%add_pyproject_deps_check_filter pytest-perf
%add_pyproject_deps_check_filter pytest-ruff
%pyproject_builddeps_metadata_extra testing
%endif

# namespace package for system seed wheels which will be used within venv

# created by virtualenv
BuildRequires: python3(system_seed_wheels)

%package -n python3-module-pkg_resources
Summary: Package Discovery and Resource Access for Python3 libraries
Group: Development/Python3
# Not separated yet:
Conflicts: python3-module-%pypi_name < 39.2.0-alt3

# hide bundled packages

%add_findprov_skiplist %python3_sitelibdir/pkg_resources/_vendor/*

# don't allow vendored distributions have deps other than stdlib

%add_findreq_skiplist %python3_sitelibdir/pkg_resources/_vendor/*

%description
Setuptools is a collection of enhancements to the Python3 distutils
that allow you to more easily build and distribute Python3 packages,
especially ones that have dependencies on other packages.

%global pkg_resources_desc The "pkg_resources" module distributed with "setuptools" provides an API\
for Python libraries to access their resource files, and for extensible\
applications and frameworks to automatically discover plugins.  It also\
provides runtime support for using C extensions that are inside zipfile-format\
eggs, support for merging packages that have separately-distributed modules or\
subpackages, and APIs for managing Python's current "working set" of active\
packages.\
\
Any Python code can make use of pkg_resources at runtime (unlike setuptools,\
whose purpose is preparing packages).

%description -n python3-module-pkg_resources
%pkg_resources_desc

This package contains pkg_resources for Python3.

%package wheel
Summary: %summary
Group: Development/Python3
%py3_requires system_seed_wheels

%description wheel
Provides the seed package for virtualenv(packaged as wheel).

%prep
%setup
%autopatch -p1

# never unbundle vendored packages

# built wheel being installed into virtualenv will lack of unbundled packages

# Remove bundled exes

# today's paths containing *.exe
# setuptools/
# setuptools/_distutils/command/
find -type f -name '*.exe' -delete

# do not generate version like release.postdate, we need release one

sed -i '/^tag_build =.*/d;/^tag_date = 1/d' setup.cfg

# Make sure distutils looks at the right pyconfig.h file

# See https://bugzilla.redhat.com/show_bug.cgi?id=201434
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058)
#
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
# variants:
%ifarch x86_64 %ix86
%ifarch x86_64
%define _pyconfig_h pyconfig-64.h
%else
%define _pyconfig_h pyconfig-32.h
%endif

sed -i "s at 'pyconfig.h' at '%_pyconfig_h' at " setuptools/_distutils/sysconfig.py
%endif

%pyproject_deps_resync_build
%pyproject_deps_resync_metadata

%build
%pyproject_build

%install
%pyproject_install

# since we package python modules as arch dependent

%if "%python3_sitelibdir" != "%python3_sitelibdir_noarch"
mkdir -p %buildroot%python3_sitelibdir
mv %buildroot%python3_sitelibdir_noarch/* %buildroot%python3_sitelibdir/
%endif

# package a built wheel (will be used within venv created by virtualenv)

built_wheel=$(cat ./dist/.wheeltracker) || \
       { echo Make sure you built a pyproject ; exit 1 ; }
mkdir -p "%buildroot%system_wheels_path"
cp -t "%buildroot%system_wheels_path/" "./dist/$built_wheel"

%check
%pyproject_run_pytest -vra

%files
%doc *.rst
%python3_sitelibdir/_distutils_hack/
%python3_sitelibdir/distutils-precedence.pth
%python3_sitelibdir/setuptools

%files -n python3-module-pkg_resources
%python3_sitelibdir/pkg_resources
# People write "setuptools" in *.egg-info/requires.txt (or in setup.py's requires)
# even if they use only the pkg_resources part;
# if setuptools-*.egg-info is not present, pkg_resources.load_entry_point() fails
# (for no real reason). Unfortunately, they have nothing better to write there...
# So we fool this mechanism by putting this file even
# if having incomplete setuptools code.
# Our autoreqs will take over the duty of tracking the real dependencies.
# (In future, we could patch their requires.txt.)
%python3_sitelibdir/%{pyproject_distinfo %pypi_name}/

%files wheel
%system_wheels_path/setuptools-%version-*.whl

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009