Skip to content

Commit 96dad98

Browse files
Update workflows
1 parent 17858dc commit 96dad98

File tree

7 files changed

+260
-186
lines changed

7 files changed

+260
-186
lines changed

.github/workflows/linting.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- docs/**
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- docs/**
14+
15+
env:
16+
PY_VERSION: 3.14
17+
18+
jobs:
19+
pre-commit:
20+
permissions:
21+
contents: read
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
- uses: astral-sh/setup-uv@v7
27+
with:
28+
python-version: ${{ env.PY_VERSION }}
29+
- name: Install project
30+
run: uv sync --locked --no-dev
31+
- name: Run pre-commit
32+
run: uv run --with pre-commit pre-commit run -a
33+
34+
ty:
35+
permissions:
36+
contents: read
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v6
41+
- uses: astral-sh/setup-uv@v7
42+
with:
43+
python-version: ${{ env.PY_VERSION }}
44+
- name: Install project
45+
run: uv sync --locked --no-dev
46+
- name: Run ty
47+
run: uv run --with ty ty check perdoo --ignore unresolved-import
48+
continue-on-error: true

.github/workflows/publishing.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@ name: Publishing
22

33
on: push
44

5+
env:
6+
PY_VERSION: 3.14
7+
58
jobs:
69
build:
7-
name: Build
810
permissions:
911
contents: read
1012
runs-on: ubuntu-latest
1113

1214
steps:
1315
- uses: actions/checkout@v6
1416
- uses: astral-sh/setup-uv@v7
15-
- name: Setup Python
16-
run: uv python install 3.14
17-
- name: Build wheel and source tarball
17+
with:
18+
python-version: ${{ env.PY_VERSION }}
19+
- name: Install project
20+
run: uv sync --locked --no-dev
21+
- name: Run build
1822
run: uv build
1923
- uses: actions/upload-artifact@v6
2024
with:
2125
name: python-package-distributions
2226
path: dist/
2327

2428
validate:
25-
name: Validate dist
2629
needs:
2730
- build
2831
permissions: {}
@@ -34,8 +37,8 @@ jobs:
3437
name: python-package-distributions
3538
path: dist/
3639
- uses: astral-sh/setup-uv@v7
37-
- name: Setup Python
38-
run: uv python install 3.14
40+
with:
41+
python-version: ${{ env.PY_VERSION }}
3942
- name: Validate dist
4043
run: uv run --with twine twine check dist/*
4144

@@ -44,7 +47,6 @@ jobs:
4447
name: pypi
4548
url: https://pypi.org/p/perdoo
4649
if: startsWith(github.ref, 'refs/tags/')
47-
name: Publish to PyPI
4850
needs:
4951
- build
5052
- validate
@@ -57,4 +59,4 @@ jobs:
5759
with:
5860
name: python-package-distributions
5961
path: dist/
60-
- uses: pypa/gh-action-pypi-publish@release/v1
62+
- uses: pypa/gh-action-pypi-publish@v1

.github/workflows/rich-codex.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ on:
77
- perdoo/cli/**
88
workflow_dispatch:
99

10-
permissions:
11-
contents: write
10+
env:
11+
PY_VERSION: 3.14
1212

1313
jobs:
1414
rich_codex:
15+
permissions:
16+
contents: write
1517
runs-on: ubuntu-latest
18+
1619
steps:
1720
- uses: actions/checkout@v6
1821
- uses: astral-sh/setup-uv@v7
19-
- name: Setup Python
20-
run: uv python install 3.14
22+
with:
23+
python-version: ${{ env.PY_VERSION }}
2124
- name: Install project
22-
run: uv sync --dev
23-
25+
run: uv sync --locked --no-dev
2426
- name: Generate terminal images with rich-codex
25-
uses: ewels/rich-codex@v1
27+
uses: ewels/rich-codex@latest
2628
with:
2729
commit_changes: true
2830
clean_img_paths: docs/img/*.svg

.github/workflows/testing.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v6
4141
- uses: astral-sh/setup-uv@v7
42-
- name: Setup Python
43-
run: uv python install ${{ matrix.python-version }}
42+
with:
43+
python-version: ${{ matrix.python-version }}
4444
- name: Install project
45-
run: uv sync --group tests
45+
run: uv sync --locked --no-dev --group tests
4646
- name: Run tests
4747
run: uv run pytest
4848

49-
collector:
49+
check:
5050
if: always()
5151
needs:
5252
- pytest
53-
54-
permissions: { }
53+
permissions: {}
5554
runs-on: ubuntu-latest
5655

5756
steps:
5857
- name: Check for failures
59-
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
60-
run: echo job failed && exit 1
58+
uses: re-actors/alls-green@v1.2.2
59+
with:
60+
jobs: ${{ toJSON(needs) }}

perdoo/comic/metadata/comic_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def credits(self) -> dict[str, list[str]]:
220220
output.setdefault(creator, []).append(role)
221221
return output
222222

223-
@credits.setter
223+
@credits.setter # noqa: A003
224224
def credits(self, value: dict[str, list[str]]) -> None:
225225
def get_creators(role: str) -> list[str]:
226226
return humansorted(

perdoo/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ def delete_empty_folders(folder: Path) -> None:
111111

112112
def blank_is_none(value: str) -> str | None:
113113
"""Enforces blank strings to be None."""
114-
return value if value else None
114+
return value or None

0 commit comments

Comments
 (0)