Skip to content

venv importing in pre-commit #37

@jag-k

Description

@jag-k

Add configuration to specify the Python venv path or specify a dependency manager.

Possible future values:

  • venv: auto - Default value. Will try to detect venv in the following order:
    • ./venv path.
    • ./.venv path.
    • poetry if poetry is installed on your system, and [tool.poetry] exists in pyproject.toml or poetry.lock in the root directory of a project.
    • uv if uv command is installed on your systems, and one of the following conditions is true:
      • [tool.uv] exists and no managed = false in pyproject.toml
      • uv.lock exists in the root directory of a project.
  • venv: poetry — will use poetry to get venv for a project. Will raise an exception when not found poetry or venv itself. Will use all the same checks from auto for poetry.
  • venv: uv — Same as poetry, but for uv.
  • venv: <path_to_venv> — Will try to add this venv at that location. Will fail with an error message if not exists.

All of this stuff will help to avoid adding extra dependencies in additional_dependency

Metadata

Metadata

Assignees

Labels

Complexity / MComplex to implementfeatureNew feature or enhancement request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions