Skip to content

Commit

Permalink
Use a wheel build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jan 9, 2025
1 parent 975b370 commit 1fbbe69
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scripts/create-zipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main() -> Any:
locked_requirements = work_dir / "requirements.txt"

subprocess.run(
args=["uv", "-q", "export", "--no-editable", "--no-dev", "-o", locked_requirements],
args=["uv", "-q", "export", "--no-dev", "--no-emit-project", "-o", locked_requirements],
check=True,
)
subprocess.run(
Expand All @@ -31,13 +31,30 @@ def main() -> Any:
check=True,
)

wheels = work_dir / "wheels"
subprocess.run(args=["uv", "-q", "build", "--wheel", "-o", wheels], check=True)
subprocess.run(
args=[
"uv",
"-q",
"pip",
"install",
"--target",
site_packages_dir,
"--no-deps",
*wheels.glob("*.whl"),
],
check=True,
)

# Science runs in a scie that carries its own interpreter; so pins to a single major/minor for
# development that matches prod; as such, we can just take the ambient interpreter major/minor
# and know it matches the project Requires-Python.
python = f"python{sys.version_info[0]}.{sys.version_info[1]}"

dest = Path("dist") / "science.pyz"
dest.parent.mkdir(exist_ok=True)
dest.unlink(missing_ok=True)
return subprocess.call(
args=[
"shiv",
Expand Down

0 comments on commit 1fbbe69

Please sign in to comment.