conda-forge / conda-forge/pre-commit-feedstock

pre-commit run tries to install packages on windows, fails

Open
#88 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Batchfile
Stars
1
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Solution to issue cannot be found in the documentation.

- [x] I checked the documentation.

### Issue

I installed `pre-commit` for one of conda-forge's own repos, and tried to run the required `pre-commit run -a`. The result was

```
(builder) E:\conda-forge\conda-forge-repodata-patches-feedstock>pre-commit run -a
[INFO] Initializing environment for https://github.com/pycqa/flake8.
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Installing environment for https://github.com/pycqa/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\xxx\\.cache\\pre-commit\\repopfeh2uz4\\py_env-default\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
Processing c:\users\xxx\.cache\pre-commit\repopfeh2uz4
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
stderr:
error: subprocess-exited-with-error

Preparing metadata (pyproject.toml) did not run successfully.
exit code: 1

[54 lines of output]
WARNING setuptools_scm.run_cmd command git missing: [WinError 2] The system cannot find the file specified
ERROR setuptools_scm._get_version_impl command git not found while parsing the scm, using fallbacks
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-f1o6rdlz\overlay\Lib\site-packages\setuptools_scm\_get_version_impl.py", line 40, in parse_scm_version
return _entrypoints.version_from_entrypoint(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-f1o6rdlz\overlay\Lib\site-packages\setuptools_scm\_entrypoints.py", line 57, in version_from_entrypoint
maybe_version: version.ScmVersion | None = fn(root, config=config)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-f1o6rdlz\overlay\Lib\site-packages\setuptools_scm\git.py", line 212, in parse
_require_command("git")
File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-f1o6rdlz\overlay\Lib\site-packages\setuptools_scm\_run_cmd.py", line 214, in require_command
raise CommandNotFoundError(name)
setuptools_scm._run_cmd.CommandNotFoundError: git
```

Obviously I have git available on my system, just not in that environment. I could install it there too, but the larger point is that IMO `pre-commit` (at least in conda-forge!) shouldn't try to rebuild anything from scratch - we have all the required packages available, and could make them direct dependencies of `pre-commit`.

### Installed packages

```
(builder) E:\conda-forge\conda-forge-repodata-patches-feedstock>conda list
# packages in environment at E:\miniforge\envs\builder:
#
# Name Version Build Channel
anaconda-client 1.12.3 pyhd8ed1ab_1 conda-forge
anaconda-project 0.11.1 pyhd8ed1ab_0 conda-forge
annotated-types 0.7.0 pyhd8ed1ab_0 conda-forge
anyio 4.6.0 pyhd8ed1ab_1 conda-forge
archspec 0.2.3 pyhd8ed1ab_0 conda-forge
attrs 24.2.0 pyh71513ae_0 conda-forge
backports 1.0 pyhd8ed1ab_4 conda-forge
backports.strenum 1.2.8 pyhd8ed1ab_0 conda-forge
backports.tarfile 1.0.0 pyhd8ed1ab_1 conda-forge
beautifulsoup4 4.12.3 pyha770c72_0 conda-forge
black 24.10.0 py311h1ea47a8_0 conda-forge
blinker 1.8.2 pyhd8ed1ab_0 conda-forge
boltons 24.0.0 pyhd8ed1ab_0 conda-forge
boolean.py 4.0 pyhd8ed1ab_0 conda-forge
brotli 1.1.0 h2466b09_2 conda-forge
brotli-bin 1.1.0 h2466b09_2 conda-forge
brotli-python 1.1.0 py311hda3d55a_2 conda-forge
bzip2 1.0.8 h2466b09_7 conda-forge
ca-certificates 2024.8.30 h56e8100_0 conda-forge
cairo 1.18.0 h32b962e_3 conda-forge
certifi 2024.8.30 pyhd8ed1ab_0 conda-forge
cffi 1.17.1 py311he736701_0 conda-forge
cfgv 3.3.1 pyhd8ed1ab_0 conda-forge
chardet 5.2.0 py311h1ea47a8_2 conda-forge
charset-normalizer 3.4.0 pyhd8ed1ab_0 conda-forge
cirun 0.30 pyhd8ed1ab_0 conda-forge
click 8.1.7 win_pyh7428d3b_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
conda 24.9.1 py311h1ea47a8_0 conda-forge
conda-build 24.9.0 py311h1ea47a8_0 conda-forge
conda-forge-pinning 2024.10.12.13.15.35 hd8ed1ab_0 conda-forge
conda-index 0.5.0 pyhd8ed1ab_0 conda-forge
conda-libmamba-solver 24.9.0 pyhd8ed1ab_0 conda-forge
conda-pack 0.8.0 pyhd8ed1ab_0 conda-forge
conda-package-handling 2.3.0 pyh7900ff3_0 conda-forge
conda-package-streaming 0.10.0 pyhd8ed1ab_0 conda-forge
conda-recipe-manager 0.3.0 pyhd8ed1ab_0 conda-forge
conda-smithy 3.42.1 win_pyh7428d3b_0 conda-forge
conda-souschef 2.2.3 pyhd8ed1ab_0 conda-forge
contourpy 1.3.0 py311h3257749_2 conda-forge
cpython 3.11.10 py311hd8ed1ab_2 conda-forge
cryptography 43.0.1 py311hfd75b31_0 conda-forge
cycler 0.12.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
deprecated 1.2.14 pyh1a96a4e_0 conda-forge
distlib 0.3.9 pyhd8ed1ab_0 conda-forge
distro 1.9.0 pyhd8ed1ab_0 conda-forge
editables 0.5 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.2.2 pyhd8ed1ab_0 conda-forge
expat 2.6.3 he0c23c2_0 conda-forge
filelock 3.16.1 pyhd8ed1ab_0 conda-forge
fmt 11.0.2 h7f575de_0 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 h77eed37_3 conda-forge
fontconfig 2.14.2 hbde0cde_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.54.1 py311he736701_0 conda-forge
freetype 2.12.1 hdaf720e_2 conda-forge
fribidi 1.0.10 h8d14728_0 conda-forge
frozendict 2.4.5 py311he736701_0 conda-forge
getopt-win32 0.1 hcfcfb64_1 conda-forge
gitdb 4.0.11 pyhd8ed1ab_0 conda-forge
gitpython 3.1.43 pyhd8ed1ab_0 conda-forge
graphite2 1.3.13 h63175ca_1003 conda-forge
graphviz 12.0.0 hb01754f_0 conda-forge
grayskull 2.7.3 pyhd8ed1ab_0 conda-forge
greyskull 2.7.3 hd8ed1ab_0 conda-forge
gts 0.7.6 h6b5321d_4 conda-forge
h11 0.14.0 pyhd8ed1ab_0 conda-forge
h2 4.1.0 pyhd8ed1ab_0 conda-forge
harfbuzz 9.0.0 h2bedf89_1 conda-forge
hatch 1.12.0 pyhd8ed1ab_0 conda-forge
hatchling 1.25.0 pyhd8ed1ab_0 conda-forge
hpack 4.0.0 pyh9f0ad1d_0 conda-forge
httpcore 1.0.6 pyhd8ed1ab_0 conda-forge
httpx 0.27.2 pyhd8ed1ab_0 conda-forge
hyperframe 6.0.1 pyhd8ed1ab_0 conda-forge
hyperlink 21.0.0 pyhd3deb0d_0 conda-forge
icu 75.1 he0c23c2_0 conda-forge
identify 2.6.1 pyhd8ed1ab_0 conda-forge
idna 3.10 pyhd8ed1ab_0 conda-forge
importlib-metadata 8.5.0 pyha770c72_0 conda-forge
importlib_metadata 8.5.0 hd8ed1ab_0 conda-forge
importlib_resources 6.4.5 pyhd8ed1ab_0 conda-forge
iniconfig 2.0.0 pyhd8ed1ab_0 conda-forge
intel-openmp 2024.2.1 h57928b3_1083 conda-forge
isodate 0.7.2 pyhd8ed1ab_0 conda-forge
jaraco.classes 3.4.0 pyhd8ed1ab_1 conda-forge
jaraco.context 5.3.0 pyhd8ed1ab_1 conda-forge
jaraco.functools 4.0.0 pyhd8ed1ab_0 conda-forge
jinja2 3.1.4 pyhd8ed1ab_0 conda-forge
jsonpatch 1.33 pyhd8ed1ab_0 conda-forge
jsonpointer 3.0.0 py311h1ea47a8_1 conda-forge
jsonschema 4.23.0 pyhd8ed1ab_0 conda-forge
jsonschema-specifications 2024.10.1 pyhd8ed1ab_0 conda-forge
jupyter_core 5.7.2 pyh5737063_1 conda-forge
keyring 25.4.1 pyh7428d3b_0 conda-forge
kiwisolver 1.4.7 py311h3257749_0 conda-forge
krb5 1.21.3 hdf4eb48_0 conda-forge
lcms2 2.16 h67d730c_0 conda-forge
lerc 4.0.0 h63175ca_0 conda-forge
libarchive 3.7.4 haf234dc_0 conda-forge
libblas 3.9.0 24_win64_mkl conda-forge
libbrotlicommon 1.1.0 h2466b09_2 conda-forge
libbrotlidec 1.1.0 h2466b09_2 conda-forge
libbrotlienc 1.1.0 h2466b09_2 conda-forge
libcblas 3.9.0 24_win64_mkl conda-forge
libcurl 8.10.1 h1ee3ff0_0 conda-forge
libdeflate 1.21 h2466b09_0 conda-forge
libexpat 2.6.3 he0c23c2_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libgd 2.3.3 h085315d_10 conda-forge
libglib 2.82.1 h7025463_0 conda-forge
libhwloc 2.11.1 default_h8125262_1000 conda-forge
libiconv 1.17 hcfcfb64_2 conda-forge
libintl 0.22.5 h5728263_3 conda-forge
libjpeg-turbo 3.0.0 hcfcfb64_1 conda-forge
liblapack 3.9.0 24_win64_mkl conda-forge
liblief 0.14.1 he0c23c2_2 conda-forge
libmamba 1.5.10 h81425b0_1 conda-forge
libmambapy 1.5.10 py311haa87166_1 conda-forge
libpng 1.6.44 h3ca93ac_0 conda-forge
libsodium 1.0.20 hc70643c_0 conda-forge
libsolv 0.7.30 hbb528cf_0 conda-forge
libsqlite 3.46.1 h2466b09_0 conda-forge
libssh2 1.11.0 h7dfc565_0 conda-forge
libtiff 4.6.0 hb151862_4 conda-forge
libwebp-base 1.4.0 hcfcfb64_0 conda-forge
libxcb 1.16 h013a479_1 conda-forge
libxml2 2.12.7 h0f24e4e_4 conda-forge
libzlib 1.3.1 h2466b09_2 conda-forge
license-expression 30.3.1 pyhd8ed1ab_0 conda-forge
lz4-c 1.9.4 hcfcfb64_0 conda-forge
lzo 2.10 hcfcfb64_1001 conda-forge
m2-msys2-runtime 2.5.0.17080.65c939c 3 conda-forge
m2-patch 2.7.5 2 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
markdown-it-py 3.0.0 pyhd8ed1ab_0 conda-forge
markupsafe 3.0.1 py311h5082efb_1 conda-forge
matplotlib-base 3.9.2 py311h8f1b1e4_1 conda-forge
mdurl 0.1.2 pyhd8ed1ab_0 conda-forge
menuinst 2.1.2 py311hda3d55a_1 conda-forge
mkl 2024.1.0 h66d3029_694 conda-forge
more-itertools 10.5.0 pyhd8ed1ab_0 conda-forge
msrest 0.6.21 pyh44b312d_0 conda-forge
msys2-conda-epoch 20160418 1 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mypy_extensions 1.0.0 pyha770c72_0 conda-forge
nbformat 5.10.4 pyhd8ed1ab_0 conda-forge
networkx 3.4.1 pyhd8ed1ab_0 conda-forge
nodeenv 1.9.1 pyhd8ed1ab_0 conda-forge
numpy 2.1.2 py311h35ffc71_0 conda-forge
oauthlib 3.2.2 pyhd8ed1ab_0 conda-forge
openjpeg 2.5.2 h3d672ee_0 conda-forge
openssl 3.3.2 h2466b09_0 conda-forge
packaging 24.1 pyhd8ed1ab_0 conda-forge
pango 1.54.0 hbb871f6_2 conda-forge
pathspec 0.12.1 pyhd8ed1ab_0 conda-forge
pcre2 10.44 h3d7b363_2 conda-forge
pexpect 4.9.0 pyhd8ed1ab_0 conda-forge
pillow 10.4.0 py311h5592be9_1 conda-forge
pip 24.2 pyh8b19718_1 conda-forge
pixman 0.43.4 h63175ca_0 conda-forge
pkginfo 1.11.2 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_1 conda-forge
platformdirs 4.3.6 pyhd8ed1ab_0 conda-forge
pluggy 1.5.0 pyhd8ed1ab_0 conda-forge
pre-commit 4.0.1 pyha770c72_0 conda-forge
progressbar2 4.5.0 pyhd8ed1ab_0 conda-forge
psutil 6.0.0 py311he736701_1 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
pthreads-win32 2.9.1 h2466b09_4 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
py-lief 0.14.1 py311hda3d55a_2 conda-forge
pybind11-abi 4 hd8ed1ab_3 conda-forge
pycosat 0.6.6 py311ha68e1ae_0 conda-forge
pycparser 2.22 pyhd8ed1ab_0 conda-forge
pycryptodome 3.20.0 py311he736701_1 conda-forge
pydantic 2.9.2 pyhd8ed1ab_0 conda-forge
pydantic-core 2.23.4 py311h533ab2d_0 conda-forge
pygithub 2.4.0 pyhd8ed1ab_0 conda-forge
pygments 2.18.0 pyhd8ed1ab_0 conda-forge
pygraphviz 1.14 py311h228682d_0 conda-forge
pyjwt 2.9.0 pyhd8ed1ab_1 conda-forge
pynacl 1.5.0 py311h984d3dc_4 conda-forge
pyparsing 3.1.4 pyhd8ed1ab_0 conda-forge
pysocks 1.7.1 pyh0701188_6 conda-forge
pytest 8.3.3 pyhd8ed1ab_0 conda-forge
python 3.11.10 hce54a09_2_cpython conda-forge
python-dateutil 2.9.0 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.20.0 pyhd8ed1ab_0 conda-forge
python-libarchive-c 5.1 py311h1ea47a8_1 conda-forge
python-utils 3.8.2 pyhd8ed1ab_0 conda-forge
python_abi 3.11 5_cp311 conda-forge
pytz 2024.2 pyhd8ed1ab_0 conda-forge
pywin32 307 py311hda3d55a_3 conda-forge
pywin32-ctypes 0.2.3 py311h1ea47a8_1 conda-forge
pyyaml 6.0.2 py311he736701_1 conda-forge
qhull 2020.2 hc790b64_5 conda-forge
rapidfuzz 3.10.0 py311hda3d55a_0 conda-forge
rattler-build 0.26.0 h49672d7_0 conda-forge
rattler-build-conda-compat 1.2.2 pyhd8ed1ab_0 conda-forge
referencing 0.35.1 pyhd8ed1ab_0 conda-forge
reproc 14.2.4.post0 hcfcfb64_1 conda-forge
reproc-cpp 14.2.4.post0 h63175ca_1 conda-forge
requests 2.32.3 pyhd8ed1ab_0 conda-forge
requests-oauthlib 2.0.0 pyhd8ed1ab_0 conda-forge
requests-toolbelt 1.0.0 pyhd8ed1ab_0 conda-forge
rich 13.9.2 pyhd8ed1ab_0 conda-forge
ripgrep 14.1.0 ha073cba_1 conda-forge
rpds-py 0.20.0 py311h533ab2d_1 conda-forge
ruamel.yaml 0.18.6 py311he736701_1 conda-forge
ruamel.yaml.clib 0.2.8 py311he736701_1 conda-forge
ruamel.yaml.jinja2 0.2.7 pyhd8ed1ab_0 conda-forge
ruamel_yaml 0.15.80 py311ha68e1ae_1009 conda-forge
scrypt 0.8.27 py311h715f7de_0 conda-forge
semver 3.0.2 pyhd8ed1ab_0 conda-forge
setuptools 75.1.0 pyhd8ed1ab_0 conda-forge
shellingham 1.5.4 pyhd8ed1ab_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
smmap 5.0.0 pyhd8ed1ab_0 conda-forge
sniffio 1.3.1 pyhd8ed1ab_0 conda-forge
soupsieve 2.5 pyhd8ed1ab_1 conda-forge
stdlib-list 0.10.0 pyhd8ed1ab_0 conda-forge
tbb 2021.13.0 hc790b64_0 conda-forge
tk 8.6.13 h5226925_1 conda-forge
tomli 2.0.2 pyhd8ed1ab_0 conda-forge
tomli-w 1.1.0 pyhd8ed1ab_0 conda-forge
tomlkit 0.13.2 pyha770c72_0 conda-forge
toolz 1.0.0 pyhd8ed1ab_0 conda-forge
tornado 6.4.1 py311he736701_1 conda-forge
tqdm 4.66.5 pyhd8ed1ab_0 conda-forge
traitlets 5.14.3 pyhd8ed1ab_0 conda-forge
trove-classifiers 2024.10.12 pyhd8ed1ab_0 conda-forge
truststore 0.9.2 pyhd8ed1ab_0 conda-forge
typer 0.12.5 pyhd8ed1ab_0 conda-forge
typer-slim 0.12.5 pyhd8ed1ab_0 conda-forge
typer-slim-standard 0.12.5 hd8ed1ab_0 conda-forge
typing-extensions 4.12.2 hd8ed1ab_0 conda-forge
typing_extensions 4.12.2 pyha770c72_0 conda-forge
tzdata 2024b hc8b5060_0 conda-forge
ucrt 10.0.22621.0 h57928b3_1 conda-forge
ukkonen 1.0.1 py311h3257749_5 conda-forge
urllib3 2.2.3 pyhd8ed1ab_0 conda-forge
userpath 1.7.0 pyhd8ed1ab_0 conda-forge
uv 0.4.20 ha08ef0e_0 conda-forge
vc 14.3 h8a93ad2_22 conda-forge
vc14_runtime 14.40.33810 hcc2c482_22 conda-forge
virtualenv 20.26.6 pyhd8ed1ab_0 conda-forge
vs2015_runtime 14.40.33810 h3bf8584_22 conda-forge
vsts-python-api 0.1.25 pyhd8ed1ab_1 conda-forge
wheel 0.44.0 pyhd8ed1ab_0 conda-forge
win_inet_pton 1.1.0 pyh7428d3b_7 conda-forge
wrapt 1.16.0 py311he736701_1 conda-forge
xorg-kbproto 1.0.7 hcd874cb_1002 conda-forge
xorg-libice 1.1.1 hcd874cb_0 conda-forge
xorg-libsm 1.2.4 hcd874cb_0 conda-forge
xorg-libx11 1.8.9 h0076a8d_1 conda-forge
xorg-libxau 1.0.11 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xorg-libxext 1.3.4 hcd874cb_2 conda-forge
xorg-libxpm 3.5.17 hcd874cb_0 conda-forge
xorg-libxt 1.3.0 hcd874cb_1 conda-forge
xorg-xextproto 7.3.0 hcd874cb_1003 conda-forge
xorg-xproto 7.0.31 hcd874cb_1007 conda-forge
xz 5.2.6 h8d14728_0 conda-forge
yaml 0.2.5 h8ffe710_2 conda-forge
yaml-cpp 0.8.0 h63175ca_0 conda-forge
zipp 3.20.2 pyhd8ed1ab_0 conda-forge
zlib 1.3.1 h2466b09_2 conda-forge
zstandard 0.23.0 py311h53056dc_1 conda-forge
zstd 1.5.6 h0ea2cb4_0 conda-forge
```

### Environment info

```
active environment : builder
active env location : E:\miniforge\envs\builder
shell level : 1
user config file : C:\Users\xxx\.condarc
populated config files : C:\ProgramData\miniforge\.condarc
C:\Users\xxx\.condarc
conda version : 24.9.1
conda-build version : not installed
python version : 3.11.10.final.0
solver : libmamba (default)
virtual packages : __archspec=1=skylake
__conda=24.9.1=0
__win=0=0
base environment : C:\ProgramData\miniforge (read only)
conda av data dir : C:\ProgramData\miniforge\etc\conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
package cache : E:\miniforge\pkgs
C:\ProgramData\miniforge\pkgs
C:\Users\xxx\.conda\pkgs
C:\Users\xxx\AppData\Local\conda\conda\pkgs
envs directories : E:\miniforge\envs
C:\Users\xxx\.conda\envs
C:\ProgramData\miniforge\envs
C:\Users\xxx\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/24.9.1 requests/2.32.3 CPython/3.11.10 Windows/10 Windows/10.0.22631 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.10
administrator : False
netrc file : None
offline mode : False
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.