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

Added Python 3.8-3.11 in CI test setup, and fixed several version-related bugs. #69

Merged
merged 7 commits into from
Mar 26, 2024

Conversation

Snailed
Copy link
Collaborator

@Snailed Snailed commented Mar 26, 2024

Changelog

  • minor breaking change: Improved NvidiaGPU.devices() such that it now always returns a unicode string, instead of a binary string in Python 3.8-3.9 and a unicode string in Python 3.10+.
  • Improves tox.ini, so one now can run tox for testing everything using test discovery, or tox -e py11 -- -k "test_case_search_string" for testing a specific test using a specific Python version
  • Improved pyproject.toml such that logs/ and test_logs/ directories will not get detected as package folders. These directories are not checked in Git, but appears during testing. This just means that one does not have to run rm -rf logs/ test_logs/ between test runs.
  • Added Python 3.8-3.11 to Github Actions test matrix for improved compatibility with supported Python versions.
  • Made version specific usage of either pkg_resources or importlib depending on Python version.
  • Fixed test depending on logging race condition.

…sion

Python 3.9 introduced importlib.resources.files which replaces the deprecated pkg_resources.
Since we support Python 3.8, we should conditionally import pkg_resources if Python version is <= 3.9 and import importlib.resources otherwise.
When the tracker thread is stopped in Python 3.11 in Github Actions, the last message logged to the INFO channel is not "Monitoring thread ended." but instead "The following components were found: [...]".
This breaks our tests only in Github Actions. My hypothesis is that this happens due to a race, so this commit tests that in CI.
@PedramBakh PedramBakh merged commit d122cce into lfwa:dev Mar 26, 2024
5 checks passed
Snailed pushed a commit to Snailed/carbontracker that referenced this pull request Jun 25, 2024
Add Python 3.8-3.11 in CI test setup, and fix several version-related bugs.
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.

2 participants