Comment 10 for bug 1548080

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 1548080] Re: tox / run-tests do not run from normal distribution

When you run "./run-tests", all it does is run "tox" directly. If you have
checked this out from a repo it will work, otherwise not. The reason is
that tox uses "setup.py sdist" to make a source tarball and build a
virtualenv from that the old version uses "bzr ls" to list the files needed
and the new version uses "bzr export" to export the files needed. I wanted
the files to always come from the repo, so made the change to export
directly. Both create an empty tarball without a project repo, so for me
at least, it fails on both versions.

This setup.py was written several years ago and does not really conform to
current best practices. I'm thinking of allowing setup to operate with or
without a project repo and build a list using the setup options now
available. Without a repo, it would still test the existing code, but the
results would be "dirty" since we could not validate their provance. But,
it would allow the tarball install to run tox without a problem.

On Sat, Feb 27, 2016 at 6:53 AM, Aaron Whitehouse <
<email address hidden>> wrote:

> For what it's worth, I thought I'd try with a recent version of tox,
> given that mine was quite old (though we probably do need to run
> versions that are as old as the oldest Ubuntu build server to ensure we
> aren't using new features).
>
> It doesn't seem to change anything from my original report:
> $ tox --version
> 2.3.1 imported from /usr/local/lib/python2.7/dist-packages/tox/__init__.pyc
>
> Still the same problem:
> $ ./run-tests
> GLOB sdist-make: /home/aaron/Programming/duplicity/latest_dup/setup.py
> Traceback (most recent call last):
> File "/usr/local/bin/tox", line 11, in <module>
> sys.exit(cmdline())
> File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 39,
> in main
> retcode = Session(config).runcommand()
> File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 375,
> in runcommand
> return self.subcommand_test()
> File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 520,
> in subcommand_test
> path = self.get_installpkg_path()
> File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 496,
> in get_installpkg_path
> path = self._makesdist()
> File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 399,
> in _makesdist
> return self.config.distdir.listdir()[0]
> IndexError: list index out of range
>
> and the patch fixes it:
> $ patch dist/makedist ~/Downloads/Temp/makedist_reversion.diff
> patching file dist/makedist
>
> Then run-tests works as expected.
>
> I haven't yet reviewed this enough to completely follow your comments,
> Kenneth, but thought I'd provide this update to rule out tox as the
> issue. From your playing with this, have you figured out what should fix
> this as a workaround? Given I tend to code TDD, this is stopping me from
> doing some of the coding I had planned.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1548080
>
> Title:
> tox / run-tests do not run from normal distribution
>
> Status in Duplicity:
> In Progress
>
> Bug description:
> I just tried pulling down the latest code and did a ./run-test, but
> received an error "IndexError: list index out of range".
>
> Through a binary search, I found that the error was introduced in rev
> 1165:
>
> http://bazaar.launchpad.net/~duplicity-team/duplicity/0.7-series/revision/1165
>
> If I pull that down and do ./run-tests, I receive the following error
> (whereas 1164 works as expected):
> $ ./run-tests
> GLOB sdist-make: /home/aaron/Programming/duplicity/dup_rev/setup.py
> Traceback (most recent call last):
> File "/usr/local/bin/tox", line 9, in <module>
> load_entry_point('tox==1.7.2', 'console_scripts', 'tox')()
> File
> "/usr/local/lib/python2.7/dist-packages/tox-1.7.2-py2.7.egg/tox/_cmdline.py",
> line 26, in main
> retcode = Session(config).runcommand()
> File
> "/usr/local/lib/python2.7/dist-packages/tox-1.7.2-py2.7.egg/tox/_cmdline.py",
> line 310, in runcommand
> return self.subcommand_test()
> File
> "/usr/local/lib/python2.7/dist-packages/tox-1.7.2-py2.7.egg/tox/_cmdline.py",
> line 442, in subcommand_test
> sdist_path = self.sdist()
> File
> "/usr/local/lib/python2.7/dist-packages/tox-1.7.2-py2.7.egg/tox/_cmdline.py",
> line 418, in sdist
> sdist_path = self._makesdist()
> File
> "/usr/local/lib/python2.7/dist-packages/tox-1.7.2-py2.7.egg/tox/_cmdline.py",
> line 334, in _makesdist
> return self.config.distdir.listdir()[0]
> IndexError: list index out of range
>
> Can other people run the tests properly, or has this been broken for
> everyone from 1165?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1548080/+subscriptions
>