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

Remove py2 import remnants, sort imports, cleanup, move to pytest, enable python 3.10 #767

Merged
merged 8 commits into from
Feb 13, 2022

Conversation

ix5
Copy link
Member

@ix5 ix5 commented Feb 7, 2022

treewide: Use logger.warning, warn is deprecated

Fixes a pytest warning:

isso/__init__.py:187: DeprecationWarning: \
    The 'warn' method is deprecated, use 'warning' instead

See: https://docs.python.org/3.9/library/logging.html?highlight=logging#logging.Logger.warning

Note: There is an obsolete method warn which is functionally identical to warning.
As warn is deprecated, please do not use it - use warning instead.

Makefile: Run flakes explictly only inside isso/

This fixes an annoyance for people who have a virtualenv installed under e.g. .venv/ where flake8 would try to verify every single site-packages pip package inside.

tox: Check TOX_ENV_NAME to skip build_py js step

The env variable name seems to have changed in recent tox versions, see https://tox.wiki/en/latest/config.html#injected-environment-variables

tox.ini: Add python 3.10 to test env list

.github: pythonpackage: Add py3.10 to matrix

Note: The quotes around "py3.10" are needed since without them, GH Actions will interpret everything after the dot as a single-digit integer, i.e. "Python 3.1".

actions/setup-python#249 (comment)

setup.py: Add tests_require for local testing

Explicitly list pytest and pytest-cov deps as needed for local testing.

Note that the infinitve is used, not requires as in install_requires. That's just an oddity in setuptools.

treewide: Replace nosetests with pytest

Nosetests has long been abandoned by its authors and will no longer run under Python 3.10.
Pytest seems to be its spiritual successor as a test runner and seems widely accepted in the community.

  • Adjust Makefile accordingly and recommend installing
    pytest, pytest-cov pip packages
  • Adjust tox.ini accordingly
  • Adjust releaser.conf accordingly
  • Adjust releasing.rst accordingly
  • Adjust docs accordingly
  • Adjust GitHub Actions CI file accordingly

treewide: Remove py2 import remnants, sort

A lot of try/catch handling for discrepancy between py2/py3 module names as well as __future__ imports is not needed since Isso does not support py2 any longer.

@ix5 ix5 force-pushed the cleanup-py2-testing branch from 4bd7bf1 to 6a0c37b Compare February 13, 2022 12:42
@ix5 ix5 marked this pull request as ready for review February 13, 2022 12:43
@ix5 ix5 changed the title [WIP] Remove py2 import remnants, sort imports, cleanup, move to pytest Remove py2 import remnants, sort imports, cleanup, move to pytest, enable python 3.10 Feb 13, 2022
ix5 added 8 commits February 13, 2022 13:47
A lot of try/catch handling for discrepancy between py2/py3
module names as well as __future__ imports is not needed
since Isso does not support py2 any longer.
Nosetests has long been abandoned by its authors and will no
longer run under Python 3.10.
Pytest seems to be its spiritual successor as a test runner
and seems widely accepted in the community.

- Adjust `Makefile` accordingly and recommend installing
  `pytest`, `pytest-cov` pip packages
- Adjust `tox.ini` accordingly
- Adjust `releaser.conf` accordingly
- Adjust `releasing.rst` accordingly
- Adjust docs accordingly
- Adjust GitHub Actions CI file accordingly
Explicitly list `pytest` and `pytest-cov` deps as needed for
local testing.

Note that the infinitve is used, not `requires` as in
`install_requires`. That's just an oddity in setuptools.
Note: The quotes around "py3.10" are needed since without
them, GH Actions will interpret everything after the dot as
a single-digit integer, i.e. "Python 3.1".

actions/setup-python#249 (comment)
This fixes an annoyance for people who have a virtualenv
installed under e.g. `.venv/` where flake8 would try to
verify every single `site-packages` pip packge inside.
Fixes a pytest warning:
```
isso/__init__.py:187: DeprecationWarning: \
    The 'warn' method is deprecated, use 'warning' instead
```
See:
https://docs.python.org/3.9/library/logging.html?highlight=logging#logging.Logger.warning
> Note: There is an obsolete method `warn` which is
> functionally identical to `warning`.
> As `warn` is deprecated, please do not use it - use
> `warning` instead.
@ix5 ix5 force-pushed the cleanup-py2-testing branch from 6a0c37b to 6da519c Compare February 13, 2022 12:47
@ix5 ix5 merged commit b5e2b96 into isso-comments:master Feb 13, 2022
@ix5 ix5 deleted the cleanup-py2-testing branch February 13, 2022 12:51
@ix5 ix5 added the server (Python) server code label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server (Python) server code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant