pyast

package module
v0.0.0-...-c9e49e9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 19 Imported by: 3

README

pyast

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTree

func BuildTree(ctx context.Context, pwg *sync.WaitGroup, c chan tree, pythonRoot string)

func BuildTrees

func BuildTrees(ctx context.Context, pythonRoots file.Paths) *trees

BuildTrees builds import dependency trees for the given Python roots.

func BuildTreesWithOptions

func BuildTreesWithOptions(ctx context.Context, pythonRoots file.Paths, opts BuildTreesOptions) *trees

BuildTreesWithOptions builds import dependency trees with configurable behavior.

func CalculatePythonRoots

func CalculatePythonRoots(paths file.Paths) file.Paths

CalculatePythonRoots handles the situation where a repository contains multiple python projects. Each project has __init__.py in its child directories - so if a directory is found without one, it is a separate project. This function creates a set of these "root" directories, which contain at least one of the input paths and does not contain __init__.py

func ClassToPath

func ClassToPath(root string, class string) string

func PathToClass

func PathToClass(path string) (string, error)

Types

type BuildTreesOptions

type BuildTreesOptions struct {
	// NamespacePackages disables the __init__.py requirement when walking
	// directories. Required for implicit namespace packages.
	NamespacePackages bool
}

BuildTreesOptions controls tree-building behavior.

type Classes

type Classes map[string]Void

func CreateClasses

func CreateClasses(strings ...string) Classes

func (*Classes) Add

func (p *Classes) Add(items ...string) *Classes

func (*Classes) Copy

func (s *Classes) Copy() Classes

func (*Classes) Discard

func (p *Classes) Discard(other Classes) *Classes

func (*Classes) Intersection

func (p *Classes) Intersection(other Classes) *Classes

func (Classes) Lister

func (c Classes) Lister() []string

func (Classes) SameAs

func (c Classes) SameAs(o Classes) bool

func (*Classes) Union

func (p *Classes) Union(other Classes) *Classes

type Void

type Void struct{}
var Member Void

Jump to

Keyboard shortcuts

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