File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 if : runner.os == 'macOS'
3333 run : |
3434 brew update
35- brew install fftw cmake ninja pkg-config libomp boost || true
35+ brew install fftw cmake ninja libomp boost || true
3636
3737 - name : Build wheel (scikit-build-core)
3838 run : |
Original file line number Diff line number Diff line change 1414 contents : read
1515 steps :
1616 - uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
1719
1820 - uses : actions/setup-python@v5
1921 with :
3739 contents : read
3840 steps :
3941 - uses : actions/checkout@v4
42+ with :
43+ fetch-depth : 0
4044
4145 - name : Build wheels with cibuildwheel
4246 uses : pypa/cibuildwheel@v2.21.3
@@ -107,11 +111,13 @@ jobs:
107111 contents : read
108112 steps :
109113 - uses : actions/checkout@v4
114+ with :
115+ fetch-depth : 0
110116
111117 - name : Install Homebrew deps
112118 run : |
113119 brew update
114- brew install fftw libomp boost cmake ninja pkg-config || true
120+ brew install fftw libomp boost cmake ninja || true
115121
116122 - name : Build wheels with cibuildwheel
117123 uses : pypa/cibuildwheel@v2.21.3
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.21 )
2- project (cpp_hf VERSION 0.1.0 LANGUAGES CXX )
2+
3+ # Prefer the project version provided by scikit-build-core when building wheels.
4+ # This lets you set the version in one place (pyproject.toml), and CMake picks it up
5+ # via the SKBUILD_PROJECT_VERSION cache variable. Fallback used for direct CMake builds.
6+ if (DEFINED SKBUILD_PROJECT_VERSION AND NOT "${SKBUILD_PROJECT_VERSION} " STREQUAL "" )
7+ set (CPP_HF_VERSION "${SKBUILD_PROJECT_VERSION} " )
8+ else ()
9+ # Fallback for plain CMake builds without scikit-build-core
10+ set (CPP_HF_VERSION "0.0" )
11+ endif ()
12+
13+ project (cpp_hf VERSION ${CPP_HF_VERSION} LANGUAGES CXX )
314
415# Prefer CONFIG packages for Boost on newer CMake
516if (POLICY CMP0167)
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [" scikit-build-core>=0.9" , " pybind11>=2.11" , " numpy" ]
2+ requires = [
3+ " scikit-build-core>=0.9" ,
4+ " pybind11>=2.11" ,
5+ " numpy" ,
6+ " setuptools_scm>=7" ,
7+ ]
38build-backend = " scikit_build_core.build"
49
510[project ]
611name = " cpp_hf"
7- version = " 0.1.0 "
12+ dynamic = [ " version " ]
813description = " Hartree–Fock (k-grid) with FFTW + Eigen via pybind11"
914readme = " Readme.md"
1015requires-python = " >=3.8"
@@ -35,3 +40,12 @@ minimum-version = "3.21"
3540
3641# You can pass -C cmake.define.X=... flags via pip to toggle features:
3742# pip install . -C cmake.define.HF_USE_OPENMP=ON -C cmake.define.HF_USE_FFTW_THREADS=ON
43+
44+ [tool .scikit-build .metadata .version ]
45+ provider = " scikit_build_core.setuptools_scm"
46+
47+ [tool .setuptools_scm ]
48+ # Strip leading 'v' from tags like v1.2.3 automatically
49+ version_scheme = " guess-next-dev"
50+ local_scheme = " node-and-date"
51+ fallback_version = " 0.0"
You can’t perform that action at this time.
0 commit comments