Public API¶
Create virtual environments using pyproject.toml
metadata.
Exceptions:
Base |
|
|
|
|
|
Functions:
|
Create a “devenv”. |
-
mkdevenv
(project_dir, venv_dir='venv', *, verbosity=1, upgrade=False)[source]¶ Create a “devenv”.
- Parameters
project_dir (
Union
[str
,Path
,PathLike
]) – The root of the project to create the devenv for.venv_dir (
Union
[str
,Path
,PathLike
]) – The directory to create the devenv in, relative torepo_dir
. Default'venv'
.verbosity (
int
) – The verbosity of the function.0
= quiet,2
= very verbose. Default1
.upgrade (
bool
) – Whether to upgrade all specified packages to the newest available version. DefaultFalse
.
- Return type
-
exception
BaseInstallError
[source]¶ Bases:
RuntimeError
Base
Exception
to indicate an error occurred when installing packages.
-
exception
InstallFromFileError
(filename)[source]¶ Bases:
pyproject_devenv.BaseInstallError
Exception
to indicate an error occurred when installing packages from a requirements file.
-
exception
InstallError
(*requirements)[source]¶ Bases:
pyproject_devenv.BaseInstallError
Exception
to indicate an error occurred when installing packages.- Parameters
*requirements (
Union
[str
,Requirement
]) – The requirements being installed.
pyproject_devenv.config
¶
Read the pyproject-devenv
config from pyproject.toml
.
Classes:
|
|
|
|
|
Parser for a reduced subset of the PEP 621 metadata from |
Functions:
|
Load the |
-
load_toml
(filename)[source]¶ Load the
pyproject-devenv
configuration mapping from the given TOML file.- Parameters
- Return type
-
class
ConfigTracebackHandler
[source]¶ Bases:
pyproject_parser.cli.ConfigTracebackHandler
consolekit.tracebacks.TracebackHandler
which handlesdom_toml.parser.BadConfigError
andBaseInstallError
.
-
typeddict
ConfigDict
[source]¶ Bases:
TypedDict
typing.TypedDict
representing the configuration returned byload_toml()
.- Required Keys
name (
str
)dependencies (
List
[ComparableRequirement
])optional_dependencies (
Dict
[str
,List
[ComparableRequirement
]])build_dependencies (
Optional
[List
[ComparableRequirement
]])
-
class
PEP621Parser
[source]¶ Bases:
PEP621Parser
Parser for a reduced subset of the PEP 621 metadata from
pyproject.toml
.-
keys
= ['name', 'dependencies', 'optional-dependencies']¶ -
The list of keys parsed from
pyproject.toml
-
parse
(config, set_defaults=False)[source]¶ Parse the TOML configuration.
- Parameters
set_defaults (
bool
) – IfTrue
, the values inself.defaults
andself.factories
will be set as defaults for the returned mapping. DefaultFalse
.
- Return type
-