From 1f6dc093c30b9e8ead77bf938438a05b75e88128 Mon Sep 17 00:00:00 2001 From: Alexander van Eck Date: Mon, 21 Jul 2025 15:22:13 +0200 Subject: [PATCH 1/2] feat(uv): Switch to `uv_build` build backend. This has become the `uv` default in `0.8.0`. --- .../metadata_snapshots/uv.pyproject.toml | 19 ++++++------------- .../templates/pyproject_uv.toml.jinja | 19 ++++++------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/end_to_end_tests/metadata_snapshots/uv.pyproject.toml b/end_to_end_tests/metadata_snapshots/uv.pyproject.toml index 2d33669fa..6b83d6857 100644 --- a/end_to_end_tests/metadata_snapshots/uv.pyproject.toml +++ b/end_to_end_tests/metadata_snapshots/uv.pyproject.toml @@ -11,23 +11,16 @@ dependencies = [ "python-dateutil>=2.8.0,<3", ] -[tool.hatch.build.targets.sdist] -include = [ - "test_3_1_features_client", +[tool.uv.build-backend] +module-name = "test_3_1_features_client" +module-root = "" +data = [ "CHANGELOG.md", - "test_3_1_features_client/py.typed", -] - -[tool.hatch.build.targets.wheel] -include = [ - "test_3_1_features_client", - "CHANGELOG.md", - "test_3_1_features_client/py.typed", ] [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.8.0,<1"] +build-backend = "uv_build" [tool.ruff] line-length = 120 diff --git a/openapi_python_client/templates/pyproject_uv.toml.jinja b/openapi_python_client/templates/pyproject_uv.toml.jinja index fb774f9b1..03b8711ee 100644 --- a/openapi_python_client/templates/pyproject_uv.toml.jinja +++ b/openapi_python_client/templates/pyproject_uv.toml.jinja @@ -11,20 +11,13 @@ dependencies = [ "python-dateutil>=2.8.0,<3", ] -[tool.hatch.build.targets.sdist] -include = [ - "{{ package_name }}", +[tool.uv.build-backend] +module-name = "{{ package_name }}" +module-root = "" +data = [ "CHANGELOG.md", - "{{ package_name }}/py.typed", -] - -[tool.hatch.build.targets.wheel] -include = [ - "{{ package_name }}", - "CHANGELOG.md", - "{{ package_name }}/py.typed", ] [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["uv_build>=0.8.0,<1"] +build-backend = "uv_build" From 65e0f958407a1191d0ee07d71c45d5cac1a89e14 Mon Sep 17 00:00:00 2001 From: Alexander van Eck Date: Mon, 21 Jul 2025 18:04:26 +0200 Subject: [PATCH 2/2] refactor(uv): Set `uv_build` to `<0.9.0`. --- end_to_end_tests/metadata_snapshots/uv.pyproject.toml | 2 +- openapi_python_client/templates/pyproject_uv.toml.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/end_to_end_tests/metadata_snapshots/uv.pyproject.toml b/end_to_end_tests/metadata_snapshots/uv.pyproject.toml index 6b83d6857..8635fdc4c 100644 --- a/end_to_end_tests/metadata_snapshots/uv.pyproject.toml +++ b/end_to_end_tests/metadata_snapshots/uv.pyproject.toml @@ -19,7 +19,7 @@ data = [ ] [build-system] -requires = ["uv_build>=0.8.0,<1"] +requires = ["uv_build>=0.8.0,<0.9.0"] build-backend = "uv_build" [tool.ruff] diff --git a/openapi_python_client/templates/pyproject_uv.toml.jinja b/openapi_python_client/templates/pyproject_uv.toml.jinja index 03b8711ee..83634d3d6 100644 --- a/openapi_python_client/templates/pyproject_uv.toml.jinja +++ b/openapi_python_client/templates/pyproject_uv.toml.jinja @@ -19,5 +19,5 @@ data = [ ] [build-system] -requires = ["uv_build>=0.8.0,<1"] +requires = ["uv_build>=0.8.0,<0.9.0"] build-backend = "uv_build"