-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
76 lines (60 loc) · 1.74 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
74
75
76
PYTHON := python3
PACKAGE := SimpleSQLite
BUILD_WORK_DIR := _work
DOCS_DIR := docs
PKG_BUILD_DIR := $(BUILD_WORK_DIR)/$(PACKAGE)
AUTHOR := Tsuyoshi Hombashi
FIRST_RELEASE_YEAR := 2016
LAST_UPDATE_YEAR := $(shell git log -1 --format=%cd --date=format:%Y)
.PHONY: build-remote
build-remote: clean
@mkdir -p $(BUILD_WORK_DIR)
@cd $(BUILD_WORK_DIR) && \
git clone /~https://github.com/thombashi/$(PACKAGE).git --depth 1 && \
cd $(PACKAGE) && \
$(PYTHON) -m tox -e build
ls -lh $(PKG_BUILD_DIR)/dist/*
.PHONY: build
build: clean
@$(PYTHON) -m tox -e build
ls -lh dist/*
.PHONY: check
check:
$(PYTHON) -m tox -e lint
$(PYTHON) -m tox -e lint-examples
.PHONY: clean
clean:
@rm -rf $(BUILD_WORK_DIR)
@$(PYTHON) -m tox -e clean
.PHONY: docs
docs:
@$(PYTHON) -m tox -e docs
.PHONY: run-sample
run-sample:
find sample/ -name "*.py" | \grep -v sample_create_table_from_gs.py | xargs -I{} $(PYTHON) {}
.PHONY: idocs
idocs:
@$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade .
@$(MAKE) docs
.PHONY: fmt
fmt:
@$(PYTHON) -m tox -e fmt
.PHONY: readme
readme:
@$(PYTHON) -m tox -e readme
.PHONY: release
release:
$(PYTHON) -m tox -e release
$(MAKE) clean
.PHONY: setup-ci
setup-ci:
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade pip
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade tox
.PHONY: setup-dev
setup-dev: setup-ci
$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .[test]
-$(PYTHON) -m pip check
.PHONY: update-copyright
update-copyright:
sed -i "s/f\"Copyright .*/f\"Copyright $(FIRST_RELEASE_YEAR)-$(LAST_UPDATE_YEAR), {__author__}\"/" simplesqlite/__version__.py
sed -i "s/^Copyright (c) .* $(AUTHOR)/Copyright (c) $(FIRST_RELEASE_YEAR)-$(LAST_UPDATE_YEAR) $(AUTHOR)/" LICENSE