forked from eli64s/readme-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (52 loc) · 1.78 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
COMMITS := 10
SHELL := /bin/bash
SRC_PATH := readmeai
TEST_PATH := tests
VENV := readmeai
.PHONY: clean
clean: ## Remove project build artifacts
./scripts/clean.sh clean
.PHONY: conda-recipe
conda-recipe: ## Create conda recipe for conda-forge
grayskull pypi readmeai
conda build .
.PHONY: git-log
git-log: ## Display git log for last 'N' commits
git log -n ${COMMITS} --pretty=tformat: --shortstat
.PHONY: git-rm-cache
git-rm-cache: ## Remove all files from git cache
git rm -r --cached .
.PHONY: poetry-clean
poetry-clean: ## Removes Poetry virtual environment and lock file.
poetry env remove --all && rm poetry.lock
.PHONY: poetry-install
poetry-install: ## Install dependencies using Poetry.
poetry install
.PHONY: poetry-shell
poetry-shell: ## Launch a shell within Poetry virtual environment.
poetry shell
.PHONY: poetry-to-requirements
poetry-to-reqs: ## Export poetry requirements to requirements.txt
poetry export -f requirements.txt --output setup/requirements.txt --without-hashes
.PHONY: ruff-format
ruff-format: ## Format codebase using Ruff
ruff check --select I --fix .
ruff format .
.PHONY: ruff-lint
ruff-lint: ## Lint codebase using Ruff
ruff check . --fix
.PHONY: search
search: ## Search for a word in the codebase
grep -Ril ${WORD} readmeai tests scripts setup
.PHONY: test
test: ## Run unit tests using pytest
poetry run pytest
.PHONY: test-nox
test-nox: ## Run test suite against multiple Python versions
nox -f noxfile.py
.PHONY: help
help: Makefile ## Display the help menu
@echo -e ""
@echo -e "Usage: make [target]"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo -e "__________________________________________________________________________________________\n"