Skip to content

Add a --no-venv flag to skip virtualenv creation/installation #46

Description

@rahlk

Summary

Add a --no-venv flag (and a corresponding AnalysisOptions field) that tells codeanalyzer-python to skip virtualenv creation / dependency installation and run analysis against the current / ambient Python environment instead.

Motivation

Today the analyzer provisions a virtualenv (and installs the target project's dependencies) so Jedi can resolve imports. In several contexts that step is unwanted:

  • CI / containers where the project's dependencies are already installed in the active environment — the extra venv + install is redundant and slow.
  • Ephemeral / sandboxed runs where network installs are disallowed or undesirable.
  • Speed / reproducibility — reusing the ambient interpreter avoids minutes of per-run setup.

Proposed behavior

  • --no-venv CLI flag → AnalysisOptions(no_venv=True).
  • When set, skip venv creation and dependency installation; point Jedi at the current sys.prefix / active interpreter.
  • Document the tradeoff: import/call-resolution quality then depends on what is installed in the ambient environment.

Notes

This pairs naturally with library / in-process use from the CLDK SDK (PyCodeanalyzer) and with --emit neo4j, where the host environment is often already the project's environment and the venv bootstrap is pure overhead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions