fix tox with dependency on python-parted

Bug #1477795 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
Fix Released
Medium
Unassigned

Bug Description

after merging Wesley's partition code that uses python-parted, we now have broken the 'tox' environment that I had added just before.

tox fails due to python-parted not being 'pip installable'.
Below shows the problem, and a work around that probably works for 3.4 also but untested there.

$ tox -e py27
py27 develop-inst-noop: /home/smoser-public/src/curtin/trunk
py27 installed: PyYAML==3.11,argparse==1.2.1,-e bzr+file:///home/smoser-public/src/curtin/trunk.dist@229#egg=curtin-0.1.0-py2.7-dev_r229,funcsigs==0.4,mock==1.3.0,nose==1.3.7,pbr==1.3.0,six==1.9.0,urllib3==1.11,wsgiref==0.1.2
py27 runtests: PYTHONHASHSEED='1583728979'
py27 runtests: commands[0] | /home/smoser-public/src/curtin/trunk/.tox/py27/bin/python /home/smoser-public/src/curtin/trunk/tools/noproxy nosetests
.......................E.............
======================================================================
ERROR: Failure: ImportError (No module named parted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/smoser-public/src/curtin/trunk/.tox/py27/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/smoser-public/src/curtin/trunk/.tox/py27/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/smoser-public/src/curtin/trunk/.tox/py27/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/smoser-public/src/curtin/trunk/tests/unittests/test_partitioning.py", line 4, in <module>
    import parted
ImportError: No module named parted

----------------------------------------------------------------------
Ran 37 tests in 0.093s

FAILED (errors=1)
ERROR: InvocationError: '/home/smoser-public/src/curtin/trunk/.tox/py27/bin/python /home/smoser-public/src/curtin/trunk/tools/noproxy nosetests'
_____________________________________________________________________________________________________ summary ______________________________________________________________________________________________________
ERROR: py27: commands failed

$ dpkg-query --show python-parted
python-parted 3.10.5-1build1

$ dpkg -L python-parted | while read f; do [ -f "$f" ] && echo $f; done
/usr/lib/python2.7/dist-packages/parted/decorators.py
/usr/lib/python2.7/dist-packages/parted/__init__.py
/usr/lib/python2.7/dist-packages/parted/geometry.py
/usr/lib/python2.7/dist-packages/parted/partition.py
/usr/lib/python2.7/dist-packages/parted/disk.py
/usr/lib/python2.7/dist-packages/parted/cachedlist.py
/usr/lib/python2.7/dist-packages/parted/device.py
/usr/lib/python2.7/dist-packages/parted/alignment.py
/usr/lib/python2.7/dist-packages/parted/constraint.py
/usr/lib/python2.7/dist-packages/parted/filesystem.py
/usr/lib/python2.7/dist-packages/pyparted-3.10.5.egg-info
/usr/lib/python2.7/dist-packages/_ped.x86_64-linux-gnu.so
/usr/share/doc/python-parted/README
/usr/share/doc/python-parted/copyright
/usr/share/doc/python-parted/TODO
/usr/share/doc/python-parted/BUGS
/usr/share/doc/python-parted/changelog.Debian.gz
/usr/share/doc/python-parted/examples/make_one_primary_partition.py.gz
/usr/share/doc/python-parted/HACKING.gz

$ cp -a /usr/lib/python2.7/dist-packages/parted/ .tox/py27/lib/python2.7/site-packages/

$ cp /usr/lib/python2.7/dist-packages/_ped.x86_64-linux-gnu.so .tox/py27/lib/python2.7/site-packages/parted/

$ tox -e py27
py27 develop-inst-noop: /home/smoser-public/src/curtin/trunk
py27 installed: PyYAML==3.11,argparse==1.2.1,-e bzr+file:///home/smoser-public/src/curtin/trunk.dist@229#egg=curtin-0.1.0-py2.7-dev_r229,funcsigs==0.4,mock==1.3.0,nose==1.3.7,pbr==1.3.0,six==1.9.0,urllib3==1.11,wsgiref==0.1.2
py27 runtests: PYTHONHASHSEED='3735920778'
py27 runtests: commands[0] | /home/smoser-public/src/curtin/trunk/.tox/py27/bin/python /home/smoser-public/src/curtin/trunk/tools/noproxy nosetests
.........................................
----------------------------------------------------------------------
Ran 41 tests in 0.103s

OK
_____________________________________________________________________________________________________ summary ______________________________________________________________________________________________________
  py27: commands succeeded
  congratulations :)

Revision history for this message
Scott Moser (smoser) wrote :

Also note, I did try 'sitepackages = True' in tox.ini, but that didn't work either.
it failed like:

$ tox --recreate -e py27
py27 create: /home/smoser-public/src/curtin/custom-partitioning-incremental-2/.tox/py27
py27 installdeps: -r/home/smoser-public/src/curtin/custom-partitioning-incremental-2/test-requirements.txt, -r/home/smoser-public/src/curtin/custom-partitioning-incremental-2/requirements.txt
py27 develop-inst: /home/smoser-public/src/curtin/custom-partitioning-incremental-2
Traceback (most recent call last):
  File "/usr/bin/tox", line 9, in <module>
    load_entry_point('tox==2.1.1', 'console_scripts', 'tox')()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 39, in main
    retcode = Session(config).runcommand()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 373, in runcommand
    return self.subcommand_test()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 540, in subcommand_test
    output = py.process.cmdexec("%s freeze" % (pip))
  File "/usr/lib/python3/dist-packages/py/_process/cmdexec.py", line 28, in cmdexec
    raise ExecutionFailed(status, status, cmd, out, err)
py.process.cmdexec.Error: ExecutionFailed: 2 /home/smoser-public/src/curtin/custom-partitioning-incremental-2/.tox/py27/bin/pip freeze
Exception:
Traceback (most recent call last):
  File "/home/smoser-public/src/curtin/custom-partitioning-incremental-2/.tox/py27/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/home/smoser-public/src/curtin/custom-partitioning-incremental-2/.tox/py27/local/lib/python2.7/site-packages/pip/commands/freeze.py", line 74, in run
    req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
  File "/home/smoser-public/src/curtin/custom-partitioning-incremental-2/.tox/py27/local/lib/python2.7/site-packages/pip/__init__.py", line 299, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

Storing debug log for failure in /home/smoser/.pip/pip.log

Revision history for this message
Scott Moser (smoser) wrote :

we're gonna fix this by dropping python-parted.

Changed in curtin:
importance: Undecided → Medium
status: New → Triaged
Scott Moser (smoser)
Changed in curtin:
status: Triaged → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.