OpenInterpreter / 01

The open-source language model computer
http://openinterpreter.com/01
GNU Affero General Public License v3.0
4.76k stars 470 forks source link

Pre-commit fails at "pytest" step #210

Closed dheavy closed 3 months ago

dheavy commented 3 months ago

Describe the bug When committing changes, the pre-commit task is ran. It currently fails at the pytest step with the following error:

[...previous content removed fore brevity]

pytest...................................................................Failed
- hook id: pytest
- exit code: 1

Executable `pytest` not found

To Reproduce Steps to reproduce the behavior:

  1. Make a change in the code eliciting a git diff
  2. Commit the code to trigger the pre-commit hook
  3. See the error

Expected behavior The pre-commit hook passes, unless a test isn't green.

Screenshots

Screenshot 2024-04-01 at 13 05 42

Desktop (please complete the following information):

Additional context

Finalizing the pre-commit hook de-incentivizes contributor to bypass it with --no-verify. Furthermore, its task could be added to the Github actions pipeline. All of which would help streamline contributions for a more stable code base.

dheavy commented 3 months ago

After a quick investigation, this is due to not being in the virtual env while doing a commit.

I'll propose a PR to the CONTRIBUTING file to make it clear... ...and/or change the pre-commit config to have it use the current python (which is not necessarily system, it could be one from a venv)