diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 2f6d2c4ab2..392ce7ac5b 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -68,6 +68,17 @@ jobs: - uses: docker/setup-qemu-action@v3 name: Setup QEMU if: matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest' + # detect version in advance. See #3168 + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: '3.11' + cache: 'pip' + if: matrix.dp_pkg_name == 'deepmd-kit-cu11' + - run: | + python -m pip install setuptools_scm + python -c "from setuptools_scm import get_version;print('SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DEEPMD-KIT-CU11='+get_version())" >> $GITHUB_ENV + if: matrix.dp_pkg_name == 'deepmd-kit-cu11' - name: Build wheels uses: pypa/cibuildwheel@v2.16 env: diff --git a/pyproject.toml b/pyproject.toml index b837d3be44..9b9d24dbef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -153,6 +153,7 @@ environment-pass = [ "DP_VARIANT", "CUDA_VERSION", "DP_PKG_NAME", + "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DEEPMD-KIT-CU11", ] 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" } before-all = [