-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (56 loc) · 2.58 KB
/
Makefile
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
78
.PHONY: codestyle formatting docstring pre-commit clean clean-build clean-pyc clean-linting clean-test clean-log
# --------------------------------------------------------------------------- #
# Style targets
# --------------------------------------------------------------------------- #
codestyle: ## check codestyle (black, isort, ruff)
isort --settings-path pyproject.toml ./
black --config pyproject.toml ./
ruff check ./**
# --------------------------------------------------------------------------- #
# Cleaning targets
# --------------------------------------------------------------------------- #
clean: clean-build clean-pyc clean-linting clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
for /d /r %%d in (*.egg-info) do rd /s /q "%%d"
for /d /r %%d in (*.egg) do rd /s /q "%%d"
for /d /r %%d in (*.eggs) do rd /s /q "%%d"
for /d /r %%d in (build) do rd /s /q "%%d"
for /d /r %%d in (dist) do rd /s /q "%%d"
clean-pyc: ## remove Python file and dir artifacts
for /f "delims=" %%f in ('dir /s /b *.pyc') do del /f /q "%%f"
for /f "delims=" %%f in ('dir /s /b *.pyo') do del /f /q "%%f"
for /d /r %%d in (__pycache__) do rd /s /q "%%d"
for /d /r %%d in (.ipynb_checkpoints) do rd /s /q "%%d"
clean-linting: ## remove linting artifacts
rmdir /s /q .ruff_cache
rmdir /s /q .pytest_cache
rmdir /s /q .vscode
clean-log: ## remove log files in /log folder
del /f /q "log\*.log"
# --------------------------------------------------------------------------- #
# Conda targets
# --------------------------------------------------------------------------- #
conda-create: ## create conda environment
conda env create -f environment.yml
conda-update: ## update conda environment
conda env update -f environment.yml
conda-export: ## export conda environment
conda env export > environment.yml
# --------------------------------------------------------------------------- #
# Installation targets using pipx
# --------------------------------------------------------------------------- #
install-global: install-pre-commit install-black install-isort install-ruff install-pyment install-cookiecutter install-pytest## install global tools
install-pre-commit: ## install pre-commit
pipx install pre-commit --user
install-black: ## install black
pipx install black
install-isort: ## install isort
pipx install isort
install-ruff: ## install ruff
pipx install ruff
install-pyment: ## install pyment
pipx install pyment
install-cookiecutter: ## install cookiecutter
pipx install cookiecutter
install-pytest: ## install pytest
pipx install pytest