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

Tidying up, and replace nose with pytest #1289

Merged
merged 18 commits into from
Jul 13, 2021
Merged

Tidying up, and replace nose with pytest #1289

merged 18 commits into from
Jul 13, 2021

Conversation

Yobmod
Copy link
Contributor

@Yobmod Yobmod commented Jul 12, 2021

Fix #1287
Some tidying up for config files.
All I wanted was a linter that could report on imports only needed for typing!
Anyway...

setup.py
Change distutils build_py to setuptools wrapper. Deprecated since py3.8, I thought it caused a problem with 3.10beta. Now works py3.6-3.10.

Tox.ini
Ignore E704 (mutiple expression per line) so can make @Overloads neater
Add [pytest] config section

requirements
Created requirements-dev.txt with pytest and plugins
Edit: Changed nose to pytest in test-requirements.txt

Pythonpackage.yaml
Add pip install wheel and setuptools, newer packages were having to fallback to EZ_setup without them.
Invoke mypy directly, no need for tox.
Add py3.10.0-Beta.3 to test matrix....
....which needed update to actions/setup-python@v2
Add pytest step - runs after Documentation and set to always pass, but shows errors in info
Edit: Swapped nose for pytest

Results
Pytest results: 378 passed, 42 skipped, 3 warnings
Nose results: 420 tests, 42 skipped (= 378)

So we might just be able to switch directly to Pytest to run the tests.
But test code still needs to be gone through to remove any nose dependancy for py3.10.
Edit: if there is any - all looks like unittest to me?
Edit2: So ive removed nose everywhere, and all same tests pass or fail or are skipped!

Yobmod added 18 commits July 12, 2021 16:49
Combined pytest into usual workflow
Add pytest step to workflow
Add pip install setuptools and wheel
Invoke mypy directly, no need for tox
Add pytest plugins
Ignore flake8 E704 (Multiple statements on one line) too make overloads smaller
Add [pytest] config section
Change distutils.build_py to its setuptools wrapper.
Distutils one deprecated since py3.8, but setuptools one working py3.6-3.10
Replace nose with pytest
Move pytest before Documentation in workflow
Not sure it is picking up the tox.ini
Add 3.10.0-beta.3 to test matrix.
(beta 4 out, but wouldn't install. Need to force cache emptying?)
update to actions/setup-python@v1
@Yobmod Yobmod changed the title Tidying up, and prep for pytest Tidying up, and replace nose with pytest Jul 12, 2021
@Yobmod Yobmod merged commit 63f5541 into main Jul 13, 2021
@Yobmod Yobmod deleted the pytest branch July 13, 2021 21:38
@Byron
Copy link
Member

Byron commented Jul 14, 2021

Fantastic work once again! I remember that now being able to use pytest was a hurdle for some contributors, I am glad that's removed now.

Maybe you could also have a look at the respective section in the docs and see if a command-line without tox could be suggested there as well.

There also is a Makefile that could be loaded up with useful targets for typical local development, to help running tests and linters for example.

@Byron Byron added this to the v3.1.19 - Bugfixes milestone Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Nose unsupported, doesnt work with Python 3.10
2 participants