You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pre-commit scripts test and format rely on /bin/sh, which does not exist on Windows (at least the path). This is a non-portable shebang, which can be fixed by using #!/usr/bin/env sh instead.
Steps to reproduce
Follow the Contributing steps to:
(a) Fork the repo, install dependencies through poetry, and setup the pre-commit hooks
Run pre-commit run --all
Current behavior
On Windows, the pre-commit hooks format and linter and test fail with the error message Executable '/bin/sh' not found.
Desired behavior
The pre-commit hooks are able to run the provided shell scripts.
Screenshots
Environment
Commitizen Version: 2.35.0
Python Version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Operating System: Windows
Substituting the portable shebang works. However, pytest reports many failing tests and errors (completely unrelated to the changes). The following report was generated with pytest-html:
Hi @adam-grant-hendry , thanks for your report. The html seems to miss some style and barely readable now. Could you guide me through on how to view it correctly? Or could you please share a few example on what you're testing and what's not working even with shebang?
The html seems to miss some style and barely readable now. Could you guide me through on how to view it correctly?
I forgot to zip the CSS assets with it, my mistake. I updated the link, so please try downloading and unzipping again. You should see a folder assets with a file style.css in addition to pytest_report.html that will help it render properly.
I ask because both format and test scripts are sh (e.g. bash and co) scripts that assume an appropriate environment.
I use vanilla Windows. The fact the test scripts require that environment is not specified in the Contributing Guide. Rather than switching over to WSL or Cygwin/MSYS, I changed the shebang to a portable variant. My users use Windows, so I develop on Windows (it's easier for me to find problems and help them that way).
Regardless, the greater problem is your Windows CI doesn't run. Even if I switched to WSL or Cygwin/MSYS, I have no confidence that commitizen will work for my PowerShell users.
Is commitizen intended only to be used by bash/sh users? That's going to cut off a lot of end users from using it, especially if they're in a restricted environment (e.g. corporate setting) that does not permit them to use these shells.
I just saw your test output. Could you please install https://gnupg.org/download/ and see how it works? It seems the doc is outdated. Before we add it to the doc, let's verify whether installing gpg fix it
Is commitizen intended only to be used by bash/sh users? T
Ideally, no. We hope this project can be used by all users.
I just saw your test output. Could you please install https://gnupg.org/download/ and see how it works? It seems the doc is outdated. Before we add it to the doc, let's verify whether installing gpg fix it
I installed that and also tested out gpg.exe that ships with Git for Windows (it resides in C:\Program Files\Git\usr\bin. Both work well.
All tests are now passing in PR #605, so I was able to fix all the errors previously experienced on Windows. Please kindly re-review it at your earliest convenience.
Activity
adam-grant-hendry commentedon Oct 14, 2022
Substituting the portable shebang works. However,
pytestreports many failing tests and errors (completely unrelated to the changes). The following report was generated withpytest-html:pytest_report.zip
Lee-W commentedon Oct 17, 2022
Hi @adam-grant-hendry , thanks for your report. The html seems to miss some style and barely readable now. Could you guide me through on how to view it correctly? Or could you please share a few example on what you're testing and what's not working even with shebang?
jenstroeger commentedon Oct 17, 2022
@adam-grant-hendry are you on vanilla Windows, or do you use WSL or some other *NIX port on Windows?
I ask because both format and test scripts are
sh(e.g.bashand co) scripts that assume an appropriate environment.adam-grant-hendry commentedon Oct 17, 2022
I forgot to zip the CSS assets with it, my mistake. I updated the link, so please try downloading and unzipping again. You should see a folder
assetswith a filestyle.cssin addition topytest_report.htmlthat will help it render properly.I use vanilla Windows. The fact the test scripts require that environment is not specified in the Contributing Guide. Rather than switching over to WSL or Cygwin/MSYS, I changed the shebang to a portable variant. My users use Windows, so I develop on Windows (it's easier for me to find problems and help them that way).
Regardless, the greater problem is your Windows CI doesn't run. Even if I switched to WSL or Cygwin/MSYS, I have no confidence that
commitizenwill work for my PowerShell users.Is
commitizenintended only to be used bybash/shusers? That's going to cut off a lot of end users from using it, especially if they're in a restricted environment (e.g. corporate setting) that does not permit them to use these shells.Lee-W commentedon Oct 20, 2022
I just saw your test output. Could you please install https://gnupg.org/download/ and see how it works? It seems the doc is outdated. Before we add it to the doc, let's verify whether installing gpg fix it
Ideally, no. We hope this project can be used by all users.
adam-grant-hendry commentedon Oct 20, 2022
I installed that and also tested out
gpg.exethat ships with Git for Windows (it resides inC:\Program Files\Git\usr\bin. Both work well.All tests are now passing in PR #605, so I was able to fix all the errors previously experienced on Windows. Please kindly re-review it at your earliest convenience.
Thank you!