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

Use tox to run pytest-copie unit tests locally on multiple python versions #366

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

drewoldag
Copy link
Collaborator

@drewoldag drewoldag commented Feb 1, 2024

Change Description

This proof of concept PR shows that we can use tox with a simple configuration file to execute the pytest-copie-based unit tests locally on a group a set of different python versions.

There is some amount of dev environment setup required:

  1. Install tox
  2. Use brew install python@3.xx for any version of python that is not installed on your system 3.8 - 3.12.

Note that when running tox with the tox.ini file as defined, if you are missing a version of python that tox has been instructed to use, it will simply skip that version and log a warning.

Checklist

  • This PR is meant for the lincc-frameworks/python-project-template repo and not a downstream one instead.
  • This change is linked to an open issue
  • This change includes integration testing, or is small enough to be covered by existing tests

@drewoldag drewoldag self-assigned this Feb 1, 2024
@drewoldag drewoldag linked an issue Feb 1, 2024 that may be closed by this pull request
Copy link
Contributor

@delucchi-cmu delucchi-cmu left a comment

Choose a reason for hiding this comment

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

I'm not sure how often I would personally use tox, because I'm a little too lazy. But this looks like a great addition!

@drewoldag
Copy link
Collaborator Author

@delucchi-cmu yours is a very fair point. There is certainly more effort involved in setting up tox to run. However, once you have tox installed in your virtual environment (even if you haven't added multiple additional python versions), running tox at the command line will be very similar to running pytest tests at the command line.

tox will simply skip over the versions of python that it can't find, but will run the tests for the versions that it can find.

Putting all that aside though, I really want to have more confidence when we assert "The PPT works for Python >= 3.8".

@drewoldag drewoldag merged commit 952113d into main Feb 1, 2024
16 checks passed
@drewoldag drewoldag deleted the issue/190/tox-investigation branch February 1, 2024 19:10
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.

Investigate using tox for integration tests
2 participants