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

setup.py tests is deprecated #363

Open
johnhawkinson opened this issue Apr 3, 2021 · 2 comments
Open

setup.py tests is deprecated #363

johnhawkinson opened this issue Apr 3, 2021 · 2 comments

Comments

@johnhawkinson
Copy link
Contributor

I'm in no way up on the world of Python packaging, but CONTRIBUTING.rst says

Installing dependencies and running tests can be done with:
python setup.py test

However setup.py --help-commands advises>

  test              run unit tests after in-place build (deprecated)

Which appears to be confirmed by https://setuptools.readthedocs.io/en/stable/userguide/commands.html#test.

Warning
test is deprecated and will be removed in a future version. Users
looking for a generic test entry point independent of test runner are
encouraged to use tox

However, I'm not sure how much of a big deal this is, but there doesn't appear to be an open issue on it, so filing one here and now.

@hemberger
Copy link
Contributor

hemberger commented Apr 3, 2021

Thanks for the heads up! I assume we would then remove python setup.py test as an entrypoint into running the tests, and just rely on invoking pytest; that is, I don't think we need to introduce a dependency on tox (though maybe there's a good reason to use it). This might also require a few small changes to setup.py.

However, speaking of setup.py, that is being deprecated as well (in favor of a declarative setup.cfg), as far as I can tell from https://setuptools.readthedocs.io/en/latest/userguide/quickstart.html#transitioning-from-setup-py-to-setup-cfg.

@moy
Copy link
Collaborator

moy commented Apr 4, 2021

IIRC, python setup.py test is a bit more than an alias for cd tests && pytest: it also deals with dependencies. That would be nice to keep the possibility to run tests without installing dependencies manually.

Indeed, maybe it's just time to move away from setup.py. Poetry seems to be one of the alternatives to look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants