-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (62 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
77 lines (62 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
SRC_DIR=src/fluidgym
PICT_DIR=src/fluidgym/simulation/pict
EXAMPLES_DIR=examples
TEST_DIR=tests
PYTHON ?= python
PYTEST ?= python -m pytest
PIP ?= python -m pip
MAKE ?= make
RUFF ?= ruff
MYPY ?= mypy
PRECOMMIT ?= pre-commit
.PHONY: check-ruff
check-ruff:
$(RUFF) check ${SRC_DIR} --fix || :
$(RUFF) check ${EXAMPLES_DIR} --fix || :
$(RUFF) check ${TESTS_DIR} --fix || :
.PHONY: check-mypy
check-mypy:
$(MYPY) ${SRC_DIR} --exclude "${PICT_DIR}/*" || :
check: check-ruff check-mypy
.PHONY: docs
docs:
cd docs && $(MAKE) docs && cd ..
.PHONY: upload-docs
upload-docs: docs
ghp-import -n -p -f docs/build/html
.PHONY: pre-commit
pre-commit:
$(PRECOMMIT) run --all-files || :
.PHONY: format
format:
$(RUFF) format
.PHONY: test
test:
$(PYTEST) $(TEST_DIR)
.PHONY: install
install: clean build
$(PIP) install dist/fluidgym-*.whl
.PHONY: install-dev
install-dev:
FLUIDGYM_BUILD_NOISE_EXT=1 \
MAX_JOBS=1 \
TORCH_CUDA_ARCH_LIST="8.0;8.6;9.0+PTX" \
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu128 \
$(PIP) install -e ".[dev]"
.PHONY: clean
clean:
rm -rf build dist __pycache__ src/*.egg-info
rm -rf $(SRC_DIR)/**/*.pyc $(SRC_DIR)/**/*.pyo
rm -rf $(TEST_DIR)/**/*.pyc $(TEST_DIR)/**/*.pyo
rm -rf docs/_build
.PHONY: build
build: clean
MAX_JOBS=1 \
TORCH_CUDA_ARCH_LIST="8.0;8.6;9.0+PTX" \
$(PYTHON) -m pip wheel . -w dist --no-build-isolation --no-deps
.PHONY: build-manylinux
build-manylinux: clean
@CIBW_MANYLINUX_X86_64=manylinux2014 \
CIBW_ENVIRONMENT='PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu128 TORCH_CUDA_ARCH_LIST="8.0;8.6;9.0+PTX"' \
CIBW_REPAIR_WHEEL_COMMAND='auditwheel repair -w {dest_dir} {wheel} --exclude "libtorch*" --exclude "libc10*"' \
cibuildwheel --output-dir dist .