Skip to content

Commit 6daebdc

Browse files
committed
Convert to uv. Default to ".html" for template extensions. Allow decorator to be called without parenthesis.
1 parent 527fd54 commit 6daebdc

27 files changed

Lines changed: 1688 additions & 1233 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
# These are supported funding model platforms
1+
github: adamghill
22

3-
github: [adamghill] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
otechie: # Replace with a single Otechie username
12-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/checks.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
pytest:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version:
13+
- "3.10"
14+
- "3.11"
15+
- "3.12"
16+
- "3.13"
17+
fail-fast: false
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v6
24+
with:
25+
enable-cache: true
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install the package
33+
run: uv sync --all-extras --dev
34+
35+
- name: Run pytest
36+
run: uv run pytest
37+
38+
ruff:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: astral-sh/ruff-action@v1
44+
45+
mypy:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v6
53+
with:
54+
enable-cache: true
55+
56+
- name: Set up Python
57+
uses: actions/setup-python@v5
58+
59+
- name: Install the package
60+
run: uv sync --all-extras --dev
61+
62+
- name: Run mypy
63+
run: uv run mypy src/fbv

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: ["published"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
pypi-publish:
13+
name: Upload release to PyPI
14+
runs-on: ubuntu-latest
15+
16+
environment:
17+
name: pypi
18+
url: https://pypi.org/project/django-fbv/
19+
20+
permissions:
21+
id-token: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v3
28+
with:
29+
enable-cache: true
30+
31+
- name: Set up Python
32+
run: uv python install 3.10
33+
34+
- name: Build
35+
run: uv build
36+
37+
# - name: Publish package distributions to Test PyPI
38+
# uses: pypa/gh-action-pypi-publish@release/v1
39+
# with:
40+
# repository-url: https://test.pypi.org/legacy/
41+
# skip-existing: true
42+
43+
- name: Publish package distributions to PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/python.yml

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

.readthedocs.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ sphinx:
55
fail_on_warning: true
66
builder: dirhtml
77

8-
formats:
9-
- pdf
10-
- epub
11-
12-
python:
13-
version: 3
14-
install:
15-
- method: pip
16-
path: .
17-
extra_requirements:
18-
- docs
8+
build:
9+
os: ubuntu-lts-latest
10+
tools:
11+
python: latest
12+
jobs:
13+
pre_create_environment:
14+
- asdf plugin add uv
15+
- asdf install uv latest
16+
- asdf global uv latest
17+
create_environment:
18+
- uv venv $READTHEDOCS_VIRTUALENV_PATH
19+
install:
20+
# Use a cache dir in the same mount to halve the install time
21+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache .[docs]
22+
build:
23+
html:
24+
- uv run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.7.0
2+
3+
- Default to ".html" as the template extension if an extension is not specified.
4+
- Add ability to call `render_view` or `render_html` decorators without parenthesis.
5+
6+
## Breaking Changes
7+
8+
- Require Python 3.10+.
9+
110
# 0.6.0
211

312
- Add `fbv.views.file` method.

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# -- Project information
66

77
project = "django-fbv"
8-
copyright = "2022, Adam Hill"
8+
copyright = "2022, Adam Hill" # noqa: A001
99
author = "Adam Hill"
1010

1111
pyproject = toml.load("../../pyproject.toml")
12-
version = pyproject["tool"]["poetry"]["version"]
12+
version = pyproject["project"]["version"]
1313
release = version
1414

1515

fbv/middleware.py

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

justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import? 'adamghill.justfile'
2+
import? '../dotfiles/just/justfile'
3+
4+
src := "src/fbv"
5+
6+
# List commands
7+
_default:
8+
just --list --unsorted --justfile {{ justfile() }} --list-heading $'Available commands:\n'
9+
10+
# Grab default `adamghill.justfile` from GitHub
11+
fetch:
12+
curl https://raw.githubusercontent.com/adamghill/dotfiles/master/just/justfile > adamghill.justfile

0 commit comments

Comments
 (0)