Skip to content

Commit 39584a7

Browse files
committed
Switch to poetry for building dists
1 parent fe73299 commit 39584a7

File tree

6 files changed

+1088
-50
lines changed

6 files changed

+1088
-50
lines changed

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.PHONY: help init build test lint pretty precommit_install bump_major bump_minor bump_patch
2+
3+
BIN = .venv/bin/
4+
CODE = sphinxarg
5+
6+
help: # Make help to show possible targets
7+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
8+
9+
init: ## Create a virtualenv for dev
10+
python3 -m venv .venv
11+
.venv/bin/pip install -U pip setuptools
12+
poetry install
13+
14+
build: ## Build the sdist/wheel packages
15+
poetry build
16+
17+
test: ## Test the project
18+
poetry run pytest --verbosity=2 --strict --log-level=DEBUG $(args)
19+
20+
lint: ## Check code for style
21+
poetry run flake8 --statistics --show-source $(CODE) test/
22+
poetry run black --diff --check $(CODE) test/
23+
poetry run pytest --dead-fixtures --dup-fixtures
24+
25+
pretty: ## Prettify the code
26+
poetry run isort $(CODE) test/
27+
poetry run black $(CODE) test/
28+
29+
precommit_install: ## Install simple pre-commit checks
30+
echo -e '#!/bin/sh\nmake lint test\n' > .git/hooks/pre-commit
31+
chmod +x .git/hooks/pre-commit
32+
33+
bump_major: ## Release a new major version
34+
poetry version major
35+
36+
bump_minor: ## Release a new minor version
37+
poetry version minor
38+
39+
bump_patch: ## Release a new patch version
40+
poetry version patch

0 commit comments

Comments
 (0)