Welcome to pip-run documentation!

pip_run.run(args=None)

Main entry point for pip-run.

pip_run.commands.intercept(args)

Detect certain args and intercept them.

pip_run.commands.parse_script_args(args)

Separate the command line arguments into arguments for pip and arguments to Python.

>>> parse_script_args(['foo', '--', 'bar'])
(['foo'], ['bar'])
>>> parse_script_args(['foo', 'bar'])
(['foo', 'bar'], [])
pip_run.deps.load(*args)
pip_run.deps.pkg_installed(spec)
class pip_run.launch.PathReader

Bases: object

pip_run.launch.with_path(target, params)

Launch Python with target on the path and params

pip_run.launch.with_path_overlay(target, params)

Overlay Python with target on the path and params

class pip_run.scripts.Dependencies

Bases: list

index_url = None
params()
class pip_run.scripts.DepsReader(script)

Bases: object

Given a Python script, read the dependencies it declares. Does not execute the script, so expects __requires__ to be assigned a static list of strings.

classmethod load(script_path)
read()
>>> DepsReader("__requires__=['foo']").read()
['foo']
classmethod search(params)

Given a (possibly-empty) series of parameters to a Python interpreter, return any dependencies discovered in a script indicated in the parameters. Only honor the first file found.

classmethod try_read(script_path)

Attempt to load the dependencies from the script, but return an empty list if unsuccessful.

pip_run.scripts.run(cmdline)

Execute the script as if it had been invoked naturally.

Indices and tables