Opened 11 years ago

Closed 11 years ago

#39479 closed defect (fixed)

py-pytools @2012.1: build fails trying to use distribute

Reported by: mndavidoff (Monte Davidoff) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: haspatch Cc: avi@…
Port: py-pytools

Description

I got an error building py27-pytools because it tries to use distribute instead of setuptools.

$ port installed py27-setuptools
The following ports are currently installed:
  py27-setuptools @0.7.4_0 (active)
$ sudo port -vs install py27-pytools
Password:
--->  Computing dependencies for py27-pytools.
--->  Fetching distfiles for py27-pytools
--->  Verifying checksum(s) for py27-pytools
--->  Checksumming pytools-2012.1.tar.gz
--->  Extracting py27-pytools
--->  Extracting pytools-2012.1.tar.gz
--->  Configuring py27-pytools
--->  Building py27-pytools
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
Extracting in /tmp/tmpb3UAi5
Now working in /tmp/tmpb3UAi5/distribute-0.6.14
Building a Distribute egg in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pytools/py27-pytools/work/pytools-2012.1
Traceback (most recent call last):
  File "setup.py", line 37, in <module>
    exec(open(init_path).read(), d)
  File "<string>", line 8, in <module>
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/setuptools/__init__.py", line 2, in <module>
    from setuptools.extension import Extension, Library
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/setuptools/extension.py", line 2, in <module>
    from setuptools.dist import _get_unpatched
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/setuptools/dist.py", line 6, in <module>
    from setuptools.command.install import install
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/setuptools/command/__init__.py", line 8, in <module>
    from setuptools.command import install_scripts
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/setuptools/command/install_scripts.py", line 3, in <module>
    from pkg_resources import Distribution, PathMetadata, ensure_directory
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/pkg_resources.py", line 2691, in <module>
    add_activation_listener(lambda dist: dist.activate())
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/pkg_resources.py", line 668, in subscribe
    callback(dist)
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/pkg_resources.py", line 2691, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/pkg_resources.py", line 2192, in activate
    self.insert_on(path)
  File "/private/tmp/tmpb3UAi5/distribute-0.6.14/pkg_resources.py", line 2293, in insert_on
    "with distribute. Found one at %s" % str(self.location))
ValueError: A 0.7-series setuptools cannot be installed with distribute. Found one at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
...

The attached patch works for me to fix the problem.

Attachments (3)

main.log.gz (3.2 KB) - added by mndavidoff (Monte Davidoff) 11 years ago.
setup.py.diff (270 bytes) - added by mndavidoff (Monte Davidoff) 11 years ago.
Portfile.diff (844 bytes) - added by mndavidoff (Monte Davidoff) 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by mndavidoff (Monte Davidoff)

Attachment: main.log.gz added

Changed 11 years ago by mndavidoff (Monte Davidoff)

Attachment: setup.py.diff added

comment:1 Changed 11 years ago by raimue (Rainer Müller)

Resolution: worksforme
Status: newclosed

I can't reproduce this problem on my system now anymore. py*-setuptools was replaced by py*-distribute, I guess that solved the issue.

comment:2 Changed 11 years ago by mndavidoff (Monte Davidoff)

Resolution: worksforme
Status: closedreopened

Thank you for your attention to this. As it says in the distribute documentation at ​http://pythonhosted.org/distribute/, "Distribute is a deprecated fork of the Setuptools project. Since the Setuptools 0.7 release, Setuptools and Distribute have merged and Distribute is no longer being maintained." At one time, py*-setuptools was replaced by py*-distribute. More recently, this was undone, and py*-distribute was replaced by py*-setuptools. The py27-pytools install does not fail for me in the same way, probably because of fixes made to setuptools, but the build output shows it is not behaving correctly:

$ sudo port -vs install py27-pytools
--->  Computing dependencies for py27-pytools.
--->  Fetching distfiles for py27-pytools
--->  Verifying checksums for py27-pytools
--->  Checksumming pytools-2012.1.tar.gz
--->  Extracting py27-pytools
--->  Extracting pytools-2012.1.tar.gz
--->  Configuring py27-pytools
--->  Building py27-pytools
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
...

The MacPorts way is for MacPorts to manage downloads and dependencies, not the scripts for individual ports. This problem has been fixed upstream, and I've replaced the patch with one that upgrades to pytools 2013.5.6. (The setup.py.diff file is no longer needed.)

Changed 11 years ago by mndavidoff (Monte Davidoff)

Attachment: Portfile.diff added

comment:3 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: avi@… added
Owner: changed from macports-tickets@… to ryandesign@…
Status: reopenednew

Has duplicate #41141.

comment:4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.