For installation of test packages it would be great if wheels could be used instead.
This is difficult to work for all possible python versions but to start with, universal wheels could be supported.
In this case the universal wheel could be produced in the first step. Then tox can use the test_requires and install_requires to build the deps used in the testenv.
If you want to support multi-python versions at build time, tox could read the setup.cfg wheel config file using the wheel module and drop down to using sdist for those builds.
Original comment by @brechtm
In the meantime, you can build a wheel manually and run tox with the --installpkg option. For example, I have set up Travis-CI to run tox once without (to test the sdist) and once with this option (to test the wheel).
Original comment by @nicoddemus
Oh yeah, certainly, this should be a configuration option.
Original comment by @The-Compiler
From @hpk42's reply:
Agreed -- i guess we need a way to specify which format should be produced and tested
;)
Original comment by hexadite-maxk
@The-Compiler, I'm just literally reading the original post: it says "instead" which I interpret as
take
sdistout, puttingbdist_wheel"in its stead"
Original comment by @bittner
@nicoddemus Done. See issue #297.
Original comment by @The-Compiler
@hexadite-maxk Huh? I don't see anyone talking about forcing anything.
Original comment by hexadite-maxk
Why this should be a forced type?
forced type == new dependency
It would be smoother if tox COULD use wheel
Original comment by @nicoddemus
Making tox also test wheel packages would be of great help to ensure projects are publishing correct wheels.
Original comment by @nicoddemus
@bittner could you please create a separate issue for that?
Original comment by @bittner
I'd love to see the tox configuration to live in setup.cfg (too -- as an alternative) in general. I'm not sure whether this makes any difference in your current problem, though.
It would allow a more elegant Python package configuration for developers: You could put configuration of all your tools into a single file. I've described some considerations in a comment on issue 13.
A few projects already look into setup.cfg. flake8, behave, py.test, among others. And hopefully Pylint soon, too. :smirk:
Original comment by @hpk42
Agreed -- i guess we need a way to specify which format should be produced and tested, probably both in the ini and from the commandline.
If you need to test non-universal wheels, you can build and test your wheel in the same tox env:
skip_install = true
whitelist_externals =
/bin/sh
/bin/rm
commands =
/bin/rm -rf build dist
python setup.py bdist_wheel
/bin/sh -c "pip install --upgrade dist/*.whl"
py.test tests
@brechtm I'd rather it were built in.
@graingert I agree. This is just a temporary solution for when you need to be able to test wheels now.
A small improvement (I think) in @brechtm workaround to be able to use multiple python versions:
[tox]
envlist = py27,py36
[testenv]
skip_install = true
deps =
coverage
nose
whitelist_externals =
/bin/rm
commands =
/bin/rm -rf build
python setup.py bdist_wheel
pip install --upgrade --find-links={toxinidir}/dist <YOUR-PACKAGE-NAME>
nosetests --with-coverage --cover-erase --cover-html-dir=.tox/coverage-html/{envname} --cover-html --with-xunit --xunit-file=.tox/test_report-{envname}.xml ngot/python/test
Differences:
dist folder so I can keep bot py27 and py36 wheelspip install lineAdded the docs label, because even if this is never implemented it would be good to document the workaround?
closing in favour of #232
Most helpful comment
A small improvement (I think) in @brechtm workaround to be able to use multiple python versions:
Differences:
distfolder so I can keep bot py27 and py36 wheelspip installline