Help us shape the future of Go! Take the 2026 Go Developer Survey

pythonutils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Pip    = "pip"
	Pipenv = "pipenv"
	Poetry = "poetry"
)

Variables

This section is empty.

Functions

func ExtractPackageNameFromSetupPy

func ExtractPackageNameFromSetupPy(setuppyFilePath string) (string, error)

Get the project-name by running 'egg_info' command on setup.py and extracting it from 'PKG-INFO' file.

func GetPackageName added in v1.6.0

func GetPackageName(tool PythonTool, srcPath string) (packageName string, err error)

func GetPythonDependencies

func GetPythonDependencies(tool PythonTool, srcPath, localDependenciesPath string) (dependenciesGraph map[string][]string, topLevelDependencies []string, err error)

func UpdateDepsIdsAndRequestedBy

func UpdateDepsIdsAndRequestedBy(dependenciesMap map[string]buildinfo.Dependency, dependenciesGraph map[string][]string, topLevelPackagesList []string, packageName, moduleName string)

Before running this function, dependency IDs may be the file names of the resolved python packages. Update build info dependency IDs and the requestedBy field. allDependencies - Dependency name to Dependency map dependenciesGraph - Dependency graph as built by 'pipdeptree' or 'pipenv graph' topLevelPackagesList - The direct dependencies packageName - The resolved package name of the Python project, may be empty if we couldn't resolve it moduleName - The input module name from the user, or the packageName

Types

type PoetryLock added in v1.6.0

type PoetryLock struct {
	Package []*PoetryPackage
}

type PoetryPackage added in v1.6.0

type PoetryPackage struct {
	Name            string
	Version         string
	Dependencies    map[string]interface{}
	DevDependencies map[string]interface{} `toml:"dev-dependencies"`
}

type PyprojectToml added in v1.6.0

type PyprojectToml struct {
	Tool map[string]PoetryPackage
}

type PythonTool

type PythonTool string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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