-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poetry install
run under pre-commit hook does not apply changes.
#9393
Comments
I expect you have not read the docs telling you about the extra things you need to do when using this hook https://python-poetry.org/docs/pre-commit-hooks#poetry-install |
Thanks - I've added a transcript of the output and clarified the hooks in the pre-commit file. Am I missing something else? The docs say something about args but that pre-commit file should be applying to the venv? |
And is the python you are running at |
Yes - they are run back to back in the same terminal, |
not a pre-commit user myself, but so far as I know pre-commit likes to run in its own virtual environment. trying it myself it seems as though it is attempting to install the project packages in the virtual environment containing the pre-commit poetry: which is both doing nothing for the virtual environment that you care about - and likely to fail altogether when the poetry requirements clash with the project requirements. seems completely broken to me, perhaps we should try asking someone from #8327 what we have misunderstood @alsmnn @radoering |
I do not use the poetry pre-commit hooks myself, but trying it I can confirm that this hook seems broken - and I wonder how/if it has ever worked. |
default_install_hook_types: [pre-commit, post-checkout, post-merge]
repos:
- repo: local
hooks:
- id: poetry-install
name: poetry-install
args: ["--sync"]
language: system
entry: poetry install
stages: [post-checkout, post-merge]
pass_filenames: false
always_run: true
verbose: true The |
Description
pre-commit run poetry-install
passed but acted as no-op.The expected package was not in the venv.
A regular:
poetry install
noticed the missing package.Workarounds
Manually poetry install.
Poetry Installation Method
pipx
Operating System
Win 10
Poetry Version
v1.8.2
Poetry Configuration
Python Sysconfig
Example pyproject.toml
Precommit:
Repo Transcript
The text was updated successfully, but these errors were encountered: