diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fa580c8..44c3775 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: @@ -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 diff --git a/packages/tangle-api/README.md b/packages/tangle-api/README.md new file mode 100644 index 0000000..f8c2449 --- /dev/null +++ b/packages/tangle-api/README.md @@ -0,0 +1,3 @@ +# tangle-api + +Checked-in generated Tangle API models, operation proxies, and schema snapshot used by `tangle-cli[native]`. diff --git a/packages/tangle-api/pyproject.toml b/packages/tangle-api/pyproject.toml index 8fd377f..5f1f3ec 100644 --- a/packages/tangle-api/pyproject.toml +++ b/packages/tangle-api/pyproject.toml @@ -1,8 +1,8 @@ [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" }, @@ -10,7 +10,7 @@ authors = [ requires-python = ">=3.10" dependencies = [ "pydantic>=2.0", - "tangle-cli==0.1.0", + "tangle-cli==0.0.1a2", ] [build-system] diff --git a/pyproject.toml b/pyproject.toml index 9912f7b..5d6ffa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -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"] diff --git a/tests/test_packaging.py b/tests/test_packaging.py index 5cb19a3..d585098 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -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( @@ -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( diff --git a/uv.lock b/uv.lock index b2b4421..5821114 100644 --- a/uv.lock +++ b/uv.lock @@ -1775,7 +1775,7 @@ wheels = [ [[package]] name = "tangle-api" -version = "0.1.0" +version = "0.0.1a2" source = { editable = "packages/tangle-api" } dependencies = [ { name = "pydantic" }, @@ -1790,7 +1790,7 @@ requires-dist = [ [[package]] name = "tangle-cli" -version = "0.0.1a1" +version = "0.0.1a2" source = { editable = "." } dependencies = [ { name = "cloud-pipelines" },