File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323 - name : Install dependencies
2424 run : |
25- # Ensure lock file includes dev dependencies
26- uv lock --dev
27- # Sync with dev dependencies
28- uv sync --dev
25+ # Sync with all extras and dev dependencies
26+ uv sync --all-extras --dev
2927
3028 - name : Run ruff format check
3129 run : uv run ruff format --check .
Original file line number Diff line number Diff line change 2626
2727 - name : Install dependencies
2828 run : |
29- # Ensure lock file includes dev dependencies
30- uv lock --dev
31- # Sync with dev dependencies
32- uv sync --dev
29+ # Sync with all extras and dev dependencies
30+ uv sync --all-extras --dev
3331
3432 - name : Run pytest
3533 run : uv run pytest
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ install:
2121 uv sync
2222
2323install-dev :
24- uv sync --dev
24+ uv sync --all-extras -- dev
2525
2626lock :
2727 uv lock
Original file line number Diff line number Diff line change @@ -59,8 +59,10 @@ A comprehensive machine learning project template with modern tooling for depend
5959
60603 . ** Install dependencies** :
6161 ``` bash
62- uv sync --dev
62+ uv sync --all-extras -- dev
6363 ```
64+
65+ Note: ` --all-extras ` is needed because dev dependencies are defined as optional dependencies in ` pyproject.toml ` .
6466
65674 . ** Generate lock file** (if not present):
6668 ``` bash
@@ -152,7 +154,7 @@ uv run ruff check --fix .
152154
1531551 . Add the dependency to ` pyproject.toml ` under ` [project.dependencies] ` (for production) or ` [project.optional-dependencies.dev] ` (for development)
1541562 . Run ` uv lock ` to update the lock file
155- 3 . Run ` uv sync ` to install the new dependency
157+ 3 . Run ` uv sync --all-extras --dev ` to install the new dependency (or ` uv sync ` for production dependencies only)
156158
157159Example:
158160``` bash
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ packages = ["src/ml_project_template"]
4040[tool .ruff ]
4141line-length = 100
4242target-version = " py311"
43+
44+ [tool .ruff .lint ]
4345select = [
4446 " E" , # pycodestyle errors
4547 " W" , # pycodestyle warnings
@@ -54,15 +56,15 @@ ignore = [
5456 " B008" , # do not perform function calls in argument defaults
5557]
5658
59+ [tool .ruff .lint .isort ]
60+ known-first-party = [" ml_project_template" ]
61+
5762[tool .ruff .format ]
5863quote-style = " double"
5964indent-style = " space"
6065skip-magic-trailing-comma = false
6166line-ending = " auto"
6267
63- [tool .ruff .isort ]
64- known-first-party = [" ml_project_template" ]
65-
6668[tool .pytest .ini_options ]
6769testpaths = [" tests" ]
6870python_files = [" test_*.py" , " *_test.py" ]
Original file line number Diff line number Diff line change 11"""Example test file to demonstrate pytest setup."""
22
3- import pytest
4-
53
64def test_example ():
75 """Example test that always passes."""
You can’t perform that action at this time.
0 commit comments