Skip to content

Commit b469b4b

Browse files
committed
feat: update to 3.14, uv, etc
1 parent a9067d0 commit b469b4b

10 files changed

Lines changed: 1381 additions & 2037 deletions

.github/workflows/main.yml

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,56 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v3
14+
- uses: actions/checkout@v6
1615
with:
1716
fetch-depth: 0
18-
- name: Set up Python 3.10
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: "3.10"
22-
- name: Cache poetry
23-
id: cache-poetry
24-
uses: actions/cache@v3
25-
with:
26-
path: ~/.local
27-
key: poetry-${{ runner.os }}
28-
- name: Install poetry
29-
if: steps.cache-poetry.outputs.cache-hit != 'true'
30-
uses: snok/install-poetry@v1
17+
18+
- name: Set up Python 3.14
19+
uses: actions/setup-python@v6
3120
with:
32-
virtualenvs-in-project: true
33-
- name: Cache venv
34-
id: cache-venv
35-
uses: actions/cache@v3
21+
python-version: "3.14"
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
3625
with:
37-
path: .venv
38-
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
39-
restore-keys: |
40-
venv-${{ runner.os }}-
26+
enable-cache: true
27+
4128
- name: Install dependencies
42-
if: steps.cache-venv.outputs.cache-hit != 'true'
43-
run: poetry install --with docs
29+
run: uv sync
30+
4431
- name: Run tests
45-
run: poetry run pytest -v
32+
run: uv run pytest -v
33+
4634
- name: Check formatting
47-
run: poetry run black --check .
35+
run: uv run ruff format --check bolt_control_flow examples tests
36+
37+
- name: Check imports
38+
run: uv run ruff check --select I bolt_control_flow examples tests
39+
4840
- name: Build docs
4941
run: |
5042
mkdir gh-pages
5143
touch gh-pages/.nojekyll
5244
cd docs/
5345
poetry run make html
5446
cp -r build/* ../gh-pages/
47+
5548
- name: Release
56-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
49+
if: |
50+
github.repository == 'vdvman1/bolt-control-flow'
51+
&& github.event_name == 'push'
52+
&& github.ref == 'refs/heads/main'
5753
env:
5854
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5955
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
6056
run: |
6157
git config --global user.name "github-actions"
6258
git config --global user.email "action@github.com"
63-
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <action@github.com>"
59+
uv run semantic-release publish -v DEBUG -D commit_author="github-actions <action@github.com>"
60+
6461
- name: Publish docs
6562
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6663
uses: JamesIves/github-pages-deploy-action@4.1.4
6764
with:
6865
branch: gh-pages
69-
folder: gh-pages
66+
folder: gh-pages

bolt_control_flow/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This is an internal module, not meant for public usage
55
"""
66

7-
from collections.abc import Iterator, Callable
7+
from collections.abc import Callable, Iterator
88
from contextlib import AbstractContextManager, contextmanager
99
from functools import partial
1010
from types import TracebackType

bolt_control_flow/parse.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
from contextlib import contextmanager
99
from dataclasses import dataclass
1010
from typing import Any, Iterator, Optional, cast
11+
12+
from beet.core.utils import extra_field
1113
from bolt import Accumulator, visit_body, visit_single
12-
from mecha import AstCommand, AstNode, AstRoot, Dispatcher, rule
1314
from bolt.ast import AstExpressionBinary
14-
from beet.core.utils import extra_field
15-
from bolt_control_flow.helpers import CaseDriver, MultibranchDriver
15+
from mecha import AstCommand, AstNode, AstRoot, Dispatcher, rule
1616

17+
from bolt_control_flow.helpers import CaseDriver, MultibranchDriver
1718
from bolt_control_flow.types import BranchType, CaseResult
1819

1920

bolt_control_flow/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from types import NotImplementedType
44
from typing import Any, Optional, TypeAlias
55

6-
76
__all__ = [
87
"CaseResult",
98
"CaseMatchType",

0 commit comments

Comments
 (0)