-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 999 Bytes
/
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
.PHONY: install format lint test build publish
VERSION=$(shell python -c 'from importlib import metadata; print(metadata.version("databudgie"))')
install:
poetry install -E psycopg2-binary -E s3
format:
ruff --fix src tests
black src tests
lint:
ruff src tests || exit 1
mypy --namespace-packages src tests || exit 1
black --check --diff src tests || exit 1
test:
coverage run -a -m pytest src tests
coverage report
coverage xml
## Build
build-package:
poetry build
build-docs:
pip install -r docs/requirements.txt
make -C docs html
build-image:
docker build \
-t schireson/databudgie \
-t schireson/databudgie:latest \
-t schireson/databudgie:$(VERSION) \
.
build: build-package build-docs build-image
## Publish
publish-package: build-package
poetry publish -u __token__ -p '${PYPI_PASSWORD}' --no-interaction
publish-image: build-image
docker push schireson/databudgie:latest
docker push schireson/databudgie:$(VERSION)
publish: publish-package publish-image