Fix Python 3.12 compatibility - #362
Merged
Merged
Conversation
Replace deprecated pkg_resources.resource_string with importlib.resources.files().joinpath().read_bytes() across all source and test files. pkg_resources is no longer available without an explicit setuptools dependency in Python 3.12+. Add missing `responsible_unit` field to storage_information in mmd_elements.yaml to match the MMD XSD schema. Fix test isolation issue in test_nc_to_mmd.py by closing netCDF4 Dataset handles after use in test_separate_repeated and testNc_to_mmd_get_geographic_extent_polygon. Update pyproject.toml: - Replace Python 3.8 classifier with 3.12 - Set requires-python >= 3.9 (importlib.resources.files requires Python 3.9+) - Relax netCDF4 constraint from ~=1.5 to >=1.5 Fixes #361 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix 105 E501 line-too-long violations introduced by the importlib.resources migration: - Add _mmd_yaml() helper in test_nc_to_mmd.py to replace 104 repeated inline yaml.load(files(...).read_bytes(), ...) calls - Break long lines in mmd_to_nc.py, yaml_to_adoc.py and test_mmd_yaml_vs_xsd.py Update GitHub Actions workflows: - tests.yml: drop Python 3.8, add 3.12 to matrix; bump actions/setup-python to v5, actions/checkout to v4, codecov/codecov-action to v5 - syntax.yml: bump actions/setup-python to v5, actions/checkout to v4 - tagpr.yml: bump actions/checkout to v4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
charlienegri
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace deprecated pkg_resources.resource_string with importlib.resources.files().joinpath().read_bytes() across all source and test files. pkg_resources is no longer available without an explicit setuptools dependency in Python 3.12+.
Add missing
responsible_unitfield to storage_information in mmd_elements.yaml to match the MMD XSD schema.Fix test isolation issue in test_nc_to_mmd.py by closing netCDF4 Dataset handles after use in test_separate_repeated and testNc_to_mmd_get_geographic_extent_polygon.
Update pyproject.toml:
Fixes #361
Summary: closes #361
Related issue: #361
Suggested reviewer(s):
Reviewer checklist:
The checklist is based on the S-ENDA conventions and definition of done (see https://s-enda-documentation.readthedocs.io/en/latest/general_conventions.html). The above points are not necessarily relevant to all contributions. In that case, please add a short explanation to help the reviewer.