Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build wheels instead of sdist #185

Closed
pytoxbot opened this issue Sep 17, 2016 · 17 comments
Closed

build wheels instead of sdist #185

pytoxbot opened this issue Sep 17, 2016 · 17 comments
Labels
area:documentation feature:new something does not exist yet, but should

Comments

@pytoxbot
Copy link

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.

@pytoxbot
Copy link
Author

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

@pytoxbot
Copy link
Author

Original comment by @nicoddemus

Oh yeah, certainly, this should be a configuration option.

@pytoxbot
Copy link
Author

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

;)

@pytoxbot
Copy link
Author

Original comment by hexadite-maxk

@The-Compiler, I'm just literally reading the original post: it says "instead" which I interpret as

take sdist out, putting bdist_wheel "in its stead"

@pytoxbot
Copy link
Author

Original comment by @bittner

@nicoddemus Done. See issue #297.

@pytoxbot
Copy link
Author

Original comment by @The-Compiler

@hexadite-maxk Huh? I don't see anyone talking about forcing anything.

@pytoxbot
Copy link
Author

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

@pytoxbot
Copy link
Author

Original comment by @nicoddemus

Making tox also test wheel packages would be of great help to ensure projects are publishing correct wheels.

@pytoxbot
Copy link
Author

Original comment by @nicoddemus

@bittner could you please create a separate issue for that?

@pytoxbot
Copy link
Author

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. 😏

@pytoxbot
Copy link
Author

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.

@brechtm
Copy link

brechtm commented Oct 6, 2016

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

@graingert
Copy link

@brechtm I'd rather it were built in.

@brechtm
Copy link

brechtm commented Oct 6, 2016

@graingert I agree. This is just a temporary solution for when you need to be able to test wheels now.

@cattz
Copy link

cattz commented Jun 13, 2017

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:

  • Not deleting the dist folder so I can keep bot py27 and py36 wheels
  • You have to provide your package name in the pip install line

@obestwalter
Copy link
Member

Added the docs label, because even if this is never implemented it would be good to document the workaround?

@obestwalter obestwalter added area:documentation feature:new something does not exist yet, but should and removed documentation labels Sep 4, 2017
@obestwalter
Copy link
Member

closing in favour of #232

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:documentation feature:new something does not exist yet, but should
Projects
None yet
Development

No branches or pull requests

5 participants