[python-paver] Patch from upstream for the setuptools issues
Toshio くらとみ
toshio at fedoraproject.org
Fri Aug 3 16:33:16 UTC 2012
commit eee7610909e4b56c0b7fc23b44733ddba2b8b4a9
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Fri Aug 3 09:33:08 2012 -0700
Patch from upstream for the setuptools issues
paver-egginstall.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
python-paver.spec | 22 ++++++++++------------
2 files changed, 56 insertions(+), 12 deletions(-)
---
diff --git a/paver-egginstall.patch b/paver-egginstall.patch
new file mode 100644
index 0000000..a83b5eb
--- /dev/null
+++ b/paver-egginstall.patch
@@ -0,0 +1,46 @@
+Index: Paver-1.1.0/paver/setuputils.py
+===================================================================
+--- Paver-1.1.0.orig/paver/setuputils.py
++++ Paver-1.1.0/paver/setuputils.py
+@@ -43,18 +43,18 @@ standard_exclude_directories = ('.*', 'C
+ def _dispatch_setuptools_install(distribution, command_name):
+ """
+ setuptools hack:
+- - setuptools check where is `install` command called from:
+- - if it's not called directly (case of paver), use `install` from distutils
+- (no deps handling)
+- - if it's called directly, it handles `install_requires` deps as well
+- (which is what we want, but what we do not get... until this hack)
++ - handle dependencies in `install_requires` by calling fetch_build_eggs()
+ """
+- cmd = distribution.get_command_obj(command_name)
+- if hasattr(cmd, 'do_egg_install'):
+- cmd.do_egg_install()
+- else:
+- print >> sys.stderr, "Setuptools install-dependencies hack failed"
+- distribution.run_command(command_name)
++
++ #check if it has some requirements and try to install them
++ if distribution.install_requires:
++ try:
++ distribution.fetch_build_eggs(distribution.install_requires)
++ except Exception:
++ pass
++
++ #run command
++ distribution.run_command(command_name)
+
+ # storage of extra dispatchers for distutils/setuptools commands
+ _extra_command_dispatch = {
+@@ -169,8 +169,9 @@ class DistutilsTask(tasks.Task):
+ opt_dict[name.replace('-', '_')] = ("command line", value)
+
+ # see if we don't have extra dispatcher for command
+- if str(self.command_class) in _extra_command_dispatch:
+- _extra_command_dispatch[str(self.command_class)](self.distribution, self.command_name)
++ cmd_class = str(self.command_class)
++ if cmd_class in _extra_command_dispatch:
++ _extra_command_dispatch[cmd_class](self.distribution, self.command_name)
+ else:
+ self.distribution.run_command(self.command_name)
+
diff --git a/python-paver.spec b/python-paver.spec
index 0e5c588..f756159 100644
--- a/python-paver.spec
+++ b/python-paver.spec
@@ -2,10 +2,10 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif
-%define srcname Paver
+%global srcname Paver
Name: python-paver
Version: 1.1.0
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Python-based build/distribution/deployment scripting tool
Group: Development/Languages
@@ -14,6 +14,10 @@ Group: Development/Languages
License: BSD and (MIT or GPLv2)
URL: http://www.blueskyonmars.com/projects/paver/
Source0: http://pypi.python.org/packages/source/P/%{srcname}/%{srcname}-%{version}.tar.gz
+# Backport upstream commit to work around setuptools
+# https://github.com/paver/paver/issues/71
+# https://github.com/paver/paver/commit/b19783eb42736389e8958cf1394b19d15b9c9caa
+Patch0: paver-egginstall.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -53,6 +57,7 @@ now much easier.
%prep
%setup -q -n %{srcname}-%{version}
+%patch0 -p1
# Note: This falls somewhere in between source and non-source. It's a copy
# of the essential files from the library that's being packaged. But it's
@@ -69,17 +74,7 @@ nosetests
%install
rm -rf %{buildroot}
-# YUCK. Stupid setuptools workarounds
-mkdir -p %{buildroot}%{python_sitelib}
-PYTHONPATH=%{buildroot}%{python_sitelib}
-export PYTHONPATH
-
%{__python} setup.py install --skip-build --root %{buildroot}
-# And another stupid setuptools workaround
-# (paver-1.1.0+ is using the setuptools easy_install() command to install.
-# That command creates site.py we'll have to check if this affects every
-# package that uses paver to install)
-rm %{buildroot}%{python_sitelib}/site.py*
%clean
rm -rf %{buildroot}
@@ -92,6 +87,9 @@ rm -rf %{buildroot}
%changelog
+* Thu Aug 2 2012 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.0-3
+- Patch from upstream for the setuptools issues
+
* Thu Aug 2 2012 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.0-2
- Remove the site.py that the install is creating
More information about the scm-commits
mailing list