HEADS-UP and RFC - Adding setuptools as default RUN_DEPENDS

2014-02-13 Thread Kubilay Kocak
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):

http://lists.freebsd.org/pipermail/freebsd-python/2014-February/006592.html

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.

./koobs
Index: bsd.python.mk
===
--- bsd.python.mk   (revision 343821)
+++ bsd.python.mk   (working copy)
@@ -414,11 +414,11 @@
 _CURRENTPORT:= ${PKGNAMEPREFIX}${PORTNAME}
 .if defined(USE_PYDISTUTILS)  ${_CURRENTPORT} != 
${PYTHON_PKGNAMEPREFIX}setuptools
 BUILD_DEPENDS+=
${PYTHON_PKGNAMEPREFIX}setuptools0:${PORTSDIR}/devel/py-setuptools
+RUN_DEPENDS+=  
${PYTHON_PKGNAMEPREFIX}setuptools0:${PORTSDIR}/devel/py-setuptools
 .endif
 
 # setuptools support
 .if defined(USE_PYDISTUTILS)  ${USE_PYDISTUTILS} == easy_install
-RUN_DEPENDS+=  ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools
 
 PYDISTUTILS_BUILD_TARGET?= bdist_egg
 PYDISTUTILS_INSTALL_TARGET?=   easy_install
___
freebsd-python@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to freebsd-python-unsubscr...@freebsd.org

Re: HEADS-UP and RFC - Adding setuptools as default RUN_DEPENDS

2014-02-13 Thread Ruslan Makhmatkhanov


Kubilay Kocak wrote on 13.02.2014 12:11:

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):

http://lists.freebsd.org/pipermail/freebsd-python/2014-February/006592.html

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.

./koobs


Speaking of myself, things are ok with this change.

--
Regards,
Ruslan

T.O.S. Of Reality
___
freebsd-python@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to freebsd-python-unsubscr...@freebsd.org


shebang problem with python, Was: [REL - head-i386-default][databases/postgresql-libpqxx] Failed for postgresql-libpqxx-4.0.1 in build

2014-02-13 Thread Palle Girgensohn
Hi python@ and bapt@,

I'm usnure how to fix this problem. 

postgresql-libpqxx needs python (shebang:ed) during the build process, and this 
is defined in the port using 

USE_PYTHON_BUILD=   yes
USES=   gmake shebangfix
SHEBANG_FILES=  ${WRKSRC}/tools/splitconfig


The shebangfix alters #!/usr/bin/python in tools/splitconfig to 
#!/usr/local/bin/python...

But USE_PYTHON_BUILD only installs the python2 symlink, not the python symlink, 
so /usr/local/bin/python does not get installed in a clean room environment.

I believe the port is agnostic to the version of python, so I don't want to 
enforce a specific version of python just for this port's build, but the build 
process does not automatically install the lang/python meta port. 

How is this supposed to work?

Palle


13 feb 2014 kl. 20:03 skrev pkg-fallout-buil...@freebsd.org:

 You are receiving this mail as a port that you maintain
 is failing to build on the FreeBSD package build server.
 Please investigate the failure and submit a PR to fix
 build.
 
 Maintainer: pg...@freebsd.org
 Last committer: m...@freebsd.org
 Ident:  $FreeBSD: head/databases/postgresql-libpqxx/Makefile 340722 
 2014-01-22 17:00:46Z mat $
 Log URL:
 http://beefy1.isc.freebsd.org/bulk/head-i386-default/2014-02-13_11h09m11s/logs/postgresql-libpqxx-4.0.1.log
 Build URL:  
 http://beefy1.isc.freebsd.org/bulk/head-i386-default/2014-02-13_11h09m11s
 Log:
 
  Building databases/postgresql-libpqxx
 build started at Thu Feb 13 19:03:08 UTC 2014
 port directory: /usr/ports/databases/postgresql-libpqxx
 building for: FreeBSD head-i386-default-job-24 11.0-CURRENT FreeBSD 
 11.0-CURRENT r261447 i386
 maintained by: pg...@freebsd.org
 Makefile ident:  $FreeBSD: head/databases/postgresql-libpqxx/Makefile 
 340722 2014-01-22 17:00:46Z mat $
 Poudriere version: 3.1-pre
 
 ---Begin Environment---
 UNAME_m=i386
 UNAME_p=i386
 OSVERSION=117
 UNAME_v=FreeBSD 11.0-CURRENT r261447
 UNAME_r=11.0-CURRENT
 BLOCKSIZE=K
 MAIL=/var/mail/root
 STATUS=1
 MASTERMNT=/usr/local/poudriere/data/build/head-i386-default/ref
 PKG_EXT=txz
 tpid=54859
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
 POUDRIERE_BUILD_TYPE=bulk
 PKGNG=1
 PKGNAME=postgresql-libpqxx-4.0.1
 PKG_DELETE=/usr/local/sbin/pkg-static delete -y -f
 PKG_ADD=/usr/local/sbin/pkg-static add
 PWD=/root
 MASTERNAME=head-i386-default
 USER=root
 HOME=/root
 POUDRIERE_VERSION=3.1-pre
 LOCALBASE=/usr/local
 PACKAGE_BUILDING=yes
 PKG_VERSION=/poudriere/pkg-static version
 PKG_BIN=/usr/local/sbin/pkg-static
 ---End Environment---
 
 ---Begin OPTIONS List---
 ---End OPTIONS List---
 
 --CONFIGURE_ARGS--
 --enable-shared  --disable-dependency-tracking --prefix=/usr/local 
 ${_LATE_CONFIGURE_ARGS}
 --End CONFIGURE_ARGS--
 
 --CONFIGURE_ENV--
 TMPDIR=/tmp PYTHON=/usr/local/bin/python2.7 MAKE=gmake SHELL=/bin/sh 
 CONFIG_SHELL=/bin/sh CONFIG_SITE=/usr/ports/Templates/config.site 
 lt_cv_sys_max_cmd_len=262144
 --End CONFIGURE_ENV--
 
 --MAKE_ENV--
 TMPDIR=/tmp SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  
 LOCALBASE=/usr/local  LIBDIR=/usr/lib  CC=cc CFLAGS=-O2 -pipe 
 -fno-strict-aliasing  CPP=cpp CPPFLAGS=-I/usr/local/include  LDFLAGS= 
 -L/usr/local/lib  CXX=c++ CXXFLAGS=-O2 -pipe -fno-strict-aliasing  
 MANPREFIX=/usr/local BSD_INSTALL_PROGRAM=install  -s -o root -g wheel -m 
 555  BSD_INSTALL_LIB=install  -s -o root -g wheel -m 444  
 BSD_INSTALL_SCRIPT=install  -o root -g wheel -m 555  
 BSD_INSTALL_DATA=install  -o root -g wheel -m 444  BSD_INSTALL_MAN=install 
  -o root -g wheel -m 444
 --End MAKE_ENV--
 
 --SUB_LIST--
 PREFIX=/usr/local
 LOCALBASE=/usr/local
 DATADIR=/usr/local/share/libpqxx
 DOCSDIR=/usr/local/share/doc/libpqxx
 EXAMPLESDIR=/usr/local/share/examples/libpqxx
 WWWDIR=/usr/local/www/libpqxx
 ETCDIR=/usr/local/etc/libpqxx
 --End SUB_LIST--
 
 ---Begin make.conf---
 ARCH=i386
 MACHINE=i386
 MACHINE_ARCH=i386
 USE_PACKAGE_DEPENDS=yes
 BATCH=yes
 WRKDIRPREFIX=/wrkdirs
 PORTSDIR=/usr/ports
 PACKAGES=/packages
 DISTDIR=/distfiles
  /usr/local/etc/poudriere.d/make.conf 
 WITH_PKGNG=yes
 NO_RESTRICTED=yes
 DISABLE_MAKE_JOBS=poudriere
 ---End make.conf---
 ===  Cleaning for postgresql-libpqxx-4.0.1
 ===phase: check-config   
 ===
 ===phase: pkg-depends
 ===   postgresql-libpqxx-4.0.1 depends on file: /usr/local/sbin/pkg - not 
 found
 ===Verifying install for /usr/local/sbin/pkg in /usr/ports/ports-mgmt/pkg
 ===   Installing existing package /packages/All/pkg-1.2.6.txz
 Installing pkg-1.2.6... done
 If you are upgrading from the old package format, first run:
 
  # pkg2ng
 ===   Returning to build of postgresql-libpqxx-4.0.1
 ===
 ===phase: fetch-depends  
 

Re: shebang problem with python, Was: [REL - head-i386-default][databases/postgresql-libpqxx] Failed for postgresql-libpqxx-4.0.1 in build

2014-02-13 Thread Antoine Brodin
On Thu, Feb 13, 2014 at 8:22 PM, Palle Girgensohn gir...@freebsd.org wrote:
 Hi python@ and bapt@,

 I'm usnure how to fix this problem.

 postgresql-libpqxx needs python (shebang:ed) during the build process, and 
 this is defined in the port using

 USE_PYTHON_BUILD=   yes
 USES=   gmake shebangfix
 SHEBANG_FILES=  ${WRKSRC}/tools/splitconfig


 The shebangfix alters #!/usr/bin/python in tools/splitconfig to 
 #!/usr/local/bin/python...

 But USE_PYTHON_BUILD only installs the python2 symlink, not the python 
 symlink, so /usr/local/bin/python does not get installed in a clean room 
 environment.

 I believe the port is agnostic to the version of python, so I don't want to 
 enforce a specific version of python just for this port's build, but the 
 build process does not automatically install the lang/python meta port.

 How is this supposed to work?

Hi,

You can use python_CMD= ${PYTHON_CMD}   (currently installed python file name)
Since it's only a build dependency and the splitconfig file is not
packaged this shouldn't be a problem.

Cheers,

Antoine
___
freebsd-python@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to freebsd-python-unsubscr...@freebsd.org


Re: shebang problem with python, Was: [REL - head-i386-default][databases/postgresql-libpqxx] Failed for postgresql-libpqxx-4.0.1 in build

2014-02-13 Thread Palle Girgensohn
Lovely, thank a bundle!

Palle

13 feb 2014 kl. 20:46 skrev Antoine Brodin anto...@freebsd.org:

 On Thu, Feb 13, 2014 at 8:22 PM, Palle Girgensohn gir...@freebsd.org wrote:
 Hi python@ and bapt@,
 
 I'm usnure how to fix this problem.
 
 postgresql-libpqxx needs python (shebang:ed) during the build process, and 
 this is defined in the port using
 
 USE_PYTHON_BUILD=   yes
 USES=   gmake shebangfix
 SHEBANG_FILES=  ${WRKSRC}/tools/splitconfig
 
 
 The shebangfix alters #!/usr/bin/python in tools/splitconfig to 
 #!/usr/local/bin/python...
 
 But USE_PYTHON_BUILD only installs the python2 symlink, not the python 
 symlink, so /usr/local/bin/python does not get installed in a clean room 
 environment.
 
 I believe the port is agnostic to the version of python, so I don't want to 
 enforce a specific version of python just for this port's build, but the 
 build process does not automatically install the lang/python meta port.
 
 How is this supposed to work?
 
 Hi,
 
 You can use python_CMD= ${PYTHON_CMD}   (currently installed python file name)
 Since it's only a build dependency and the splitconfig file is not
 packaged this shouldn't be a problem.
 
 Cheers,
 
 Antoine



signature.asc
Description: Message signed with OpenPGP using GPGMail