Skip to content

Commit 2d3404d

Browse files
committed
Remove awful setuptools-scm hack
1 parent 0a4ba1f commit 2d3404d

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.github/workflows/pip.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ jobs:
5959
fetch-depth: 0
6060
fetch-tags: true
6161

62-
# See: https://github.com/pypa/setuptools-scm/issues/455
63-
- name: Suppress git version tag
64-
if: github.event_name == 'push' && github.ref_name == 'main'
65-
run: |
66-
echo 'local_scheme = "no-local-version"' >> pyproject.toml
67-
git update-index --assume-unchanged pyproject.toml
68-
6962
- uses: ilammy/msvc-dev-cmd@v1
7063
- uses: lukka/[email protected]
7164

@@ -210,6 +203,9 @@ jobs:
210203
env:
211204
CIBW_BUILD: "cp3*-${{ matrix.platform_tag }}"
212205
CIBW_SKIP: "cp3{5,6,7,8}*"
206+
# Suppress the git version tag (necessary for TestPyPI)
207+
CIBW_ENVIRONMENT: >
208+
SETUPTOOLS_SCM_OVERRIDES_FOR_HALIDE='{local_scheme="no-local-version"}'
213209
CIBW_ENVIRONMENT_MACOS: >
214210
CMAKE_PREFIX_PATH='${{ github.workspace }}/opt'
215211
Python_ROOT_DIR=''

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
requires = [
33
"pybind11>=2.11.1",
44
"scikit-build-core==0.11.5",
5+
"setuptools-scm>=8.3.1",
56
]
67
build-backend = "scikit_build_core.build"
78

@@ -111,6 +112,9 @@ if.platform-system = "^win32"
111112
inherit.cmake.define = "append"
112113
cmake.define.Halide_WASM_BACKEND = "OFF"
113114

115+
[tool.setuptools_scm]
116+
# Needs to exist for scikit-build-core to use setuptools_scm
117+
114118
[tool.ruff.lint]
115119
# docs: https://docs.astral.sh/ruff/rules/
116120
select = [
@@ -165,7 +169,3 @@ search = "#define HALIDE_VERSION_MINOR {current_version}"
165169
src = "src/runtime/HalideRuntime.h"
166170
version_template = "{patch}"
167171
search = "#define HALIDE_VERSION_PATCH {current_version}"
168-
169-
# Must be last table in file since pip.yml appends to it
170-
# See: https://github.com/pypa/setuptools-scm/issues/455
171-
[tool.setuptools_scm]

0 commit comments

Comments
 (0)