Files
asciinema/Makefile

76 lines
1.3 KiB
Makefile
Raw Normal View History

2021-10-29 23:29:42 -04:00
NAME := asciinema
VERSION := $(shell python3 -c "import asciinema; print(asciinema.__version__)")
VIRTUAL_ENV ?= .venv
2021-10-29 23:29:42 -04:00
.PHONY: test
test: test.unit test.integration
2021-10-29 23:29:42 -04:00
.PHONY: test.unit
test.unit:
pytest
2014-08-03 16:22:54 +02:00
2021-10-29 23:29:42 -04:00
.PHONY: test.integration
test.integration:
tests/integration.sh
2014-08-03 16:28:09 +02:00
.PHONY: test.distros
test.distros:
tests/distros.sh
2021-10-29 23:29:42 -04:00
.PHONY: release
release: test tag push
2014-08-09 21:51:17 +02:00
2021-10-29 23:29:42 -04:00
.PHONY: release.test
release.test: test push.test
2014-11-13 19:39:51 +01:00
2021-10-29 23:29:42 -04:00
.PHONY: .tag.exists
.tag.exists:
@git tag \
| grep -q "v$(VERSION)" \
&& echo "Tag v$(VERSION) exists" \
&& exit 1
.PHONY: tag
tag: .tag.exists
2014-11-13 19:39:51 +01:00
git tag -s -m "Releasing $(VERSION)" v$(VERSION)
git push origin v$(VERSION)
2014-11-13 19:39:51 +01:00
.PHONY: .venv
.venv:
python3 -m venv $(VIRTUAL_ENV)
2021-10-29 23:29:42 -04:00
.PHONY: .pip
.pip: .venv
. $(VIRTUAL_ENV)/bin/activate \
&& python3 -m pip install --upgrade build twine
build: .pip
. $(VIRTUAL_ENV)/bin/activate \
&& python3 -m build .
2021-10-29 23:29:42 -04:00
install: build
. $(VIRTUAL_ENV)/bin/activate \
&& python3 -m pip install .
2021-10-29 23:29:42 -04:00
.PHONY: push
push: .pip build
python3 -m twine upload dist/*
2014-11-13 19:39:51 +01:00
2021-10-29 23:29:42 -04:00
.PHONY: push.test
push.test: .pip build
python3 -m twine upload --repository testpypi dist/*
.PHONY: clean
clean:
rm -rf dist *.egg-info
clean.all: clean
find . \
-type d \
-name __pycache__ \
-o -name .pytest_cache \
-o -name .mypy_cache \
-exec rm -r "{}" +