-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (40 loc) · 1.88 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
.PHONY: install install_all example test test_all mypy lab kernel docs help
.PHONY: publish release pypi
install: ## Install this package in the current environment
pip install -e .
install_all: ## Install everything
pip install -e ".[all]"
# Examples and tests ===========================================================
# Run: pip install -e ".[examples]"
example: ## Run through the example script
python ./examples/example_usage.py
test: ## Run the unit tests
@python -m pytest -s tests --typeguard-packages=bayesian_lora -k "not test_example"
test_all: ## Run all the tests (including the slow ones)
@python -m pytest -s tests --run-slow
# Development ==================================================================
# Run: pip install -e ".[dev]"
mypy: ## Run static type checking
@mypy
lab: ## To start a Jupyter Lab server
@python -m jupyter lab --notebook-dir=notebooks
kernel: ## To setup a Jupyter kernel to run notebooks in the project's virtual env
python -m ipykernel install --user --name bayesian_lora \
--display-name "bayesian_lora"
pypi: ## Creates a source distribution and wheel, and uplaods to PyPI
python3 -m pip install --upgrade build
python3 -m build
python3 -m twine upload dist/*
release: ## Create release for GitHub
$(eval VERSION := $(shell python -c "import bayesian_lora; print(bayesian_lora.__version__)"))
git checkout master
git pull origin master
git tag -a $(VERSION) -m "Release version $(VERSION)"
git push origin $(VERSION)
publish: release pypi ## Publish a new release and PyPI package
# Documentation ================================================================
# Run: pip install -e ".[docs]"
docs: ## Compile the documentation and start watcher
@./documentation/writedocs.sh
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'