Any example to use tox framework

2015-03-10 Thread Andreas Tille
Hi,

I'm working on python-ruffus (current work not commited to Git since
upstream is preparing a new version - I'm fine to inject Beta to Git if
the abstract description of the problem is not sufficient).  Upstream
said it works with tox and thus I tried in debian/rules:


export PYBUILD_TEST_TOX=1

%:
dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild


which resulted in:

...
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:170: cd 
'/tmp/buildd/python-ruffus-2.6~beta2/.pybuild/pythonX.Y_2.7/build'; tox -c 
'/tmp/buildd/python-ruffus-2.6~beta2'/tox.ini -e py27
GLOB sdist-make: /tmp/buildd/python-ruffus-2.6~beta2/setup.py
py27 create: /tmp/buildd/python-ruffus-2.6~beta2/.tox/py27
ERROR: invocation failed, logfile: 
/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/log/py27-0.log
ERROR: actionid=py27
msg=getenv
cmdargs=['/usr/bin/python3', '-mvirtualenv', '--setuptools', '--python', 
'/usr/bin/python2.7', 'py27']
env={'PBUILDER_PKGDATADIR': '/usr/share/pbuilder', 'COWDANCER_ILISTFILE': 
'/.ilist', 'CPPFLAGS': '-D_FORTIFY_SOURCE=2', 'SHLVL': '5', 
'DEB_BUILD_GNU_TYPE': 'x86_64-linux-gnu', 'DEB_HOST_ARCH_ENDIAN': 'little', 'F
msg=getenv
cmdargs=['/usr/bin/python3', '-mvirtualenv', '--setuptools', '--python', 
'/usr/bin/python2.7', 'py27']
env={'PBUILDER_PKGDATADIR': '/usr/share/pbuilder', 'COWDANCER_ILISTFILE': 
'/.ilist', 'CPPFLAGS': '-D_FORTIFY_SOURCE=2', 'SHLVL': '5', 
'DEB_BUILD_GNU_TYPE': 'x86_64-linux-gnu', 'DEB_HOST_ARCH_ENDIAN': 'little', 'F
___ summary 
ERROR:   py27: InvocationError: /usr/bin/python3 -mvirtualenv --setuptools 
--python /usr/bin/python2.7 py27 (see 
/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/log/py27-0.log)
E: pybuild pybuild:256: test: plugin distutils failed with: exit code=1: cd 
'/tmp/buildd/python-ruffus-2.6~beta2/.pybuild/pythonX.Y_2.7/build'; tox -c 
'/tmp/buildd/python-ruffus-2.6~beta2'/tox.ini -e py27
dh_auto_test: pybuild --test -i python{version} -p 2.7 --dir . returned exit 
code 13
debian/rules:14: recipe for target 'build' failed
make: *** [build] Error 13
dpkg-buildpackage: error: debian/rules build gave error exit status 2
E: Failed autobuilding of package
W: no hooks of type C found -- ignoring
I: unmounting dev/pts filesystem
I: unmounting run/shm filesystem
I: unmounting proc filesystem
SPLAY': 'localhost:11.0', 'LANG': 'C', 'http_proxy': 'http://127.0.0.1:9/', 
'DEB_TARGET_ARCH_BITS': '64', 'DEB_TARGET_ARCH_ENDIAN': 'little', 
'SSH_CONNECTION': '192.168.0.1 50972 192.168.0.17 22', 'LC_ALL': 'C',
New python executable in py27/bin/python2.7
Also creating executable in py27/bin/python
Please make sure you remove any previous custom paths from your 
/tmp/buildd/python-ruffus-2.6~beta2/.pybuild/pythonX.Y_2.7/.pydistutils.cfg 
file.
Installing setuptools, pip...
  Complete output from command /tmp/buildd/python-r...x/py27/bin/python2.7 -c 
"import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
  Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking setuptools
Downloading/unpacking pip
Installing collected packages: setuptools, pip
Cleaning up...
Exception:
Traceback (most recent call last):
  File 
"/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/basecommand.py", 
line 122, in main
status = self.run(options, args)
  File 
"/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/commands/install.py",
 line 295, in run
requirement_set.install(install_options, global_options, 
root=options.root_path)
  File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", 
line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", 
line 672, in install
self.move_wheel_files(self.source_dir, root=root)
  File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", 
line 902, in move_wheel_files
pycompile=self.pycompile,
  File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/wheel.py", 
line 327, in move_wheel_files
generated.extend(maker.make(spec))
  File 
"/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/lib/python-wheels/distlib-0.1.9-py2.py3-none-any.whl/distlib/scripts.py",
 line 311, in make
self._make_script(entry, filenames, options=options)
  File 
"/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/lib/python-wheels/distlib-0.1.9-py2.py3-none-any.whl/distlib/scripts.py",
 line 215, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
  File 
"/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/lib/python-wheels/distlib-0.1.9-py2.py3-none-any.whl/distlib/scripts.py",
 line 195, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
  File 
"/tmp/buildd/python-ruffus-2.6~beta2/.tox/py27/lib/python-wheels/distlib-0.1.9-py2.py3-none-any.whl/distlib/util.py",
 line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [

Re: Any example to use tox framework

2015-03-10 Thread Barry Warsaw
On Mar 10, 2015, at 01:32 PM, Andreas Tille wrote:

>export PYBUILD_TEST_TOX=1

I'm not sure what's going on in your specific example, but in general I've
found it less problematic to unpack the tox.ini commands and run them directly
in d/rules, rather than invoked through tox.  YMMV.

Cheers,
-Barry


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150310095624.645e8...@limelight.wooz.org



Re: Any example to use tox framework

2015-03-10 Thread Andreas Tille
Hi Barry,

On Tue, Mar 10, 2015 at 09:56:24AM -0400, Barry Warsaw wrote:
> On Mar 10, 2015, at 01:32 PM, Andreas Tille wrote:
> 
> >export PYBUILD_TEST_TOX=1
> 
> I'm not sure what's going on in your specific example, but in general I've
> found it less problematic to unpack the tox.ini commands and run them directly
> in d/rules, rather than invoked through tox.  YMMV.

The tox.ini file says:


[tox]
envlist = py26,py27,py32,py33,py34
[testenv]
deps=ez_setup
argparse
changedir=ruffus/test
commands=/bin/bash run_all_unit_tests.cmd


and yes, I was formerly doing `/bin/bash run_all_unit_tests.cmd` in
debian rules manually.  So you want to tell me that ignoring python-tox
and just do

override_dh_auto_test:
cd ruffus/test && \
sh ./run_all_unit_tests.cmd && \
sh ./run_all_unit_tests3.cmd


is the best idea?  I did so before upstream told me that tox is
supported and I had the idea that it might be a good idea to use
existing frameworks.

Kind regards

   Andreas.

-- 
http://fam-tille.de


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150310140905.gh31...@an3as.eu



Re: Any example to use tox framework

2015-03-10 Thread Barry Warsaw
On Mar 10, 2015, at 03:09 PM, Andreas Tille wrote:

>and yes, I was formerly doing `/bin/bash run_all_unit_tests.cmd` in
>debian rules manually.  So you want to tell me that ignoring python-tox
>and just do
>
>override_dh_auto_test:
>   cd ruffus/test && \
>   sh ./run_all_unit_tests.cmd && \
>   sh ./run_all_unit_tests3.cmd
>
>is the best idea?  I did so before upstream told me that tox is
>supported and I had the idea that it might be a good idea to use
>existing frameworks.

Hi Andreas,

I wish I had more time to dig into the details, but for projects that I've
packaged where upstream used tox to drive its test suite (a good thing! :),
I've had more success *not* using tox in d/rules.  I haven't had time to
figure out whether the problems are related to pybuild, the build system
(sbuild, pbuilder), or something else.

The other thing to consider is that sometimes the default tox.ini might run
*too* much stuff.  For example, the default environment might include tests
under multiple Python versions, with coverage and without, with alternative
database engines, etc.  I filed this related tox bug:

https://bitbucket.org/hpk42/tox/issue/223/please-add-a-tox-default_envlist-setting

So there may be other reasons why you don't want to just run tox in d/rules,
or if you do, to narrow the environments that you run.

But do experiment; it would be nice to have a good body of experience with
using tox in d/rules.  Sorry I can't help more with that right now.

Cheers,
-Barry


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150310104225.7437d...@anarchist.wooz.org