Fix pkg_resources import on setuptools >=81 and modernize Python support#238
Merged
Conversation
setuptools >=81 no longer ships pkg_resources, breaking import of pyfesom2.ut on Python 3.12 + setuptools 82.0.1 envs. Switch to stdlib importlib.resources.files for locating bundled geojson data. Fixes #236
- CI matrix: 3.9, 3.10, 3.11, 3.12, 3.13 (was 3.8-3.10) - Drop python<=3.9 and scipy<=1.9 pins from CI env so matrix value actually takes effect via micromamba create-args - Drop fsspec==2021.06.1 pin - Rename ci/requirements-py37.yml -> ci/requirements.yml and update all refs (Dockerfile, README, docs/installation.rst, workflows) - setup.py classifiers, CONTRIBUTING.rst, tox.ini, ci/requirements_doc.yml updated to current Python versions CI previously could not catch issues like #236 because the env file pinned python<=3.9 regardless of the matrix value.
- read_csv(delim_whitespace=True) removed in pandas 2.2; use sep=r"\s+" - date_range freq alias 'M' replaced by 'ME' (MonthEnd) Surfaced by CI matrix extension to Python 3.11-3.13, which pulls in pandas >=2.2.
Add pytest-github-actions-annotate-failures plugin so failing assertions surface as inline annotations on PRs (Files Changed + Checks tab) instead of buried in raw log output.
koldunovn
approved these changes
May 12, 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.
Summary
pkg_resources(removed in setuptools 81) with stdlibimportlib.resources.filesinpyfesom2/ut.py. Resolves theModuleNotFoundError: No module named 'pkg_resources'reported in ModuleNotFoundError: No module named 'pkg_resources' for python 3.12.13 and setuptools 82.0.1 #236 on Python 3.12 + setuptools 82.0.1.ci/requirements-py37.yml->ci/requirements.yml, and updates Dockerfile/README/docs/setup.py/tox.ini/CONTRIBUTING accordingly.CI previously could not have caught #236 because the env file pinned
python<=3.9regardless of thematrix.python-versionvalue, so all jobs effectively ran on Python 3.9 (wherepkg_resourcesstill ships).Split into two commits so the bug fix can be cherry-picked independently of the modernization sweep.
Fixes #236
Test plan
python -c "import pyfesom2"succeeds with setuptools >=81get_maskworks forMOCBasins,NinoRegions,oceanBasinsregionsci/requirements.yml