Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Publish release to PyPI"
on:
push:
tags:
# Publish on any tag starting with a `v`, e.g., v0.1.0
# Publish on any tag starting with a `v`, e.g., v0.0.1a2
- v*

jobs:
Expand All @@ -21,12 +21,36 @@ jobs:
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install Python 3.13
run: uv python install 3.13
- name: Build
- name: Build tangle-cli
run: uv build
# Check that basic features work and we didn't miss to include crucial files
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl tangle version
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tangle version
- name: Build tangle-api
run: uv build --package tangle-api
# Check that basic features work and we didn't miss to include crucial files.
# Use package-specific globs so adding tangle-api artifacts does not change
# which distribution is installed for tangle-cli smoke tests.
- name: Smoke test tangle-cli wheel
run: |
uv run --isolated --no-project --with dist/tangle_cli-*.whl tangle version
uv run --isolated --no-project --with dist/tangle_cli-*.whl tangle-cli version
- name: Smoke test tangle-cli source distribution
run: |
uv run --isolated --no-project --with dist/tangle_cli-*.tar.gz tangle version
uv run --isolated --no-project --with dist/tangle_cli-*.tar.gz tangle-cli version
- name: Smoke test tangle-api wheel
run: |
uv run --isolated --no-project \
--with dist/tangle_cli-*.whl \
--with dist/tangle_api-*.whl \
python -c "import importlib.metadata as m; import tangle_api.generated.models; import tangle_api.schema; assert m.version('tangle-api') == m.version('tangle-cli')"
- name: Smoke test tangle-api source distribution
run: |
uv run --isolated --no-project \
--with dist/tangle_cli-*.tar.gz \
--with dist/tangle_api-*.tar.gz \
python -c "import importlib.metadata as m; import tangle_api.generated.models; import tangle_api.schema; assert m.version('tangle-api') == m.version('tangle-cli')"
- name: Smoke test native extra resolution from local dist
run: |
cli_wheel="$(echo dist/tangle_cli-*.whl)"
uv run --isolated --no-project --find-links dist --with "${cli_wheel}[native]" tangle-cli version
- name: Publish
run: uv publish
3 changes: 3 additions & 0 deletions packages/tangle-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# tangle-api

Checked-in generated Tangle API models, operation proxies, and schema snapshot used by `tangle-cli[native]`.
6 changes: 3 additions & 3 deletions packages/tangle-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[project]
name = "tangle-api"
version = "0.1.0"
version = "0.0.1a2"
description = "Checked-in generated Tangle API models and operation proxies"
readme = "../../README.md"
readme = "README.md"
authors = [
{ name = "Alexey Volkov", email = "alexey.volkov@ark-kun.com" },
{ name = "Tangle authors" },
]
requires-python = ">=3.10"
dependencies = [
"pydantic>=2.0",
"tangle-cli==0.1.0",
"tangle-cli==0.0.1a2",
]

[build-system]
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tangle-cli"
version = "0.0.1a1"
version = "0.0.1a2"
description = "CLI for Tangle, the open-source ML pipeline orchestration platform"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -28,10 +28,11 @@ Repository = "https://github.com/TangleML/tangle-cli"
Issues = "https://github.com/TangleML/tangle-cli/issues"

[project.optional-dependencies]
native = ["tangle-api==0.1.0"]
native = ["tangle-api==0.0.1a2"]

[project.scripts]
tangle = "tangle_cli.cli:main"
tangle-cli = "tangle_cli.cli:main"

[build-system]
requires = ["uv_build>=0.11.2,<0.12.0"]
Expand Down
21 changes: 17 additions & 4 deletions tests/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ def test_tangle_cli_wheel_imports_without_native_tangle_api(tmp_path) -> None:
names = archive.namelist()
metadata_name = next(name for name in names if name.endswith(".dist-info/METADATA"))
metadata = archive.read(metadata_name).decode()
entry_points_name = next(name for name in names if name.endswith(".dist-info/entry_points.txt"))
entry_points = archive.read(entry_points_name).decode()

requires_dist = [line for line in metadata.splitlines() if line.startswith("Requires-Dist: ")]
assert not any(name.startswith("tangle_api/") for name in names)
assert "tangle_cli/openapi/openapi.json" not in names
assert "Requires-Dist: tangle-api==0.1.0" not in requires_dist
assert "Requires-Dist: tangle-api==0.1.0 ; extra == 'native'" in requires_dist
assert "Version: 0.0.1a2" in metadata
assert "Requires-Dist: tangle-api==0.0.1a2" not in requires_dist
assert "Requires-Dist: tangle-api==0.0.1a2 ; extra == 'native'" in requires_dist
assert "Provides-Extra: native" in metadata
assert "tangle = tangle_cli.cli:main" in entry_points
assert "tangle-cli = tangle_cli.cli:main" in entry_points

env = {**os.environ, "PYTHONPATH": os.pathsep.join([str(wheel), str(stubs)])}
subprocess.run(
Expand Down Expand Up @@ -260,8 +266,15 @@ def test_native_wheels_provide_static_client_binding(tmp_path) -> None:
cli_wheel = _build_wheel(tmp_path / "cli")
api_wheel = _build_wheel(tmp_path / "api", "--package", "tangle-api")
with zipfile.ZipFile(api_wheel) as archive:
assert "tangle_api/schema/__init__.py" in archive.namelist()
assert "tangle_api/schema/openapi.json" in archive.namelist()
names = archive.namelist()
assert "tangle_api/schema/__init__.py" in names
assert "tangle_api/schema/openapi.json" in names
metadata_name = next(name for name in names if name.endswith(".dist-info/METADATA"))
metadata = archive.read(metadata_name).decode()

requires_dist = [line for line in metadata.splitlines() if line.startswith("Requires-Dist: ")]
assert "Version: 0.0.1a2" in metadata
assert "Requires-Dist: tangle-cli==0.0.1a2" in requires_dist
env = {**os.environ, "PYTHONPATH": os.pathsep.join([str(cli_wheel), str(api_wheel)])}

subprocess.run(
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading