From 46a9160e38e47ecdbc91a63d2a518812cf0c108d Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sun, 18 Feb 2024 01:04:53 +0000 Subject: [PATCH] cache build dir --- .github/workflows/test.yml | 4 ++-- .gitignore | 1 + CONTRIBUTING.md | 2 +- Makefile | 4 +--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9bd3d2..6f0ffbd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: - run: make test - uses: codecov/codecov-action@v4 - name: compile -Wall - run: make build-wheel + run: make clean build-wheel cuda: if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association) name: CUDA py${{ matrix.python }} @@ -76,7 +76,7 @@ jobs: - run: make test - uses: codecov/codecov-action@v4 - name: compile -Wall - run: make CUDA_ARCHITECTURES=all build-wheel + run: make CUDA_ARCHITECTURES=all clean build-wheel - name: Post Run setup-python run: setup-python -p${{ matrix.python }} -Dr if: ${{ always() }} diff --git a/.gitignore b/.gitignore index 9f801ee..4a3acf9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ /cuvec/example_swig.py /cuvec/swvec.py /dist/ +/build/ /docs/build/ # Unit test / coverage reports diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5425ad..f8f461c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Install in "development/editable" mode including dev/test dependencies: # clone & install dependencies (one-off) git clone https://github.com/AMYPAD/CuVec cd CuVec -make deps-build +make deps-build deps-run # delete build artefacts, (re)build & install in-place with debug info make CUVEC_DEBUG=1 build-editable diff --git a/Makefile b/Makefile index baca608..1080a55 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,7 @@ endif .PHONY: build-editable clean deps-build deps-run build-wheel build-editable: git diff --exit-code --quiet '*/src/**' || (echo "Uncommitted changes in */src"; exit 1) - @$(MAKE) clean - pip install --no-build-isolation --check-build-dependencies --no-deps -t . -U -v . $(BUILD_CMAKE_FLAGS) + pip install --no-build-isolation --check-build-dependencies -Cbuild-dir=build --no-deps -t . -U -v . $(BUILD_CMAKE_FLAGS) git restore '*/src/**' test: pytest -k "not perf" -n=3 @@ -27,6 +26,5 @@ deps-run: pip install toml python -c 'import toml; c=toml.load("pyproject.toml"); print("\0".join(c["project"]["dependencies"] + c["project"]["optional-dependencies"]["dev"]), end="")' | xargs -0 pip install build-wheel: - @$(MAKE) clean pip install build python -m build -n -w $(BUILD_CMAKE_FLAGS)