Skip to content

Commit 4d7bb05

Browse files
committed
feat: Migrated projet to uv
Also fixed some typing issues.
1 parent 4f37667 commit 4d7bb05

File tree

16 files changed

+1375
-211
lines changed

16 files changed

+1375
-211
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,16 @@ jobs:
1212

1313
steps:
1414
- name: Checkout repository
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616

17-
- name: Set up Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: 3.13
21-
22-
- name: Set up Poetry
23-
uses: Gr1N/setup-poetry@v8
24-
with:
25-
poetry-version: 1.8.4
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v3
2619

27-
- name: Log in to pypi
28-
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_KEY }}
20+
- name: Set up Python
21+
run: uv python install 3.13
2922

3023
- name: Build package
31-
run: poetry build
24+
run: uv build
3225

3326
- name: Publish package
34-
run: poetry publish
27+
run: uv publish --token=${{ secrets.PYPI_API_KEY }}

.github/workflows/docs.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ jobs:
1414

1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

19-
- name: Set up Python
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: 3.13
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v3
2321

24-
- name: Set up Poetry
25-
uses: Gr1N/setup-poetry@v8
26-
with:
27-
poetry-version: 1.8.4
22+
- name: Set up Python
23+
run: uv python install 3.13
2824

2925
- name: Build Documentation
3026
run: |

.github/workflows/main.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

20-
- name: Set up Python
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: ${{ matrix.python-version }}
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2422

25-
- name: Set up Poetry
26-
uses: Gr1N/setup-poetry@v8
27-
with:
28-
poetry-version: 1.8.4
23+
- name: Install python
24+
run: uv python install ${{ matrix.python-version }}
2925

3026
- name: Check Quality
3127
run: make qa

.pre-commit-config.yaml

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

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ 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+
## v6.0.0 - 2025-03-21
9+
* Converted to a uv project
10+
* Fixed typing issues
11+
812
## v5.0.2 - 2025-01-29
913
* Update docstrings and docs for `handle_errors_async`
1014

Makefile

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,46 @@
11
.ONESHELL:
22
.DEFAULT_GOAL:=help
33
SHELL:=/bin/bash
4-
PACKAGE_NAME:=buzz
5-
6-
.PHONY: install
7-
install:
8-
poetry install
4+
PACKAGE_NAME:=src/buzz
95

106
.PHONY: test
11-
test: install
12-
poetry run pytest
7+
test:
8+
uv run pytest
139

1410
.PHONY: mypy
15-
mypy: install
16-
poetry run mypy ${PACKAGE_NAME} --pretty
11+
types:
12+
uv run mypy ${PACKAGE_NAME} --pretty
1713

1814
.PHONY: lint
19-
lint: install
20-
poetry run ruff check ${PACKAGE_NAME} tests
15+
lint:
16+
uv run ruff check ${PACKAGE_NAME} tests
2117

2218
.PHONY: qa
23-
qa: test lint mypy
19+
qa: test lint types
2420
echo "All quality checks pass!"
2521

2622
.PHONY: format
27-
format: install
28-
poetry run ruff format ${PACKAGE_NAME} tests
23+
format:
24+
uv run ruff format ${PACKAGE_NAME} tests
2925

3026
.PHONY: docs
31-
docs: install
32-
cd docs
33-
poetry run mkdocs build
27+
docs:
28+
cd docs/ && uv run mkdocs build
3429

3530
.PHONY: docs-serve
36-
docs-serve: install
37-
cd docs
38-
poetry run mkdocs serve
31+
docs-serve:
32+
cd docs/ && uv run mkdocs serve
3933

4034
.PHONY: clean
4135
clean:
42-
@find . -iname '*.pyc' -delete
43-
@find . -iname '*.pyo' -delete
44-
@find . -iname '*~' -delete
45-
@find . -iname '*.swp' -delete
46-
@find . -iname '__pycache__' -delete
47-
@rm -r .mypy_cache
48-
@rm -r .pytest_cache
49-
@find . -name '*.egg' -print0|xargs -0 rm -rf --
50-
@rm -rf .eggs/
51-
@rm -fr build/
52-
@rm -fr dist/
53-
@rm -fr *.egg-info
36+
@rm -rf .venv
37+
@uv run pyclean . --debris
38+
@rm -rf dist
39+
@rm -rf .mypy_cache
40+
@rm -rf .pytest_cache
41+
@rm -rf .ruff_cache
42+
#
43+
# Recipe stolen from: https://gist.github.com/prwhite/8168133?permalink_comment_id=4160123#gistcomment-4160123
44+
.PHONY: help
45+
help: ## Show help message
46+
@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)

buzz/base.py

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

docs/mkdocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ nav:
2222
- Home: index.md
2323
- Features: features.md
2424
- Reference: reference.md
25+
- Changelog: changelog.md
2526
watch:
2627
- ../buzz
2728
plugins:

docs/source/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CHANGELOG.md

pyproject.toml

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,62 @@
1-
[tool.poetry]
1+
[project]
22
name = "py-buzz"
3-
version = "5.0.2"
3+
version = "6.0.0"
44
description = "\"That's not flying, it's falling with style\": Exceptions with extras"
5-
authors = ["Tucker Beck <tucker.beck@gmail.com>"]
6-
license = "MIT"
5+
authors = [
6+
{name = "Tucker Beck", email ="tucker.beck@gmail.com"},
7+
]
78
readme = "README.md"
8-
homepage = "https://github.com/dusktreader/py-buzz"
9-
repository = "https://github.com/dusktreader/py-buzz"
10-
documentation = "https://dusktreader.github.io/py-buzz/"
11-
packages = [{include = "buzz"}]
12-
13-
[tool.poetry.urls]
14-
CHANGELOG = "https://github.com/dusktreader/py-buzz/blob/main/CHANGELOG.md"
15-
16-
[tool.poetry.dependencies]
17-
python = "^3.9"
18-
19-
[tool.poetry.group.dev.dependencies]
20-
pytest = "^8.3.4"
21-
pytest-cov = "^6.0.0"
22-
mypy = "^1.14.1"
23-
mkdocs-material = "^9.1.21"
24-
pygments = "^2.15.1"
25-
ruff = "^0.9.3"
26-
pytest-asyncio = "^0.25.3"
27-
pytest-randomly = "^3.16.0"
28-
mkdocstrings-python = "^1.13.0"
9+
license-files = ["LICENSE.md"]
10+
requires-python = ">=3.9"
11+
dependencies = []
2912

30-
[tool.ruff]
31-
line-length = 120
13+
[project.urls]
14+
homepage = "https://dusktreader.github.io/py-buzz/"
15+
source = "https://github.com/dusktreader/py-buzz"
16+
changelog = "https://github.com/dusktreader/py-buzz/blob/main/CHANGELOG.md"
17+
18+
[tool.uv]
19+
package = true
20+
21+
[dependency-groups]
22+
dev = [
23+
"ipython>=8.18.1",
24+
"mkdocs-material>=9.6.9",
25+
"mkdocstrings-python>=1.16.7",
26+
"mypy~=1.15",
27+
"pyclean>=3.1.0",
28+
"pygments>=2.19.1",
29+
"pytest>=8.3.5",
30+
"pytest-asyncio>=0.25.3",
31+
"pytest-cov>=6.0.0",
32+
"pytest-random-order>=1.1.1",
33+
"ruff>=0.11.2",
34+
]
3235

3336
[tool.pytest.ini_options]
3437
minversion = "7.4.0"
3538
addopts = [
36-
"--cov=buzz",
39+
"--cov=src/buzz",
3740
"--cov-report=term-missing",
3841
"--cov-report=json",
3942
"--cov-fail-under=90",
4043
]
41-
testpaths = "tests"
44+
45+
[tool.ruff]
46+
line-length = 120
47+
48+
[[tool.mypy.overrides]]
49+
module = []
50+
ignore_missing_imports = true
51+
52+
[tool.hatch.build]
53+
include = [
54+
"src/buzz/**/*.py",
55+
]
56+
57+
[tool.hatch.build.targets.wheel]
58+
packages = ["src/buzz"]
4259

4360
[build-system]
44-
requires = ["poetry-core"]
45-
build-backend = "poetry.core.masonry.api"
61+
requires = ["hatchling"]
62+
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)