File: Makefile

package info (click to toggle)
python-hl7 0.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: python: 3,833; makefile: 160
file content (64 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download | duplicates (2)
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
.PHONY: test tests build docs lint upload

BIN = env/bin
PYTHON = $(BIN)/python
PIP = $(BIN)/pip

SPHINXBUILD   = $(shell pwd)/env/bin/sphinx-build

env: requirements.txt setup.py
	test -f $(PYTHON) || python3 -m venv env
	$(PIP) install -U -r requirements.txt
	$(PYTHON) setup.py develop

tests: env
	$(BIN)/tox
.PHONY: tests

# Alias for old-style invocation
test: tests
.PHONY: test

coverage:
	$(BIN)/coverage run -m unittest discover -t . -s tests
	$(BIN)/coverage xml
.PHONY: coverage

build:
	$(PYTHON) setup.py sdist
.PHONY: build

clean-docs:
	cd docs; make clean
.PHONY: clean-docs

clean: clean-docs
	rm -rf *.egg-info .mypy_cache coverage.xml env
	find . -name "*.pyc" -type f -delete
	find . -type d -empty -delete
.PHONY: clean-python


docs:
	cd docs; make html SPHINXBUILD=$(SPHINXBUILD); make man SPHINXBUILD=$(SPHINXBUILD); make doctest SPHINXBUILD=$(SPHINXBUILD)

lint:
	$(BIN)/flake8 hl7 tests
	CHECK_ONLY=true $(MAKE) format
.PHONY: lint

CHECK_ONLY ?=
ifdef CHECK_ONLY
ISORT_ARGS=--check-only
BLACK_ARGS=--check
endif
format:
	$(BIN)/isort $(ISORT_ARGS) hl7 tests
	$(BIN)/black $(BLACK_ARGS) hl7 tests
.PHONY: isort

upload:
	rm -rf dist
	$(PYTHON) setup.py sdist bdist_wheel
	$(BIN)/twine upload dist/*
.PHONY: upload