Skip to content

Commit 82dc567

Browse files
committed
feat: Added do_except and do_else to other methods
Also: * Added unit tests for new functionality * Added new functionality to the demos
1 parent e47177d commit 82dc567

15 files changed

Lines changed: 401 additions & 153 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## v7.1.0 - 2025-04-19
9+
* Added `do_except` and `do_else` to `require_condition`, `enforce_defined`, and `check_expressions`
10+
* Added unit tests for new functionality
11+
* Added new functionality to the demos
12+
813
## v7.0.0 - 2025-03-28
914
* Removed `exc_builder` option from `Buzz`
1015
* Added `exc_builder` classmethod for `Buzz`

Makefile

Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,79 @@
11
.ONESHELL:
22
.DEFAULT_GOAL:=help
33
SHELL:=/bin/bash
4-
PACKAGE_NAME:=src/buzz
4+
PACKAGE_TARGET:=src/buzz
55

6-
.PHONY: test
7-
test:
8-
uv run pytest
9-
10-
.PHONY: types
11-
types:
12-
uv run mypy ${PACKAGE_NAME} src/demo --pretty
13-
uv run basedpyright ${PACKAGE_NAME} src/demo
14-
15-
.PHONY: lint
16-
lint:
17-
uv run ruff check ${PACKAGE_NAME} tests src/demo
186

19-
.PHONY: qa
20-
qa: test lint types
21-
echo "All quality checks pass!"
7+
# ==== Helpers =========================================================================================================
8+
.PHONY: confirm
9+
confirm: ## Don't use this directly
10+
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
2211

23-
.PHONY: format
24-
format:
25-
uv run ruff format ${PACKAGE_NAME} tests src/demo
2612

27-
.PHONY: docs
28-
docs:
29-
uv run mkdocs build --config-file=docs/mkdocs.yaml
30-
31-
.PHONY: docs-serve
32-
docs-serve:
33-
uv run mkdocs serve --config-file=docs/mkdocs.yaml --dev-addr=localhost:10000
13+
.PHONY: help
14+
help: ## Show help message
15+
@awk 'BEGIN {FS = ": .*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_\/-]+(\\:[$$()% 0-9a-zA-Z_\/-]+)*:.*?##/ { gsub(/\\:/,":", $$1); printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3416

3517
.PHONY: clean
36-
clean:
18+
clean: ## Clean up build artifacts and other junk
3719
@rm -rf .venv
3820
@uv run pyclean . --debris
3921
@rm -rf dist
40-
@rm -rf .mypy_cache
41-
@rm -rf .pytest_cache
4222
@rm -rf .ruff_cache
23+
@rm -rf .pytest_cache
24+
@rm -rf .mypy_cache
4325
@rm -f .coverage*
4426
@rm -f .junit.xml
4527

46-
# Recipe stolen from: https://gist.github.com/prwhite/8168133?permalink_comment_id=4160123#gistcomment-4160123
47-
.PHONY: help
48-
help: ## Show help message
49-
@awk 'BEGIN {FS = ": .*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+(\\:[$$()% 0-9a-zA-Z_-]+)*:.*?##/ { gsub(/\\:/,":", $$1); printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
28+
29+
# ==== Quality Control =================================================================================================
30+
.PHONY: qa/test
31+
qa: qa/full ## Shortcut for qa/full
32+
33+
.PHONY: qa/test
34+
qa/test: ## Run the tests
35+
uv run pytest
36+
37+
.PHONY: qa/types
38+
qa/types: ## Run static type checks
39+
uv run mypy ${PACKAGE_TARGET} tests src/demo --pretty
40+
uv run basedpyright ${PACKAGE_TARGET} tests src/demo
41+
42+
.PHONY: qa/lint
43+
qa/lint: ## Run linters
44+
uv run ruff check ${PACKAGE_TARGET} tests src/demo
45+
uv run typos ${PACKAGE_TARGET} tests src/demo
46+
47+
.PHONY: qa/full
48+
qa/full: qa/test qa/lint qa/types ## Run the full set of quality checks
49+
@echo "All quality checks pass!"
50+
51+
.PHONY: qa/format
52+
qa/format: ## RUn code formatter
53+
uv run ruff format ${PACKAGE_TARGET} tests src/demo
54+
55+
56+
# ==== Documentation ===================================================================================================
57+
.PHONY: docs
58+
docs: docs/serve ## Shortcut for docs/serve
59+
60+
.PHONY: docs/build
61+
docs/build: ## Build the documentation
62+
uv run mkdocs build --config-file=docs/mkdocs.yaml
63+
64+
.PHONY: docs/serve
65+
docs/serve: ## Build the docs and start a local dev server
66+
uv run mkdocs serve --config-file=docs/mkdocs.yaml --dev-addr=localhost:10000
67+
68+
69+
# ==== Demo Commands ===================================================================================================
70+
.PHONY: demo
71+
demo: demo/run ## Shortcut for demo/run
72+
73+
.PHONY: demo/run
74+
demo/run: ## Run the app in debug mode
75+
uv run py-buzz-demo
76+
77+
.PHONY: demo/debug
78+
demo/debug: ## Run the app in debug mode
79+
uv run debugpy --listen localhost:5678 --wait-for-client py-buzz-demo

0 commit comments

Comments
 (0)