A CLI that just adds python dependencies directly into pyproject.toml
$ python -m add_pyproject numpy>=1.26 |
|
Before [project]
name = "mypackage"
version = "0.1.0"
dependencies = ["foobar"] |
After [project]
name = "mypackage"
version = "0.1.0"
dependencies = ["foobar", "numpy>=1.26"] |
pip install add-pyproject
[project]
# ...
dependencies = [
"foobar"
]
[tool.hatch.envs.default]
dependencies = [
"add-pyproject"
]
[tool.hatch.envs.default.scripts]
add = "python -m add_pyproject {args}"
$ hatch run add numpy>=1.26
add-pyproject
is distributed under the terms of the MIT license.