python

package
v1.0.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 4 Imported by: 0

Documentation

Overview

Package python is the Python implementation of the affected-selection language seam.

A unit is one module — one .py file — because that is Python's compilation and import unit. Import edges are read from source text; no interpreter is started and nothing is imported, so the graph can be rebuilt on a dirty worktree with no virtual environment present.

Index

Constants

View Source
const (
	// FrontierDynamicImport reports importlib or __import__ usage, whose target
	// is not visible in source text.
	FrontierDynamicImport = "python:dynamic-import"
	// FrontierRelativeImport reports a relative import that resolved to no
	// observed module.
	FrontierRelativeImport = "python:relative-import-unresolved"
	// FrontierUnreadableSource reports a file that could not be read or decoded.
	FrontierUnreadableSource = "python:unreadable-source"
	// FrontierConditionalImport reports an import nested inside a block, whose
	// execution is conditional. The edge is kept; the condition is the frontier.
	FrontierConditionalImport = "python:conditional-import"
)

Frontier reasons this plugin can raise.

Variables

View Source
var SourceRoots = []string{"src", "lib", "python"}

SourceRoots are the directory prefixes stripped when deriving a dotted module name, in addition to the repository root itself. They cover the layouts a Python project uses to put importable modules somewhere other than the root.

Functions

This section is empty.

Types

type Language

type Language struct{}

Language observes Python modules under one repository root.

func New

func New() Language

New returns the Python language plugin.

func (Language) Name

func (Language) Name() string

Name is the plugin namespace.

func (Language) Owns

func (Language) Owns(relative string) bool

Owns reports whether a path is Python source text.

func (Language) Units

func (language Language) Units(root string) (affected.Result, error)

Units observes every Python module in the repository rooted at root.

func (Language) UnitsSource

func (language Language) UnitsSource(root *affected.Source) (affected.Result, error)

UnitsSource reads only the explicitly supplied source universe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL