Usage¶
pyproject-devenv creates a virtualenv using metadata defined in pyproject.toml.
Configuration¶
pyproject-devenv is configured using the project table in pyproject.toml,
as defined in PEP 621.
At a minimum, a value must be provided for name,
and dependencies must have a value or be marked as dynamic.
A value can also be provided for optional-dependencies, but this cannot be dynamic.
Any requirements listed in dependencies or optional-dependencies are installed.
pyproject-devenv will also install anything listed in build-system.requires,
which lists the project’s build dependencies.
Refer to PEP 518 for more information on the build-system table.
Any requirements listed in <pyproject_dir>/tests/requirements.txt are also installed if the file exists.
Command Line Usage¶
Create virtual environments using pyproject.toml metadata.
devenv [OPTIONS] [DEST]
Options
-
--python<python>¶ Path to the Python interpreter to use (e.g. a version of CPython, PyPy, RustPython, GraalPython)
-
-U,--upgrade¶ Upgrade all specified packages to the newest available version.
-
-v,--verbose¶ Show verbose output.
-
--colour,--no-colour¶ Whether to use coloured output.
-
-T,--traceback¶ Show the complete traceback on error.
-
--version¶ Show the version and exit.
Arguments
-
DEST¶ The directory to create the virtual environment in.
Optional argument. Default
'venv'
Example Configuration¶
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"] # PEP 508 specifications.
[project]
name = "spam"
version = "2020.0.0"
description = "Lovely Spam! Wonderful Spam!"
dependencies = [
"httpx",
"gidgethub[httpx]>4.0.0",
"django>2.1; os_name != 'nt'",
"django>2.0; os_name == 'nt'"
]
[project.optional-dependencies]
test = [
"pytest[testing]<5.0.0",
"pytest-cov"
]
Then run:
pyproject-devenv
Successfully created development virtualenv.
Output of pip list: