HEADS-UP and RFC - Adding setuptools as default RUN_DEPENDS

Kubilay Kocak koobs.freebsd at gmail.com
Thu Feb 13 08:12:08 UTC 2014

Two days ago I updated virtualenv, transitioning it away from the
deprecated USE_PYDISTUTILS=easy_install to USE_PYDISTUTILS=yes as many
other ports have recently.

I thought nothing of it until the following report by Scott (cc'd):


The summary of that thread is:

a) Any python software that uses *console_scripts* needs the
pkg_resources module from setuptools at run time. This basically means
anything that installs a CLI utility.

b) Package-only users don't get setuptools installed when they install
the packages of the above ports, because =yes *doesnt* set a RUN_DEPENDS
on it.

This breaks console script invocation, with the following error:

Traceback (most recent call last):
  File "/usr/local/bin/<script-name>", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

Reproduction steps are:

1) Install port or package that uses console_scripts
2) If you installed the package, run the console script
3) If you installed the port
3.1) Run the console script
3.2) Remove py-setuptools
3.3) Run the console script again

Reproduced with: py-virtualenv (`virtualenv`), py-tox (`tox`) and
py-nose (`nosetests`)

We (python@) have now standardised on a consistent installation pattern
for all python software, whether pure-distutils or setuptools based, and
there are run-time requirements that are currently not being satisfied.

Attached is a patch moving RUN_DEPENDS+=setuptools from the
=easy_install only case, to the default case.

Patch review requested, other comments welcome.

-------------- next part --------------
Index: bsd.python.mk
--- bsd.python.mk	(revision 343821)
+++ bsd.python.mk	(working copy)
@@ -414,11 +414,11 @@
 BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools
+RUN_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools
 # setuptools support
 .if defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install"
-RUN_DEPENDS+=		${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools

More information about the freebsd-python mailing list