-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (52 loc) · 1.98 KB
/
Makefile
File metadata and controls
66 lines (52 loc) · 1.98 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
PACKAGE_NAME := a3fe
PACKAGE_DIR := a3fe
# Only need slurm, which is linux only
CONDA_ENV_RUN = conda run --no-capture-output --name $(PACKAGE_NAME)
TEST_ARGS := -v --cov=$(PACKAGE_DIR) --cov-report=term --cov-report=xml --junitxml=unit.xml --color=yes
.PHONY: env env-dev env-ci lint format test test-integration docs-build docs clean
# Regular users:
env:
mamba create -y --name $(PACKAGE_NAME) $(if $(PYTHON_VERSION),python=$(PYTHON_VERSION))
mamba env update --name $(PACKAGE_NAME) --file devtools/conda-envs/base_env.yaml
$(CONDA_ENV_RUN) pip install --no-deps -e .
# Developers with local GROMACS
env-dev:
mamba create -y --name $(PACKAGE_NAME) $(if $(PYTHON_VERSION),python=$(PYTHON_VERSION))
mamba env update --name $(PACKAGE_NAME) --file devtools/conda-envs/dev_env.yaml
$(CONDA_ENV_RUN) pip install --no-deps -e .
$(CONDA_ENV_RUN) pre-commit install || true
# CI and developers without GROMACS
env-ci:
mamba create -y --name $(PACKAGE_NAME) $(if $(PYTHON_VERSION),python=$(PYTHON_VERSION))
mamba env update --name $(PACKAGE_NAME) --file devtools/conda-envs/ci_env.yaml
$(CONDA_ENV_RUN) pip install --no-deps -e .
$(CONDA_ENV_RUN) pre-commit install || true
# code check
lint:
$(CONDA_ENV_RUN) ruff check $(PACKAGE_DIR)
# code format
format:
$(CONDA_ENV_RUN) ruff format $(PACKAGE_DIR)
$(CONDA_ENV_RUN) ruff check --fix --select I $(PACKAGE_DIR)
# run tests
test:
$(CONDA_ENV_RUN) pytest $(TEST_ARGS) $(PACKAGE_DIR)/tests/
# run integration tests (requires SLURM environment)
test-integration:
$(CONDA_ENV_RUN) RUN_SLURM_TESTS=1 pytest $(TEST_ARGS) $(PACKAGE_DIR)/tests/ --run-integration -v
# build docs
docs-build:
cd docs && $(CONDA_ENV_RUN) make html
docs:
cd docs && $(CONDA_ENV_RUN) make html
@echo "Documentation built in docs/_build/html/"
# clean build files
clean:
rm -rf docs/_build/
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# deploy docs
# consider supporting this in the future