Skip to content

Commit 32f79d4

Browse files
authored
Merge pull request #302 from sibson/mise-env-make-primary
build: use make as primary task runner; use mise only for env\n\n- Re…
2 parents b5df9bf + be9c493 commit 32f79d4

File tree

5 files changed

+40
-288
lines changed

5 files changed

+40
-288
lines changed

.mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
# Pin the Python version for local environments managed by mise
3+
python = "3.13"

DEVELOP.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
Testing
22
---------
3-
- use pyenv on OSX to manage multiple python versions
4-
5-
``` pip install -r requirements-dev.txt
3+
- Recommended: use make for setup and running tests
4+
5+
make setup
6+
make test
7+
8+
- Or use pyenv/pip manually on macOS to manage Python versions
9+
10+
pip install -r requirements-dev.txt
611
python -m unittest discover tests
7-
```
812

913
Release
1014
---------
1115
- bump version and release to pypi
1216

13-
make version-NEWVERSION
14-
make release
17+
make release-check
18+
VERSION='M.m.p' make release
1519

1620
- create release in GitHub
1721

Makefile.venv

Lines changed: 0 additions & 271 deletions
This file was deleted.

README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,21 @@ Development
7676
--------------
7777
RedBeat is available on `GitHub <https://github.com/sibson/redbeat>`_
7878

79-
Once you have the source you can run the tests with the following commands::
79+
Once you have the source you can run the tests with make (recommended)::
80+
81+
make setup
82+
make test
83+
84+
Or using pip directly::
8085

8186
pip install -r requirements-dev.txt
8287
python -m unittest discover tests
8388

89+
Optional: if you use mise to manage Python, it will read `.mise.toml` and install the pinned Python version. After that, still use make for tasks::
90+
91+
mise install
92+
make setup && make test
93+
8494
You can also quickly fire up a sample Beat instance with::
8595

8696
celery beat --config exampleconf

makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
.PHONY: upload release release-test release-tag build version
1+
.PHONY: upload release release-test release-tag build version setup lint test unittests docs clean veryclean clean-venv release-check
22

33
REQUIREMENTS_TXT=requirements-dev.txt
44

55
test: unittests
66

7-
lint: venv
8-
$(VENV)/flake8 redbeat tests
7+
setup:
8+
python -m pip install --upgrade pip
9+
pip install -r requirements-dev.txt
10+
pip install -e .
11+
12+
lint:
13+
flake8 redbeat tests
914

1015
build:
11-
$(VENV)/python -m build
16+
python -m pip install --upgrade build && python -m build
1217

1318
release: release-check unittests release-tag
1419
release-check:
@@ -21,29 +26,30 @@ release-check:
2126
release-tag: TODAY:=$(shell date '+%Y-%m-%d')
2227
release-tag:
2328
ifndef VERSION
24-
echo "usage: make release VERSION='M.m.p'"
29+
@echo "usage: make release VERSION='M.m.p'" && false
2530
else
2631
sed -i '' -e 's|version = .*|version = $(VERSION)|' setup.cfg
2732
sed -i '' -e "s/unreleased/$(TODAY)/" CHANGES.txt
28-
git ci -m"prepare for release of $(VERSION)" CHANGES.txt setup.cfg
33+
git ci -m"prepare for release of $(VERSION)" CHANGES.txt setup.cfg || git commit -m"prepare for release of $(VERSION)" CHANGES.txt setup.cfg
2934
git tag -a v$(VERSION) -m"release version $(VERSION)"
3035
git push --tags
31-
echo "$(VERSION)dev (unreleased)\n---------------------\n$(cat CHANGES.txt)\n -\n\n" > CHANGES.txt
36+
printf "%s\n%s\n%s\n -\n" "$(VERSION)dev (unreleased)" "---------------------" "$$(cat CHANGES.txt)" > CHANGES.txt
3237
endif
3338

3439
docs:
3540
$(MAKE) -C docs/ html
3641

37-
unittests: venv
38-
$(VENV)/python -m unittest discover tests
42+
unittests:
43+
python -m unittest discover tests
3944

4045
clean:
4146
rm -f dist/*
4247
rm -rf docs/_build docs/_static docs/_templates
4348

4449
veryclean: clean clean-venv
4550

46-
include Makefile.venv
51+
clean-venv:
52+
rm -rf .venv
4753

4854
version:
4955
@grep -m1 '^version' setup.cfg | sed 's/.*= *//'

0 commit comments

Comments
 (0)