neuroinformatics-unit / python-cookiecutter

Utility to create a basic Python project structure with tests, CI etc.
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

Add wheel as dependency to check-manifest #126

Open sfmig opened 4 weeks ago

sfmig commented 4 weeks ago

Problem

With Python 3.12, pre-commit run check-manifest returns an error of missing dependencies.

image

According to this issue this is due to a change in behaviour in Python 3.12, in which apparently wheel is no longer preinstalled with virtualenv / venv. See release notes too.

Proposed solution

Option 1: adding wheel as an additional dependency in .pre-commit-config.yaml. This is implemented in this PR.

  - repo: https://github.com/mgedmin/check-manifest
    rev: "0.49"
    hooks:
        - id: check-manifest
          args: [--no-build-isolation]
          additional_dependencies: [setuptools-scm, wheel]

Option 2: specifying a language version for Python in check-manifest. Feels less flexible.

  - repo: https://github.com/mgedmin/check-manifest
    rev: "0.49"
    hooks:
        - id: check-manifest
          args: [--no-build-isolation]
          language_version: "3.12"
          additional_dependencies: [setuptools-scm]

Questions

adamltyson commented 4 weeks ago

Option 1 sounds sensible to me