-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
61 lines (47 loc) · 1.36 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
.PHONY: clean prepare wheel install dist check_dist upload dev_tools bump release
NO_COLOR = \x1b[0m
OK_COLOR = \x1b[32;01m
ERROR_COLOR = \x1b[31;01m
PYCACHE := $(shell find . -name '__pycache__')
EGGS := $(wildcard *.egg-info)
CURRENT_VERSION := $(shell awk '/current_version/ {print $$3}' .bumpversion.cfg)
clean:
@echo "$(OK_COLOR)=> Cleaning$(NO_COLOR)"
@rm -fr build dist $(EGGS) $(PYCACHE)
prepare: clean
git add .
git status
git commit -m "cleanup before release"
ext:
cd interrupt_ipykernel_labextension && \
jupyter labextension install --no-build && \
jupyter lab build --dev-build=True --minimize=False
# Version commands
bump:
ifdef part
ifdef version
bumpversion --allow-dirty --new-version $(version) $(part) && grep current .bumpversion.cfg
else
bumpversion --allow-dirty $(part) && grep current .bumpversion.cfg
endif
else
@echo "$(ERROR_COLOR)Provide part=major|minor|patch|release|build and optionally version=x.y.z...$(NO_COLOR)"
exit 1
endif
# Dist commands
dist:
@python setup.py sdist bdist_wheel
release:
git add .
git status
git commit -m "Latest release: $(CURRENT_VERSION)"
git tag -a v$(CURRENT_VERSION) -m "Latest release: $(CURRENT_VERSION)"
install:
@echo "$(OK_COLOR)=> Installing ssh_ipykernel$(NO_COLOR)"
@pip install --upgrade .
check_dist:
@twine check dist/*
upload:
@twine upload dist/*
dev_tools:
pip install .[dev]