Skip to content

Commit 5629984

Browse files
committed
fix: replace manual uv sync with session install
1 parent 6f86bcf commit 5629984

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

noxfile.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
TEMPLATE_PYTHON_LOCATIONS: tuple[Path, ...] = (
4545
Path("noxfile.py"),
46-
Path("scripts/*"),
47-
Path("hooks/*")
46+
Path("scripts"),
47+
Path("hooks")
4848
)
4949

5050
TEMPLATE_CONFIG_AND_DOCS: tuple[Path, ...] = (
@@ -134,9 +134,9 @@ def clear_cache(session: Session) -> None:
134134
def lint(session: Session):
135135
"""Lint the template's own Python files and configurations."""
136136
session.log("Installing linting dependencies for the template source...")
137-
session.run("uv", "sync", "--locked", "--group", "dev", "--group", "lint", external=True)
137+
session.install("-e", ".", "--group", "dev", "--group", "lint")
138138

139-
locations: list[str] = [str(loc) for loc in TEMPLATE_PYTHON_LOCATIONS + TEMPLATE_CONFIG_AND_DOCS]
139+
locations: list[str] = [str(loc) for loc in TEMPLATE_PYTHON_LOCATIONS]
140140
session.log(f"Running Ruff formatter check on template files with py{session.python}.")
141141
session.run("uv", "run", "ruff", "format", *locations, "--check", external=True)
142142

@@ -148,7 +148,7 @@ def lint(session: Session):
148148
def docs(session: Session):
149149
"""Build the template documentation website."""
150150
session.log("Installing documentation dependencies for the template docs...")
151-
session.run("uv", "sync", "--locked", "--group", "dev", "--group", "docs", external=True)
151+
session.install("-e", ".", "--group", "dev", "--group", "docs")
152152

153153
session.log(f"Building template documentation with py{session.python}.")
154154
# Set path to allow Sphinx to import from template root if needed (e.g., __version__.py)
@@ -178,7 +178,7 @@ def test(session: Session) -> None:
178178
session.log("Running template tests...")
179179
session.log("Installing template testing dependencies...")
180180
# Sync deps from template's own pyproject.toml, e.g., 'dev' group that includes 'pytest', 'cookiecutter'
181-
session.run("uv", "sync", "--locked", "--group", "dev", "--group", "test", external=True)
181+
session.install("-e", ".", "--group", "dev", "--group", "test")
182182

183183
# Create a temporary directory for the generated project
184184
temp_dir: Path = Path(tempfile.mkdtemp())
@@ -200,7 +200,7 @@ def test(session: Session) -> None:
200200
session.cd(generated_project_dir)
201201

202202
session.log("Installing generated project dependencies using uv sync...")
203-
session.run("uv", "sync", "--locked", external=True)
203+
session.install("-e", ".", external=True)
204204

205205
session.log("Running generated project's default checks...")
206206
session.run("uv", "run", "nox", external=True)

0 commit comments

Comments
 (0)