pip

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 11 Imported by: 0

README

Pip resolution logic

The way resolution of pip lock files works is as follows:

  1. Create a Venv in which we do the installation and run all commands
  2. Run pip install -r <requirements.txt_file> in order to install all dependencies
  3. Run cat to get the contents of the requirements.txt file
  4. Run pip list to get a list of all installed packages
  5. Run pip show <list_of_installed_packages> to get more in-depth information from each package, including the relations between dependencies

The results of the commands above are then combined to form the finished lock file with the following sections:

  1. The contents of the requirements.txt (from cat)
  2. The list of all installed dependencies (from pip list)
  3. More detailed information on each package with relations (from pip show)

Documentation

Index

Constants

View Source
const Name = "pip"

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdFactory

type CmdFactory struct {
	// contains filtered or unexported fields
}

func (CmdFactory) MakeCatCmd

func (cmdf CmdFactory) MakeCatCmd(file string) (*exec.Cmd, error)

func (CmdFactory) MakeCreateVenvCmd

func (cmdf CmdFactory) MakeCreateVenvCmd(fpath string) (*exec.Cmd, error)

func (CmdFactory) MakeInstallCmd

func (cmdf CmdFactory) MakeInstallCmd(command string, file string) (*exec.Cmd, error)

func (CmdFactory) MakeListCmd

func (cmdf CmdFactory) MakeListCmd(command string) (*exec.Cmd, error)

func (CmdFactory) MakeShowCmd

func (cmdf CmdFactory) MakeShowCmd(command string, list []string) (*exec.Cmd, error)

type ExecPath

type ExecPath struct {
}

func (ExecPath) LookPath

func (_ ExecPath) LookPath(file string) (string, error)

type ICmdFactory

type ICmdFactory interface {
	MakeCreateVenvCmd(file string) (*exec.Cmd, error)
	MakeInstallCmd(command string, file string) (*exec.Cmd, error)
	MakeCatCmd(file string) (*exec.Cmd, error)
	MakeListCmd(command string) (*exec.Cmd, error)
	MakeShowCmd(command string, list []string) (*exec.Cmd, error)
}

type IExecPath

type IExecPath interface {
	LookPath(file string) (string, error)
}

type IPipCleaner

type IPipCleaner interface {
	RemoveAll(path string) error
}

type Job

type Job struct {
	job.BaseJob
	// contains filtered or unexported fields
}

func NewJob

func NewJob(
	file string,
	install bool,
	cmdFactory ICmdFactory,
	fileWriter writer.IFileWriter,
	pipCleaner IPipCleaner,
) *Job

func (*Job) Install

func (j *Job) Install() bool

func (*Job) Run

func (j *Job) Run()

type Pm

type Pm struct {
	// contains filtered or unexported fields
}

func NewPm

func NewPm() Pm

func (Pm) Manifests

func (_ Pm) Manifests() []string

func (Pm) Name

func (pm Pm) Name() string

type Strategy

type Strategy struct {
	// contains filtered or unexported fields
}

func NewStrategy

func NewStrategy(files []string) Strategy

func (Strategy) Invoke

func (s Strategy) Invoke() ([]job.IJob, error)

Jump to

Keyboard shortcuts

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