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 65 66 67 68 69 70
|
#!/bin/bash
# SPDX-FileCopyrightText: 2024 wmj <wmj.py@gmx.com>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
PYTHON=python
SETUP=setup.py
UPTOOL=twine
VERSION := $(shell python -m setuptools_scm)
DIST_FILES := \
dist/csb43-$(VERSION)-py3-none-any.whl \
dist/csb43-$(VERSION).tar.gz
.PHONY: clean-version upload doc upload-doc
test: $(SETUP) tox.ini
$(PYTHON) -m tox
test-rebuild: $(SETUP) tox.ini
$(PYTHON) -m tox -r
local-test: $(SETUP) tox.ini
$(PYTHON) -m tox -e "py310-en,py310-es,py310-c"
local-test-rebuild: $(SETUP) tox.ini
$(PYTHON) -m tox -r -e "py310-en,py310-es,py310-c"
clean: clean-pyco clean-cache clean-pycache
clean-pyco:
@-find . -name "*.py[co]" -type f -delete
clean-cache:
@-find . -name ".cache" -type d -ls -exec rm -rv {} \;
clean-pycache:
@-find . -name "__pycache__" -type d -ls -exec rm -rv {} \;
clean-dist:
-(mkdir -p dist.old && mv dist/* dist.old/)
clean-version:
-rm -fr build/
-rm -fr csb43.egg-info/
bdist: $(SETUP) clean clean-version
$(PYTHON) -m build
doc:
(cd doc && make clean && make html)
upload-doc: $(SETUP) doc
$(PYTHON) $< upload_docs
dist: local-test-rebuild clean-version clean-dist bdist
dist/csb43-$(VERSION)-py3-none-any.whl: bdist
dist/csb43-$(VERSION).tar.gz: bdist
twine-check: $(DIST_FILES)
$(UPTOOL) check $(DIST_FILES)
upload: $(SETUP) local-test-rebuild twine-check $(DIST_FILES)
$(UPTOOL) upload $(DIST_FILES)
ofx: Makefile.ofx
$(MAKE) -f $<
|