Skip to content

Commit 5dfbb55

Browse files
authored
detect version in advance before building deepmd-kit-cu11 (#3172)
Fix #3168. See: pypa/setuptools-scm#1006 (comment) --------- Signed-off-by: Jinzhe Zeng <[email protected]>
1 parent 04c414a commit 5dfbb55

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/build_wheel.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ jobs:
6868
- uses: docker/setup-qemu-action@v3
6969
name: Setup QEMU
7070
if: matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest'
71+
# detect version in advance. See #3168
72+
- uses: actions/setup-python@v5
73+
name: Install Python
74+
with:
75+
python-version: '3.11'
76+
cache: 'pip'
77+
if: matrix.dp_pkg_name == 'deepmd-kit-cu11'
78+
- run: |
79+
python -m pip install setuptools_scm
80+
python -c "from setuptools_scm import get_version;print('SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DEEPMD-KIT-CU11='+get_version())" >> $GITHUB_ENV
81+
if: matrix.dp_pkg_name == 'deepmd-kit-cu11'
7182
- name: Build wheels
7283
uses: pypa/[email protected]
7384
env:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ environment-pass = [
155155
"DP_VARIANT",
156156
"CUDA_VERSION",
157157
"DP_PKG_NAME",
158+
"SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DEEPMD-KIT-CU11",
158159
]
159160
environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update2", DP_ENABLE_IPI="1", MPI_HOME="/usr/lib64/mpich", PATH="/usr/lib64/mpich/bin:$PATH" }
160161
before-all = [

0 commit comments

Comments
 (0)