console_scripts entry points to require setuptools

https://github.com/rpm-software-management/rpm/pull/666
This commit is contained in:
Miro Hrončok 2019-04-17 14:35:46 +02:00
parent 67cc59dd22
commit 70b3ebc993
2 changed files with 13 additions and 3 deletions

View File

@ -4,8 +4,8 @@
Name: python-rpm-generators Name: python-rpm-generators
Summary: Dependency generators for Python RPMs Summary: Dependency generators for Python RPMs
Version: 7 Version: 8
Release: 2%{?dist} Release: 1%{?dist}
# Originally all those files were part of RPM, so license is kept here # Originally all those files were part of RPM, so license is kept here
License: GPLv2+ License: GPLv2+
@ -49,6 +49,10 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} pythondeps.sh pythondistdeps.py
%{_rpmconfigdir}/pythondistdeps.py %{_rpmconfigdir}/pythondistdeps.py
%changelog %changelog
* Wed Apr 17 2019 Miro Hrončok <mhroncok@redhat.com> - 8-1
- console_scripts entry points to require setuptools
https://github.com/rpm-software-management/rpm/pull/666
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7-2 * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

View File

@ -102,7 +102,7 @@ for f in files:
lower.endswith('.egg-info') or \ lower.endswith('.egg-info') or \
lower.endswith('.dist-info'): lower.endswith('.dist-info'):
# This import is very slow, so only do it if needed # This import is very slow, so only do it if needed
from pkg_resources import Distribution, FileMetadata, PathMetadata from pkg_resources import Distribution, FileMetadata, PathMetadata, Requirement
dist_name = basename(f) dist_name = basename(f)
if isdir(f): if isdir(f):
path_item = dirname(f) path_item = dirname(f)
@ -127,6 +127,7 @@ for f in files:
import platform import platform
platform.python_version = lambda: dist.py_version platform.python_version = lambda: dist.py_version
if Provides_PyMajorVer_Variant or PyMajorVer_Deps or legacy_Provides or legacy: if Provides_PyMajorVer_Variant or PyMajorVer_Deps or legacy_Provides or legacy:
# Get the Python major version # Get the Python major version
pyver_major = dist.py_version.split('.')[0] pyver_major = dist.py_version.split('.')[0]
@ -179,6 +180,11 @@ for f in files:
if dep in deps: if dep in deps:
depsextras.remove(dep) depsextras.remove(dep)
deps = depsextras deps = depsextras
# console_scripts/gui_scripts entry points need pkg_resources from setuptools
if (dist.get_entry_map('console_scripts') or
dist.get_entry_map('gui_scripts')):
# stick them first so any more specific requirement overrides it
deps.insert(0, Requirement.parse('setuptools'))
# add requires/recommends based on egg/dist metadata # add requires/recommends based on egg/dist metadata
for dep in deps: for dep in deps:
if legacy: if legacy: