forked from thombashi/pytablewriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (48 loc) · 1.2 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
AUTHOR := thombashi
PACKAGE := pytablewriter
DOCS_DIR := docs
DOCS_BUILD_DIR := $(DOCS_DIR)/_build
BUILD_WORK_DIR := _work
DIST_DIR := $(BUILD_WORK_DIR)/$(PACKAGE)/dist
.PHONY: build
build:
@rm -rf $(BUILD_WORK_DIR)/
@mkdir -p $(BUILD_WORK_DIR)/
@cd $(BUILD_WORK_DIR); \
git clone https://github.com/$(AUTHOR)/$(PACKAGE).git; \
cd $(PACKAGE); \
python setup.py sdist bdist_wheel
@twine check $(DIST_DIR)/*
ls -l $(DIST_DIR)
.PHONY: clean
clean:
@rm -rf $(PACKAGE)-*.*.*/ \
$(BUILD_WORK_DIR) \
$(DOCS_BUILD_DIR) \
dist/ \
pip-wheel-metadata/ \
.eggs/ \
.pytest_cache/ \
.tox/ \
**/*/__pycache__/ \
*.egg-info/
@find . -not -path '*/\.*' -type f | grep -E .+\.py\.[a-z0-9]{32,}\.py$ | xargs -r rm
.PHONY: docs
docs:
@python setup.py build_sphinx --source-dir=$(DOCS_DIR)/ --build-dir=$(DOCS_BUILD_DIR) --all-files
.PHONY: idocs
idocs:
@pip install --upgrade .
@make docs
.PHONY: fmt
fmt:
@black $(CURDIR)
@autoflake --in-place --recursive --remove-all-unused-imports --exclude "__init__.py" .
@isort --apply --recursive
.PHONY: readme
readme:
@cd $(DOCS_DIR); python make_readme.py
.PHONY: release
release:
@cd $(BUILD_WORK_DIR)/$(PACKAGE); python setup.py release --sign
@make clean