forked from eli64s/readme-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (40 loc) · 1.12 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
# Makefile for README-AI
SHELL = /bin/bash
VENV := readmeai
.PHONY: help style clean conda venv mem_profile profile
# Help
help:
@echo "Commands:"
@echo "clean : cleans all unnecessary files."
@echo "style : executes style formatting."
@echo "conda : creates a conda environment."
@echo "venv : creates a virtual environment."
@echo "profile : runs cProfile on the CLI script."
@echo "snakeviz : runs SnakeViz on the profile.out file."
# Style
.PHONY: style
style:
-black .
-flake8
-isort .
# Clean
.PHONY: clean
clean: style
bash scripts/clean.sh
# Conda Environment
conda:
conda create -n $(VENV) python=3.9 -y
conda activate $(VENV) && pip install -r requirements.txt
# Python Virtual Environment
venv:
python -m venv $(VENV)
source venv/bin/activate
pip install -r requirements.txt
# cProfile
profile:
@echo "Running cProfile on CLI script"
python -m cProfile -o profile.out -s cumulative src/main.py --output docs/README_AI.md --remote https://github.com/eli64s/README-AI
# SnakeViz (pip install snakeviz)
snakeviz:
@echo "Running SnakeViz on profile.out file"
snakeviz profile.out