File: Makefile

package info (click to toggle)
python-pytest-socket 0.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: python: 663; makefile: 37
file content (34 lines) | stat: -rw-r--r-- 869 bytes parent folder | download
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
.PHONY: all clean poetry test dist testrelease release

INSTALL_STAMP := .install.stamp
POETRY := $(shell command -v poetry 2> /dev/null)
PYTEST_FLAGS :=

all: test

clean:
	@find . -name \*.pyc -delete
	@find . -name __pycache__ -delete
	@rm -fr $(INSTALL_STAMP) .cache/ .coverage .pytest_cache/ *.egg-info/ dist/ htmlcov/

install: $(INSTALL_STAMP)
poetry.lock:
$(INSTALL_STAMP): pyproject.toml poetry.lock
ifndef POETRY
	$(error "poetry is not available, please install it first.")
endif
	@poetry install
	@touch $(INSTALL_STAMP)

test: $(INSTALL_STAMP)
	@poetry run coverage run -m pytest $(PYTEST_FLAGS) ; poetry run coverage report --show-missing

dist: clean $(INSTALL_STAMP)
	@poetry build

testrelease: dist
	# Requires config: `repositories.testpypi.url = "https://test.pypi.org/simple"`
	@poetry publish --repository testpypi

release: dist
	@poetry publish