File tree Expand file tree Collapse file tree 6 files changed +17
-23
lines changed Expand file tree Collapse file tree 6 files changed +17
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1414 with :
1515 python-version : ${{ inputs.python-version }}
1616 cache : ' poetry'
17- - name : Install dependencies
18- run : poetry install --all-extras
17+ - name : Install only dependencies and not the package itself
18+ run : poetry install --all-extras --no-root
1919 shell : bash
Original file line number Diff line number Diff line change 11on :
22 workflow_call :
33
4+ env :
5+ CMAKE_BUILD_TYPE : Debug
6+
47jobs :
58 run-checks :
69 runs-on : ubuntu-latest
1821 - name : Run styling check
1922 run : poetry run pre-commit run --all-files
2023 - name : Install with poetry
21- run : poetry install
24+ run : poetry install --all-extras
2225 - name : Testing
2326 run : |
2427 poetry run pytest -v tests
2528 - name : Build with poetry
2629 run : poetry build
27-
Original file line number Diff line number Diff line change 1515env :
1616 # disable keyring (https://github.com/actions/runner-images/issues/6185):
1717 PYTHON_KEYRING_BACKEND : keyring.backends.null.Keyring
18- BUILD_TYPE : Release
1918
2019jobs :
2120 code-checks :
Original file line number Diff line number Diff line change 11on :
22 workflow_call :
33
4+ env :
5+ CMAKE_BUILD_TYPE : Release
6+
47jobs :
58 build_wheels :
69 name : Build wheel for py${{ matrix.python-version }} ${{ matrix.os.platform_id }} ${{ matrix.os.macos_version }}
4750 with :
4851 python-version : ${{ matrix.python-version }}
4952
50- # - name: Install dependencies [linux]
51- # if: matrix.os.platform == 'linux'
52- # run: sudo apt-get install -y libldap-common
53- # shell: bash
54-
5553 - name : Install poetry
5654 run : pipx install poetry==1.8.3 --python $(which python3)
5755 shell : bash
8684 CIBW_REPAIR_WHEEL_COMMAND_MACOS : " " # do not run delocate-wheel before the re-tag
8785 CIBW_ENVIRONMENT : " MACOSX_DEPLOYMENT_TARGET=${{ matrix.os.macos_version }}.0"
8886 ARCHFLAGS : -arch x86_64
87+ BUILD_THREADS : " 4"
8988 run : |
9089 echo "Building wheel ${CIBW_BUILD}"
9190 poetry run python --version
@@ -122,6 +121,7 @@ jobs:
122121 CIBW_REPAIR_WHEEL_COMMAND_MACOS : " " # do not run delocate-wheel before the re-tag
123122 CIBW_ENVIRONMENT : " MACOSX_DEPLOYMENT_TARGET=${{ matrix.os.macos_version }}.0"
124123 ARCHFLAGS : -arch arm64
124+ BUILD_THREADS : " 4"
125125 run : |
126126 echo "Building wheel ${CIBW_BUILD}"
127127 poetry run python --version
@@ -164,6 +164,7 @@ jobs:
164164 CIBW_SKIP : " pp* *musllinux_* *_i686* *_s390*"
165165 CIBW_PROJECT_REQUIRES_PYTHON : " >=3.8"
166166 CIBW_BUILD_VERBOSITY : 3
167+ BUILD_THREADS : " 8"
167168 run : |
168169 echo "Building wheel ${CIBW_BUILD}"
169170 poetry run python --version
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def run(cmd, cwd="./"):
2525 return False
2626
2727
28- def build_local (multi_threaded = True ):
28+ def build_local (num_threads : int ):
2929
3030 if not os .path .exists (BUILD_DIR ):
3131 print ("python executable: " , sys .executable )
@@ -38,13 +38,13 @@ def build_local(multi_threaded=True):
3838 print (f"build directory detected: { BUILD_DIR } " )
3939
4040 cmd = f"cmake --build { BUILD_DIR } --target install"
41- if multi_threaded :
42- cmd += " -j 4 "
41+ if num_threads > 1 :
42+ cmd += f " -j { num_threads } "
4343 success = run (cmd , cwd = ROOT_DIR )
4444 if not success :
4545 raise RuntimeError ("Error building." )
4646
4747
4848if "__main__" == __name__ :
49-
50- build_local (multi_threaded = False )
49+ num_threads = int ( os . getenv ( "BUILD_THREADS" , "4" ))
50+ build_local (num_threads = num_threads )
You can’t perform that action at this time.
0 commit comments