-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (58 loc) · 1.7 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
67
68
69
70
71
72
73
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDCOLOR = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
print(OKBLUE + "Welcome! You can run these make commands:\n" + ENDCOLOR)
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print(OKGREEN + "%-30s " % target + ENDCOLOR + "%s" % (help))
endef
export PRINT_HELP_PYSCRIPT
help: ## Get help messages
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
.PHONY: help
github: ## Open the GitHub repo for this project
open https://github.com/superconductive/cooper-pair
.PHONY: github
install: ## update your python environment
pip install -r requirements.txt || echo 'No requirements.txt found'
pip install -r dev-requirements.txt || echo 'No dev-requirements.txt found'
pip install -e .
pip list
.PHONY: install-requirements
notebooks: ## Run juypter lab for your notebooks
jupyter lab
.PHONY: notebooks
clean: ## Clean out python cache files
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d | xargs rm -fr
rm -fr docs/_build/
rm -fr dist/*
.PHONY: clean
dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
ls -l dist
.PHONY: dist
release: dist ## package and upload a release
twine upload dist/*
.PHONY: release
test-pypi-release: dist ## package and upload a release to test.pypi.org
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
.PHONY: release
venv: ## Create a new virtualenv in the repo root
rm -rf venv
virtualenv venv
.PHONY: venv
test: ## Run tests
pytest -s tests
.PHONY: test