-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathMakefile
More file actions
178 lines (126 loc) · 3.72 KB
/
Makefile
File metadata and controls
178 lines (126 loc) · 3.72 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
clean: clean-pyc clean-ipynb clean-catboost clean-build clean-test
clean-progress_board:
find . -name '*.csv~' -exec rm -f {} +
find . -name '*.lock~' -exec rm -f {} +
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-ipynb:
find . -name '*.ipynb_checkpoints' -exec rm -fr {} +
clean-catboost:
find . -name 'catboost_info' -exec rm -fr {} +
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-test:
cd tests/; \
rm -f .coverage; \
rm -fr htmlcov/
test-search_space:
cd tests/; \
i=0; while [ "$$i" -le 100 ]; do \
i=$$((i + 1));\
pytest -q test_search_spaces.py; \
done
test-pytest:
python -m pytest --durations=10 -x -p no:warnings tests/; \
test-src:
python -m pytest --durations=10 --verbose -x -p no:warnings src/hyperactive/; \
test-timings:
cd tests/_local_test_timings; \
pytest *.py -x -p no:warnings
test-local: test-timings
test: test-src test-pytest test-local
test-examples:
cd tests; \
python _test_examples.py
test-extensive: test test-local test-examples
push: test
git push
release: reinstall test-extensive
python -m twine upload dist/*
dist:
python setup.py sdist
python setup.py bdist_wheel
ls -l dist
build:
python -m build
install: build
pip install dist/*.whl
uninstall:
pip uninstall -y hyperactive
rm -fr build dist *.egg-info
install-test-requirements:
python -m pip install --no-cache-dir .[test]
install-build-requirements:
python -m pip install --no-cache-dir .[build]
install-all-extras:
python -m pip install --no-cache-dir .[all_extras]
install-no-extras-for-test:
python -m pip install --no-cache-dir .[test]
install-all-extras-for-test:
python -m pip install --no-cache-dir .[all_extras,test,test_parallel_backends,sktime-integration]
install-editable:
pip install -e .
reinstall: uninstall install
reinstall-editable: uninstall install-editable
# === Linting and Formatting Commands ===
# Run ruff linter to check for code issues
lint:
ruff check .
# Run ruff linter with auto-fix for fixable issues
lint-fix:
ruff check --fix .
# Format code using ruff formatter
format:
ruff format .
# Check formatting without making changes
format-check:
ruff format --check .
# Sort imports using ruff (isort functionality)
isort:
ruff check --select I --fix .
# Check import sorting without making changes
isort-check:
ruff check --select I .
# Run all code quality checks (lint + format check + import check)
check: lint format-check isort-check
# Fix all auto-fixable issues (lint + format + imports)
fix: lint-fix format isort
# === Notebook-specific Commands ===
# Run ruff on Jupyter notebooks
lint-notebooks:
ruff check --include="*.ipynb" .
# Fix ruff issues in Jupyter notebooks
lint-notebooks-fix:
ruff check --include="*.ipynb" --fix .
# Format Jupyter notebooks with black via nbqa
format-notebooks:
pre-commit run nbqa-black --all-files
# Run all notebook checks and fixes
notebooks-fix: lint-notebooks-fix format-notebooks
# === Pre-commit Commands ===
# Install pre-commit hooks
pre-commit-install:
pre-commit install
# Run pre-commit on all files
pre-commit-all:
pre-commit run --all-files
# Run pre-commit on staged files only
pre-commit:
pre-commit run
# Update pre-commit hooks to latest versions
pre-commit-update:
pre-commit autoupdate
# === Combined Quality Commands ===
# Run comprehensive code quality checks
quality-check: check lint-notebooks
# Fix all code quality issues
quality-fix: fix notebooks-fix
# Full quality workflow: install hooks, fix issues, run final check
quality: pre-commit-install quality-fix quality-check