-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (36 loc) · 1.55 KB
/
Makefile
File metadata and controls
53 lines (36 loc) · 1.55 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
.PHONY: clean data lint format requirements create_environment
#################################################################################
# GLOBALS #
#################################################################################
PROJECT_NAME = PoliticalAlignmentCaseStudy
PYTHON_VERSION = 3.10
PYTHON_INTERPRETER = python
#################################################################################
# COMMANDS #
#################################################################################
## Set up python interpreter environment
create_environment:
conda create -y --name $(PROJECT_NAME) python=$(PYTHON_VERSION)
@echo ">>> conda env created. Activate with:\nconda activate $(PROJECT_NAME)"
## Install Python Dependencies
requirements:
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
$(PYTHON_INTERPRETER) -m pip install -r requirements-dev.txt
## Lint using flake8 and black (use `make format` to do formatting)
lint:
flake8 pacs
black --check --config pyproject.toml pacs
## Format source code with black
format:
black --config pyproject.toml pacs
## Delete all compiled Python files
clean:
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
add_notebooks:
python scrub_code.py 02_polviews_soln.ipynb
git add 0*.ipynb
git commit -m "Updating notebooks"
tests:
# notebook 5 won't run until Colab updates statsmodels
pytest --nbmake 0[1234]*.ipynb