Skip to content

Update caper for compatibility with Python 3.12+ #207

@mihirsamdarshi

Description

@mihirsamdarshi

When running with Python 3.12, the latest version of caper CLI (2.3.2) fails to run due to a dependency on the deprecated distutils package.

Reproduction: (uvx is used to install and run a Python CLI tool in an isolated venv)

docker run -it ghcr.io/astral-sh/uv:python3.12-bookworm-slim uvx caper -v

Output:

Installed 70 packages in 320ms
Traceback (most recent call last):
  File "/root/.cache/uv/archive-v0/P0Uct19t8BntLJuBLLj9W/bin/caper", line 5, in <module>
    from caper.cli import main
  File "/root/.cache/uv/archive-v0/P0Uct19t8BntLJuBLLj9W/lib/python3.12/site-packages/caper/cli.py", line 13, in <module>
    from .caper_args import ResourceAnalysisReductionMethod, get_parser_and_defaults
  File "/root/.cache/uv/archive-v0/P0Uct19t8BntLJuBLLj9W/lib/python3.12/site-packages/caper/caper_args.py", line 7, in <module>
    from .arg_tool import update_parsers_defaults_with_conf
  File "/root/.cache/uv/archive-v0/P0Uct19t8BntLJuBLLj9W/lib/python3.12/site-packages/caper/arg_tool.py", line 5, in <module>
    from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions