VirtualEnv#
- class neophile.virtualenv.VirtualEnv(path)#
Bases:
object
Manage virtual environments.
Python dependency updates using
make update
have to be done inside a virtual environment because they may attempt to install packages withpip
. This class manages creation and execution of commands inside a virtual environment.- Parameters:
path (
Path
) – Path to where to create the virtual environment. If that directory already exists, it will be used as an existing virtual environment instead of creating a new one.
Methods Summary
create
()Create the virtualenv if it does not already exist.
run
(command, **kwargs)Run a command inside the virtualenv.
Methods Documentation
- create()#
Create the virtualenv if it does not already exist.
- Raises:
subprocess.CalledProcessError – Raised on failure to install the wheel package.
- Return type:
- run(command, **kwargs)#
Run a command inside the virtualenv.
Sets up the virtualenv if necessary and then runs the command given.
- Parameters:
- Returns:
Return value of subprocess.run.
- Return type:
- Raises:
subprocess.CalledProcessError – Raised on failure to install the wheel package or failure of the provided command.