Documentation
¶
Index ¶
- func GenerateScript(pythonPath string, cs ConsoleScript) []byte
- func HashFile(path string) (hash string, size int64, err error)
- func WriteInstaller(distInfoDir string) error
- func WriteRecord(distInfoDir string, entries []RecordEntry) error
- type ConsoleScript
- type Installer
- type Option
- type RecordEntry
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateScript ¶
func GenerateScript(pythonPath string, cs ConsoleScript) []byte
GenerateScript creates a Python wrapper script for a console_scripts entry point. Output matches what pip generates.
func HashFile ¶
HashFile computes the sha256 digest of a file and returns it in the format "sha256=<hex>" along with the file size.
func WriteInstaller ¶
WriteInstaller writes the INSTALLER file with "pipg" as the content.
func WriteRecord ¶
func WriteRecord(distInfoDir string, entries []RecordEntry) error
WriteRecord writes a RECORD file to the dist-info directory. The RECORD file itself is listed with empty hash and size per PEP 376.
Types ¶
type ConsoleScript ¶
type ConsoleScript struct {
Name string // script name, e.g., "ipython"
Module string // module path, e.g., "IPython"
Attr string // callable attribute, e.g., "start_ipython"
}
ConsoleScript represents a parsed console_scripts entry point.
func ParseEntryPoints ¶
func ParseEntryPoints(path string) ([]ConsoleScript, error)
ParseEntryPoints reads an entry_points.txt file and returns the console_scripts.
type Installer ¶
type Installer interface {
Install(ctx context.Context, downloads []downloader.Result) error
}
Installer defines the interface for installing downloaded wheel files.
type RecordEntry ¶
RecordEntry represents a single line in a RECORD file.
func InstallConsoleScripts ¶
func InstallConsoleScripts(distInfoDir, binDir, pythonPath string) ([]RecordEntry, error)
InstallConsoleScripts reads entry_points.txt, generates wrapper scripts, and installs them to the bin directory. Returns RECORD entries for the scripts.