Skip to content

CI: Convert tox config to pyproject.toml, update tox envs#60

Merged
behrmann merged 8 commits intovarlink:masterfrom
phlogistonjohn:jjm-checks
Jun 3, 2025
Merged

CI: Convert tox config to pyproject.toml, update tox envs#60
behrmann merged 8 commits intovarlink:masterfrom
phlogistonjohn:jjm-checks

Conversation

@phlogistonjohn
Copy link
Contributor

@phlogistonjohn phlogistonjohn commented May 21, 2025

Started as a side discussion in #59 because I forgot to run all the ruff commands before pushing. :-)

This updates the tox configuration to:

  • be configured via pyproject.toml
  • drops obsolete/incorrect envs from env list
  • updates env to use pytest instead of nose2 (Per Switch to pytest instead of nose2 #42)
  • adds ruff-{format,check} test envs
  • adds py{3,39}-mypy test envs
  • uses tox in ci actions

The overall aim here is to ensure that the local user can run tests and checks outside of the CI environment without a lot of messing around.

Fixes: #42

@phlogistonjohn phlogistonjohn marked this pull request as ready for review May 23, 2025 17:18
Copy link
Collaborator

@jelly jelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks interesting. Needs a small fixup

The pep8 job was not running pep8 and instead is just a repeat of the
py3 environment.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add tox configuration to pyproject.toml matching the original
configuration in tox.ini minus the pep8 entry in the envlist.
This entry did not run pep8 and was thus misleading and not worth
bringing over to the new configuration.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Remove tox.ini in favor of the tox configuration in pyproject.toml.
This requires tox >= 4.21.0 (from Oct. 2024).

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Fixes: varlink#42

Switch to using pytest instead of nose2. Test coverage is done with
pytest-cov.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
run: |
python3 -m mypy --version
python3 -m mypy varlink/
tox -e py3-mypy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not a tox expert, but sine neither of the ruff tox envs have the py3- prefix, is it necessary here?

Copy link
Contributor Author

@phlogistonjohn phlogistonjohn Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not needed especially if you don't want tox choosing a python version for the env. I can remove that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Add ruff and mypy test envs for tox to pyproject.toml.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add a mypy configuration block to the pyproject.toml file that
configures mypy to use python 3.9 syntax, the oldest version
of python that the library supports.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Use tox as a wrapper around the ruff checks so that it is easier to run
the same checks locally and in the ci.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Convert workflow file to use tox to run mypy.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
@behrmann behrmann merged commit da93db6 into varlink:master Jun 3, 2025
7 checks passed
@behrmann
Copy link
Collaborator

behrmann commented Jun 3, 2025

Thank you!

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

Successfully merging this pull request may close these issues.

Switch to pytest instead of nose2

3 participants