forked from hyperliquid-dex/hyperliquid-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (48 loc) · 1.82 KB
/
Makefile
File metadata and controls
66 lines (48 loc) · 1.82 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
#* Variables
SHELL := /usr/bin/env bash -o pipefail -o errexit
#* Installation
install:
poetry lock -n --no-update && poetry export --without-hashes > requirements.txt
poetry install -n
-poetry run mypy --install-types --non-interactive ./
#* Poetry
poetry-download:
curl -sSL https://install.python-poetry.org | python -
#* Formatters
codestyle:
poetry run pyupgrade --exit-zero-even-if-changed --py37-plus **/*.py
poetry run isort --settings-path pyproject.toml ./
poetry run black --config pyproject.toml ./
formatting: codestyle
#* Linting
test:
poetry run pytest -c pyproject.toml tests/
check-codestyle:
poetry run isort --diff --check-only --settings-path pyproject.toml ./
poetry run black --diff --check --config pyproject.toml ./
poetry run darglint --verbosity 2 hyperliquid tests
check:
poetry run mypy --config-file pyproject.toml ./
check-safety:
poetry check
poetry run safety check --full-report
poetry run bandit -ll --recursive hyperliquid tests
lint: test check-codestyle mypy check-safety
update-dev-deps:
poetry add -D bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-cov@latest
poetry add -D --allow-prereleases black@latest
#* Cleaning
pycache-remove:
find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf
dsstore-remove:
find . | grep -E ".DS_Store" | xargs rm -rf
mypycache-remove:
find . | grep -E ".mypy_cache" | xargs rm -rf
ipynbcheckpoints-remove:
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
pytestcache-remove:
find . | grep -E ".pytest_cache" | xargs rm -rf
build-remove:
rm -rf build/
cleanup: pycache-remove dsstore-remove mypycache-remove ipynbcheckpoints-remove pytestcache-remove
.PHONY: all $(MAKECMDGOALS)