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

Pre-commit.ci actions fail: check-manifest and ensurepip error #67

Closed lauraporta closed 1 year ago

lauraporta commented 1 year ago

Describe the bug I am testing the new version of the cookiecutter in the package rsp_vision and I have spotted a bug in the newly introduced hook for check_manifest. pre-commit run --all-files and check-manifest alone run with no problems locally and on Actions, but pre-commit.ci fail.

To Reproduce I added the new modifications via cruft. Follow our tutorial for more details.

Expected behaviour I expected pre-commit.ci to give me the same output of pre-commit and check-manifest.

Log file

check docstring is first.................................................Passed
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts................................................Passed
check toml...............................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
fix requirements.txt.................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
ruff.....................................................................Passed
black....................................................................Passed
mypy.....................................................................Passed
check-manifest...........................................................Failed
- hook id: check-manifest
- exit code: 2

['/pc/clone/TAKS1oo8Q1iJjs2ocS4O2A/py_env-python3/bin/python', '-m', 'build', '--sdist', '.', '--outdir', '/tmp/check-manifest-tafqwydp-sdist'] failed (status 1):
* Creating venv isolated environment...
ERROR Failed to create venv. Maybe try installing virtualenv.
  Command '/tmp/build-env-tewll_oj/bin/python3.11 -m ensurepip --upgrade --default-pip' failed with return code 1
  stdout:
    /tmp/build-env-tewll_oj/bin/python3.11: No module named ensurepip

Is this the same of #59 ?

Possible Solution ensurepip does not need to be installed, it is part of the standard library I think.

However I cannot see where the installation of ensurepip is specified. Not sure how to solve this

lauraporta commented 1 year ago

I have found a discussion on this same bug 👉🏻 in the original repo from which check-manifest hook was cloned from