Skip to content

Commit 0701f13

Browse files
committed
feat: remove build_rust for the meantime while figuring out how to do it separate of maturin's build
1 parent 3d875b3 commit 0701f13

File tree

3 files changed

+6
-107
lines changed

3 files changed

+6
-107
lines changed

{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.add_rust_extension == 'y' %} build-rust.yml {%- endif %}

Lines changed: 0 additions & 71 deletions
This file was deleted.

{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.add_rust_extension == 'y' %} release-rust.yml {%- endif %}

Whitespace-only changes.

{{cookiecutter.project_name}}/noxfile.py

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -119,41 +119,6 @@ def docs_build(session: Session) -> None:
119119
session.run("uv", "run", "sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-W", external=True)
120120

121121

122-
# Note: Sessions for building Rust (build_rust) and possibly publishing Rust artifacts
123-
# would be added here, potentially conditionally based on the 'add_rust_extension' prompt.
124-
# Example conditional session inclusion based on cookiecutter variable:
125-
{% if cookiecutter.add_rust_extension == 'y' %}
126-
@nox.session(python=DEFAULT_PYTHON_VERSION)
127-
def build_rust(session: Session) -> None:
128-
"""Build the Rust crate.
129-
130-
Requires Rust toolchain (managed separately or via CI setup).
131-
Requires uvx in PATH. Requires Cargo.toml in the rust/ directory.
132-
"""
133-
session.log("Checking Rust toolchain availability via uvx/cargo.")
134-
# uvx can run cargo if rustup is on the PATH or configured.
135-
# or the CI setup ensures rust toolchain is installed (e.g., via actions-rs/toolchain).
136-
try:
137-
session.run("cargo", "--version", success_codes=[0], external=True, silent=True)
138-
except nox.command.CommandFailed:
139-
session.log("Rust toolchain (cargo) not found in PATH.")
140-
session.skip("Rust toolchain not available.")
141-
return
142-
143-
# Change to the directory containing Cargo.toml
144-
rust_crate_dir = Path("rust") # Assumes rust/ directory contains Cargo.toml
145-
if not (rust_crate_dir / "Cargo.toml").exists():
146-
session.log(f"Cargo.toml not found in {rust_crate_dir}.")
147-
session.skip("Rust crate not found.")
148-
return
149-
150-
session.log(f"Building Rust crate in {rust_crate_dir}.")
151-
# Use cargo build command, typically run from the crate root directory
152-
session.run("cargo", "build", "--release", external=True, cwd=str(rust_crate_dir)) # cwd ensures command runs in Rust dir
153-
session.log("Rust crate built.")
154-
155-
{% endif %}
156-
157122
@nox.session(python=DEFAULT_PYTHON_VERSION, name="build-python")
158123
def build_python(session: Session) -> None:
159124
"""Build sdist and wheel packages (uv build)."""
@@ -162,10 +127,15 @@ def build_python(session: Session) -> None:
162127
session.run("uv", "sync", "--locked", "--clean", "--groups", "dev", external=True)
163128

164129
session.log(f"Building sdist and wheel packages with py{session.python}.")
130+
{% if cookiecutter.add_rust_extension == 'y' -%}
165131
session.run("uv", "build", "--sdist", "--wheel", "--outdir", "dist/", external=True)
132+
{% else -%}
133+
session.run("uvx", "maturin", "develop", "--uv", external=True)
134+
{% endif -%}
166135

167136
session.log("Built packages in ./dist directory:")
168-
session.run("uv", "run", "ls", "-l", "dist/", external=True)
137+
for path in Path("dist/").glob("*"):
138+
session.log(f"- {path.name}")
169139

170140

171141
@nox.session(python=DEFAULT_PYTHON_VERSION, name="build-container")

0 commit comments

Comments
 (0)