dephell deps add¶
Add new dependencies into project.
Algorithm:
- Get dependencies from
from
file. - Add new dependencies.
- Check that these new dependencies has no conflicts with existing.
- Write dependencies back into
from
file.
You can specify --envs
to add dependencies into.
Basic usage¶
Simple usage:
dephell deps add --from=poetry flake8
Best practice is specify your dependencies file in pyproject.toml
DepHell config:
[tool.dephell.main]
from = {format = "poetry", path = "pyproject.toml"}
And after that DepHell will automatically detect your dependencies file:
dephell deps add flake8
See configuration documentation for more details.
Specify dependencies environments¶
Environments for dependencies is the name of dependencies section (main
and dev
for poetry
and pipfile
) or name of extras. DepHell uses main
by default, but you can specify another one:
dephell deps add --envs dev tests -- flake8==3.1.0 pytest
This will produce dependencies next lines in your poetry config:
[tool.poetry.dev-dependencies]
pytest = "*"
flake8 = "==3.1.0"
[tool.poetry.extras]
tests = ["flake8", "pytest"]
See also¶
- How to configure DepHell.
- How to filter commands JSON output.
- dephell deps convert for details about locking dependencies and supported file formats.
- dephell deps install to install new dependencies into virtual environment.
- dephell package install to install single package without adding it into requirements.