Skip to content
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

Possible to configure a hook so pip installs "extras"? #1526

Closed
max-sixty opened this issue Jun 26, 2020 · 3 comments
Closed

Possible to configure a hook so pip installs "extras"? #1526

max-sixty opened this issue Jun 26, 2020 · 3 comments

Comments

@max-sixty
Copy link

When isort is installed as part of a pre-commit hook, it needs to be installed with setuptools' "extras" for pyproject.

This is installed with pip install isort[pyproject] rather than the default install of pip install isort. When installing from a local repo, the command is pip install .[pyproject]

Is it possible to specify that in a .pre-commit-hooks.yaml?

Ref PyCQA/isort#1225

Thank you!

@asottile
Copy link
Member

I believe you're looking for additional_dependencies

@asottile
Copy link
Member

specifically:

-   id: isort
    additional_dependencies: ['.[pyproject]']

or whatever extra you want

@glasserc
Copy link

Ah, this used to bite me all the time! This solution (.[extra]) is a lot nicer than anything I ever came up with. I wonder if it's worth noting this trick in the docs somewhere? I guess it's low priority because isort no longer has these set up as extras, but still, this is a really nice solution and I feel like it should be more visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants