| name | pyproject-toml-1-version-constraints |
| description | Sub-skill of pyproject-toml: 1. Version Constraints (+3). |
| version | 1.0.0 |
| category | development |
| type | reference |
| scripts_exempt | true |
1. Version Constraints (+3)
1. Version Constraints
dependencies = [
"pandas>=2.0.0",
"numpy>=1.24,<2.0",
"requests~=2.28",
]
dependencies = [
"pandas==2.1.3",
"numpy",
]
2. Organize Optional Dependencies
[project.optional-dependencies]
dev = ["pytest", "ruff", "mypy"]
docs = ["mkdocs", "mkdocs-material"]
viz = ["plotly", "matplotlib"]
test = ["pytest", "pytest-cov"]
lint = ["ruff", "mypy"]
all = ["my-project[dev,docs,viz]"]
3. Use src Layout
my-project/
├── pyproject.toml
├── src/
│ └── my_project/
│ ├── __init__.py
│ └── core.py
└── tests/
└── test_core.py
4. Keep Tools Consistent
[tool.ruff]
line-length = 88
[tool.black]
line-length = 88
[tool.isort]
line_length = 88