-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (46 loc) · 1.5 KB
/
Makefile
File metadata and controls
62 lines (46 loc) · 1.5 KB
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
RAWVERSION = $(filter-out __version__ = , $(shell grep __version__ selectjs/__init__.py))
VERSION = $(strip $(shell echo $(RAWVERSION)))
PACKAGE = django-selectjs
clean:
rm -rf *.tar.gz dist build *.egg-info *.rpm
find . -name "*.pyc" | xargs rm
find . -name "__pycache__" | xargs rm -rf
version:
@echo $(VERSION)
dist: clean
@python -m build
release: dist
@bin/release.sh
compile: uv.lock
# @uv pip compile --group demo --group docs --group test pyproject.toml -o requirements.txt
@uv pip compile pyproject.toml -o requirements.txt
MAIN_BRANCH = master
# --- Gate checks ---
check-branch:
@branch="$$(git rev-parse --abbrev-ref HEAD)"; \
[[ "$$branch" == "$(MAIN_BRANCH)" ]] || { echo "You're not on $(MAIN_BRANCH); aborting."; exit 1; }
check-clean:
@[[ -z "$$(git status --untracked-files=no --porcelain)" ]] || { echo "You have uncommitted changes; aborting."; exit 1; }
# --- Shared release pipeline ---
# Expects BUMP=dev|patch|minor|major
_release: compile check-branch check-clean clean
@echo "Releasing $(BUMP) version"
@bumpversion "$(BUMP)"
@python -m build
@bin/release.sh
# --- Explicit release targets (better tab-complete & discoverability) ---
release-dev:
$(MAKE) _release BUMP=dev
release-patch:
$(MAKE) _release BUMP=patch
release-minor:
$(MAKE) _release BUMP=minor
release-major:
$(MAKE) _release BUMP=major
pypi: dist
@twine upload dist/*
tox:
# create a tox pyenv virtualenv based on 2.7.x
# install tox and tox-pyenv in that ve
# actiave that ve before running this
@tox