cookiecutter-pypackage icon indicating copy to clipboard operation
cookiecutter-pypackage copied to clipboard

`setup.py test` is bad practice

Open jamesmyatt opened this issue 5 years ago • 6 comments

setup.py test is deprecated and will be removed one day: https://github.com/pypa/setuptools/issues/1684 pytest-runner is no longer recommended: https://github.com/pytest-dev/pytest-runner/issues/50

The project should be updated to avoid these "smells".

jamesmyatt avatar Jul 04 '19 16:07 jamesmyatt

It might also be worth pyproject.toml PEP517/PEP518 support too, eg scrap setup.py altogether and use something like flit

graingert avatar Jul 05 '19 11:07 graingert

pyproject.toml is orthogonal to setup.py. This project should definitely add a pyproject.toml, but I'm not sure I'd recommend switching it over to a different build backend.

pganssle avatar Nov 23 '19 21:11 pganssle

Please see my PR https://github.com/audreyr/cookiecutter-pypackage/pull/544 which should remove all references to setup.py test

ChadBailey avatar Nov 24 '19 21:11 ChadBailey

Please see my PR #544 which should remove all references to setup.py test

In accordance with deprecation notice of pytest-runner:

It is recommended that you:

  • Remove ‘pytest-runner’ from your ‘setup_requires’, preferably removing the setup_requires option.
  • Remove ‘pytest’ and any other testing requirements from ‘tests_require’, preferably removing the setup_requires option.`

Both are still in {{cookiecutter.project_slug}}/setup.py and not in PR #544.

trybik avatar Feb 05 '20 13:02 trybik

Good catch, thanks for pointing out this omission. I'll update if I find the time but feel free to do so yourself

ChadBailey avatar Feb 06 '20 19:02 ChadBailey

I ran into the same problem.

phith0n avatar Feb 21 '21 10:02 phith0n