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 build warning #13

Closed
glenrobson opened this issue Oct 18, 2021 · 4 comments
Closed

setup.py build warning #13

glenrobson opened this issue Oct 18, 2021 · 4 comments

Comments

@glenrobson
Copy link
Contributor

This is the warning I've seen in other projects when running python setup.py test:

WARNING: Testing via this command 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.
@giacomomarchioro
Copy link
Contributor

giacomomarchioro commented Oct 22, 2021

To my understanding, the scope of the warning is to limit the setup tool for the building of the package, while using CI and dedicated software e.g. tox for what concerns the testing. There is an extended discussion on the pro and cons of this developer choice in this setuptool issue.

So in my opinion the solution could be simply to call the tests in a separate file/process.

I usually use Travis CI with something like this:

language: python
python:
  - "3.6"      # current default Python on Travis CI
  - "3.7"
  - "3.8"
  - "3.9"
  - "3.9-dev"  # 3.9 development branch

# command to install dependencies
install:
  - pip install -r requirements.txt

# command to run tests
script:
  - python -m unittest discover -s tests

Where tests is a folder containing the tests.
But I think something similar could be achieved with GitHub Actions.

@glenrobson
Copy link
Contributor Author

Maybe possible to reference the requirements.txt in the setup.py to avoid duplication.

@glenrobson glenrobson mentioned this issue Oct 22, 2021
3 tasks
@glenrobson
Copy link
Contributor Author

It looks like this is the answer to deduplicating the setup.py and requirements.txt but I don't need it at the moment as the tests work without an extra import:

https://stackoverflow.com/questions/43658870/requirements-txt-vs-setup-py

@glenrobson
Copy link
Contributor Author

I think this can be closed now.

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

No branches or pull requests

2 participants