python

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package python discovers a repository's Python packages: the directories holding a pyproject.toml under the given roots (Packages) and a package's importable module (ModuleName). It does no I/O of its own: the repository is read through an fs.FS rooted at it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModuleName

func ModuleName(fsys fs.FS, pkgDir string) string

ModuleName is the importable module of a src-layout package directory pkgDir of the repository fsys: the first real directory under <pkgDir>/src/ (shelf/src/shelf → "shelf"), skipping build artifacts; the directory's base name without a src/ layout.

func Packages

func Packages(
	fsys fs.FS,
	roots []string,
	filter func(relPath string) bool,
) ([]string, error)

Packages discovers Python packages by walking each of roots (repository-relative directories) of the repository fsys for directories containing a pyproject.toml (a missing root is skipped; a Go-only tool directory has no pyproject.toml, so it contributes nothing). Paths are returned relative to the root (e.g. "libs/python/shelf"). An optional filter excludes packages by relative path (return false to skip).

Types

This section is empty.

Jump to

Keyboard shortcuts

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