Skip to content

Commit ba3fc6d

Browse files
Switch to UV (#204)
* Use uv for build and release * Update CHANGELOG.md * Update .github/workflows/release.yml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Update pyproject.toml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * remove python 3.9 support --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 9fe0cfb commit ba3fc6d

14 files changed

Lines changed: 3736 additions & 35 deletions

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v6
22+
23+
- name: Ensure Python (uses your .python-version / requires-python)
24+
run: uv python install
25+
26+
- name: Verify version matches release tag
27+
shell: bash
28+
run: |
29+
TAG="${GITHUB_EVENT_NAME:-release}"
30+
# On release event, the tag name is here:
31+
TAG_NAME="${{ github.event.release.tag_name }}"
32+
VERSION="$(uv version --short)"
33+
echo "tag=${TAG_NAME} pyproject=${VERSION}"
34+
# Accept tags like v1.2.3 -> 1.2.3
35+
TAG_STRIPPED="${TAG_NAME#v}"
36+
if [ "${VERSION}" != "${TAG_STRIPPED}" ]; then
37+
echo "::error::Version mismatch detected!"
38+
echo "Release tag: ${TAG_NAME}"
39+
echo "pyproject.toml version: ${VERSION}"
40+
echo ""
41+
echo "To fix:"
42+
echo " - Ensure the release tag matches the version in pyproject.toml (e.g., tag 'v${VERSION}')"
43+
echo " - If the tag is incorrect, delete and recreate the release with the correct tag."
44+
exit 1
45+
fi
46+
47+
- name: Build distributions
48+
run: uv build --no-sources
49+
50+
- name: Publish to PyPI
51+
run: uv publish

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup NOX
1717
uses: wntrblm/nox@2025.10.16
1818
with:
19-
python-versions: "3.9, 3.10, 3.11, 3.12, 3.13, 3.14"
19+
python-versions: "3.10, 3.11, 3.12, 3.13, 3.14"
2020
- name: Test with NOX
2121
run: |
2222
nox --session tests

.sourcery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ignore:
1212
- docs/build
1313

1414
rule_settings:
15-
python_version: '3.9'
15+
python_version: '3.10'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515

1616
- Modified the header image url to be an absolute url so that it hopefully shows up in PyPI correctly.
17+
- Switched package build and publish tool from flit to uv.
18+
- Updated GitHub Actions workflow to use uv for building and publishing to PyPI.
1719

1820
### Removed
1921

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The pythonbible library serves several purposes related to the Christian Bible a
66
<tr>
77
<td>Latest Version</td>
88
<td>
9-
<a href="https://pypi.org/project/pythonbible/"><img src="https://img.shields.io/pypi/v/pythonbible?color=gold&logo=pypi&logoColor=lightgray"></a>
9+
<a href="https://pypi.org/project/pythonbible/"><img src="https://img.shields.io/pypi/v/pythonbible?color=gold&logo=pypi&logoColor=lightgray"></a><br />
1010
<img src="https://img.shields.io/pypi/dm/pythonbible?color=gold">
1111
</td>
1212
</tr>
@@ -15,20 +15,20 @@ The pythonbible library serves several purposes related to the Christian Bible a
1515
<td><a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-orange.svg"></a></td>
1616
</tr>
1717
<tr>
18-
<td>Tests</td>
18+
<td>Workflows</td>
1919
<td>
20-
<img src="https://github.com/avendesora/pythonbible/actions/workflows/tests.yml/badge.svg">
2120
<img src="https://github.com/avendesora/pythonbible/actions/workflows/python-package.yml/badge.svg"><br/>
22-
<a href="https://www.codacy.com/gh/avendesora/pythonbible/dashboard?utm_source=github.com&utm_medium=referral&utm_content=avendesora/pythonbible&utm_campaign=Badge_Coverage"><img src="https://app.codacy.com/project/badge/Coverage/dc1333c64b434f7bb813d08750462921"></a>
21+
<img src="https://github.com/avendesora/pythonbible/workflows/CodeQL/badge.svg"><br />
22+
<img src="https://github.com/avendesora/pythonbible/actions/workflows/tests.yml/badge.svg">
2323
</td>
2424
</tr>
2525
<tr>
2626
<td>Code Quality</td>
2727
<td>
28-
<img src="https://github.com/avendesora/pythonbible/workflows/CodeQL/badge.svg">
2928
<a href="https://www.codacy.com/gh/avendesora/pythonbible/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=avendesora/pythonbible&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/dc1333c64b434f7bb813d08750462921"></a><br/>
30-
<a href="https://results.pre-commit.ci/latest/github/avendesora/pythonbible/main"><img src="https://results.pre-commit.ci/badge/github/avendesora/pythonbible/main.svg"></a>
31-
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
29+
<a href="https://app.codacy.com/gh/avendesora/pythonbible/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage"><img src="https://app.codacy.com/project/badge/Coverage/dc1333c64b434f7bb813d08750462921"></a><br />
30+
<a href="https://results.pre-commit.ci/latest/github/avendesora/pythonbible/main"><img src="https://results.pre-commit.ci/badge/github/avendesora/pythonbible/main.svg"></a><br />
31+
<a href="https://sourcery.ai"><img src="https://img.shields.io/badge/Sourcery-enabled-brightgreen"></a>
3232
</td>
3333
</tr>
3434
<tr>

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
66
SPHINXOPTS ?=
7-
SPHINXBUILD ?= sphinx-build
7+
SPHINXBUILD ?= uv run --project=.. --group docs --locked sphinx-build
88
SOURCEDIR = source
99
BUILDDIR = build
1010

docs/source/installation.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Requirements
66

77
**pythonbible** requires Python and is tested with the following versions:
88

9-
* 3.9
109
* 3.10
1110
* 3.11
1211
* 3.12

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
nox.options.default_venv_backend = "uv"
99

1010

11-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"])
11+
@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"])
1212
def tests(session: nox.Session) -> None:
1313
session.install(PYTEST)
1414
session.run(PYTEST)

pyproject.toml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
[build-system]
2-
requires = ["flit_core >=2,<4"]
3-
build-backend = "flit_core.buildapi"
2+
requires = ["uv_build>=0.8.9,<0.9.0"]
3+
build-backend = "uv_build"
44

5-
[tool.flit.metadata]
6-
module = "pythonbible"
7-
author = "Nathan Patton"
8-
author-email = "npatton@gmail.com"
9-
home-page = "https://docs.python.bible"
5+
[tool.uv]
6+
default-groups = ["dev", "docs", "test"]
7+
8+
[tool.uv.build-backend]
9+
module-root = ""
10+
module-name = "pythonbible"
11+
12+
[project]
13+
name = "pythonbible"
14+
version = "0.14.0"
15+
description-file = "README.md"
16+
requires-python = ">=3.10"
17+
authors = [
18+
{ name = "Nathan Patton", email = "npatton@gmail.com" }
19+
]
20+
readme = "README.md"
21+
license = "MIT"
1022
classifiers = [
1123
"Intended Audience :: Information Technology",
1224
"Intended Audience :: Developers",
@@ -17,21 +29,31 @@ classifiers = [
1729
"Programming Language :: Python",
1830
"Programming Language :: Python :: 3",
1931
"Programming Language :: Python :: 3 :: Only",
20-
"Programming Language :: Python :: 3.9",
2132
"Programming Language :: Python :: 3.10",
2233
"Programming Language :: Python :: 3.11",
2334
"Programming Language :: Python :: 3.12",
2435
"Programming Language :: Python :: 3.13",
2536
"Programming Language :: Python :: 3.14",
2637
"License :: OSI Approved :: MIT License"
2738
]
28-
requires = []
29-
description-file = "README.md"
30-
requires-python = ">=3.9"
39+
urls = { Documentation = "https://docs.python.bible", Source = "https://github.com/avendesora/pythonbible" }
40+
dependencies = []
3141

32-
[tool.flit.metadata.urls]
33-
Documentation = "https://docs.python.bible"
34-
Source = "https://github.com/avendesora/pythonbible"
42+
[dependency-groups]
43+
dev = [
44+
"pre-commit>=4.3.0",
45+
]
46+
docs = [
47+
"furo>=2025.7.19",
48+
"jupyter>=1.1.1",
49+
"sphinx>=7.4.7",
50+
"sphinx-copybutton>=0.5.2",
51+
"sphinx-toolbox>=4.0.0",
52+
]
53+
test = [
54+
"nox[uv]>=2025.10.14",
55+
"pytest-cov>=7.0.0",
56+
]
3557

3658
[tool.ruff.lint]
3759
select = [

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)