8000 Unable to determine how to use pre-existing virtualenv for a hook · Issue #266 · pre-commit/pre-commit · GitHub
[go: up one dir, main page]

Skip to content
Unable to determine how to use pre-existing virtualenv for a hook #266
@EliRibble

Description

@EliRibble

Sorry, I'm not sure if an issue is the right place to put this, but considering I've spent some time reading source and docs and haven't found the answer it seems fair to consider this a documentation bug.

My use case is this: I have many Python projects I work on. Each one has its own virtualenv where I install the dependencies. I'd like to use pre-commit to run pylint. Pylint needs to run out of the same virtualenv as the project so that it can import the dependencies for its static analysis. When running the pylint hook from https://github.com/pre-commit/mirrors-pylint it appears that the command that is actually run is:

bash -c . '/Users/eliribble/.pre-commit/repoq_elftwa/py_env-default/bin/activate' && xargs -0 -s4000 pylint

Looking at the source and the docs I can't find a way to indicate to the hook that it should use my virtualenv for the project rather than the virtualenv at /Users/eliribble/.pre-commit/repoq_elftwa/py_env-default. Is there a way to do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0