Skip to content

Facelift for reproman to make CI pass and support recent pythons#640

Open
yarikoptic wants to merge 2 commits intomasterfrom
bf-ci
Open

Facelift for reproman to make CI pass and support recent pythons#640
yarikoptic wants to merge 2 commits intomasterfrom
bf-ci

Conversation

@yarikoptic
Copy link
Copy Markdown
Member

No description provided.

yarikoptic and others added 2 commits April 12, 2026 01:10
- Drop Python 3.9 support, require >= 3.10
- Replace distutils imports with setuptools equivalents (distutils
  removed in Python 3.12+)
- Replace removed setuptools.findall with glob.glob
- Switch from distutils.version.LooseVersion to looseversion PyPI
  package, add it to dependencies
- Replace pkg_resources with importlib.metadata for version discovery
- Remove broken `python setup.py develop` from tox commands (tox
  handles package installation)
- Add testpaths to pyproject.toml to scope pytest discovery
- Add py313, py314 to tox envlist
- Pass USER, DBUS_SESSION_BUS_ADDRESS in tox passenv for
  docker-credential-secretservice compatibility
- Handle chardet 6+/7 encoding_era changes with _chardet_detect()
  wrapper and update test expectations
- Fix test_ls_interface to accept both CONNECTION ERROR and NOT FOUND
  for EC2 resources with fake credentials (varies by boto3 version)

Co-Authored-By: Claude Code 2.1.104 / Claude Opus 4.6 <noreply@anthropic.com>
- Drop Python 3.9 from test matrix (now requires >=3.10)
- Move datalad/slurm/ssh integration tests to Python 3.10 entry
- Remove redundant `python setup.py build` step (deprecated
  setup_requires/fetch_build_eggs causes CI failures)
- Update actions/checkout v2/v3 → v4
- Update actions/setup-python v3/v4 → v5
- Update codecov/codecov-action v1 → v4

Co-Authored-By: Claude Code 2.1.104 / Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the project's minimum Python requirement to 3.10 and migrates from the deprecated distutils library to setuptools and looseversion. It also updates chardet integration to support version 6+ by introducing a wrapper that handles the new encoding_era parameter and improves error handling during unicode decoding. Additionally, test cases were adjusted for EC2 resource reporting and chardet's detection behavior. A review comment suggests hardening the chardet version check in reproman/utils.py to prevent a TypeError when the library is missing or its version cannot be determined.

Comment on lines +508 to +511
if external_versions['chardet'] >= '6':
from chardet.enums import EncodingEra
return detect(s, encoding_era=EncodingEra.ALL)
return detect(s)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comparison external_versions['chardet'] >= '6' will raise a TypeError if chardet is not installed (returning None) or if its version cannot be determined (returning UNKNOWN). Since reproman aims to handle missing external dependencies gracefully, it is safer to check that the version is valid before performing the comparison.

Suggested change
if external_versions['chardet'] >= '6':
from chardet.enums import EncodingEra
return detect(s, encoding_era=EncodingEra.ALL)
return detect(s)
chardet_ver = external_versions['chardet']
if chardet_ver and chardet_ver is not external_versions.UNKNOWN and chardet_ver >= '6':
from chardet.enums import EncodingEra
return detect(s, encoding_era=EncodingEra.ALL)
return detect(s)

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.

1 participant