Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
UV_VERSION: 0.11.15
UV_VERSION: 0.11.24
UV_NO_SYNC: 1
UV_LOCKED: 1
PY_COLORS: 1
Expand All @@ -20,11 +20,11 @@ jobs:
runs-on: namespace-profile-ghostty-sm
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
version: ${{ env.UV_VERSION }}
- name: Environment
Expand All @@ -46,6 +46,8 @@ jobs:
- name: basedpyright
if: ${{ !cancelled() && steps.sync.conclusion == 'success' }}
run: uv run basedpyright app tests
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: pytest
if: ${{ !cancelled() && steps.sync.conclusion == 'success' }}
run: uv run pytest -vv tests
Expand All @@ -58,11 +60,11 @@ jobs:
working-directory: ./packages/toolbox
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
version: ${{ env.UV_VERSION }}
- name: Environment
Expand All @@ -72,6 +74,8 @@ jobs:
- name: basedpyright
if: ${{ !cancelled() && steps.sync.conclusion == 'success' }}
run: uv run basedpyright src tests
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: pytest
if: ${{ !cancelled() && steps.sync.conclusion == 'success' }}
run: uv run pytest -vv tests
Expand All @@ -84,9 +88,9 @@ jobs:
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
7 changes: 5 additions & 2 deletions app/components/github_integration/comments/fetching.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import TYPE_CHECKING, cast, final, override

from githubkit.exception import RequestFailed
from githubkit.versions.latest.models import IssuePropPullRequest, ReactionRollup
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
IssuePropPullRequest,
ReactionRollup,
)

from .discussions import get_discussion_comment
from app.components.github_integration.entities.cache import entity_cache
Expand All @@ -25,7 +28,7 @@
from collections.abc import AsyncGenerator, Callable

from githubkit.typing import Missing
from githubkit.versions.latest.models import (
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
Issue,
IssueEvent,
IssueEventDismissedReview,
Expand Down
4 changes: 3 additions & 1 deletion app/components/github_integration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from toolbox.misc import truncate

if TYPE_CHECKING:
from githubkit.versions.latest.models import IssuePropLabelsItemsOneof1
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
IssuePropLabelsItemsOneof1,
)

type EntitySignature = tuple[str, str, int]

Expand Down
5 changes: 4 additions & 1 deletion app/components/github_integration/webhooks/discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
from toolbox.github import format_event_sender

if TYPE_CHECKING:
from githubkit.versions.latest.models import DiscussionPropCategory, SimpleUser
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
DiscussionPropCategory,
SimpleUser,
)
from monalisten import Monalisten, events

from app.bot import EmojiName
Expand Down
5 changes: 4 additions & 1 deletion app/components/github_integration/webhooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
from toolbox.misc import COLOR_PALETTE, truncate

if TYPE_CHECKING:
from githubkit.versions.latest.models import RepositoryWebhooks, SimpleUser
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
RepositoryWebhooks,
SimpleUser,
)

from app.bot import EmojiName
from app.config import WebhookFeedType
Expand Down
4 changes: 3 additions & 1 deletion app/components/github_integration/webhooks/vouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from toolbox.misc import URL_REGEX

if TYPE_CHECKING:
from githubkit.versions.latest.models import SimpleUser
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
SimpleUser,
)

from app.components.github_integration.webhooks.utils import Footer
from toolbox.misc import EmbedColor
Expand Down
6 changes: 4 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ default:

set windows-shell := ["cmd.exe", "/c"]

basedpyright := "NODE_OPTIONS=--max-old-space-size=8192 uv run basedpyright"

# Run ruff, basedpyright, pytest, taplo, and mdformat in check mode
check:
uv run ruff check
@just check-package packages/toolbox
uv run basedpyright app tests
{{basedpyright}} app tests
uv run pytest -p terminalprogress tests
uv run taplo fmt --check --diff pyproject.toml config-example.toml
uv run ruff format --diff
uv run mdformat --number --wrap 80 --check *.md

[private]
check-package pkg:
cd {{pkg}} && uv run basedpyright src tests
cd {{pkg}} && {{basedpyright}} src tests
cd {{pkg}} && uv run pytest -p terminalprogress tests
cd {{pkg}} && uv run taplo fmt --check --diff pyproject.toml

Expand Down
2 changes: 1 addition & 1 deletion packages/toolbox/src/toolbox/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if TYPE_CHECKING:
from githubkit.typing import Missing
from githubkit.versions.latest.models import (
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
PullRequestReviewComment,
SimpleUser,
WebhookPullRequestReviewCommentCreatedPropComment,
Expand Down
4 changes: 3 additions & 1 deletion packages/toolbox/tests/test_github_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from unittest.mock import Mock

from githubkit.versions.latest.models import SimpleUser
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
SimpleUser,
)
from hypothesis import assume, given
from hypothesis import strategies as st

Expand Down
4 changes: 3 additions & 1 deletion tests/test_close_help_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import pytest
from githubkit.exception import RequestFailed
from githubkit.versions.latest.models import Issue
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
Issue,
)

from tests.utils import config
from tests.utils import kitposer as kp
Expand Down
4 changes: 3 additions & 1 deletion tests/webhooks/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import discord as dc
import pytest
from githubkit.versions.latest.models import RepositoryWebhooks
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
RepositoryWebhooks,
)

from app.components.github_integration.webhooks.utils import (
GITHUB_DISCUSSION_URL,
Expand Down
4 changes: 3 additions & 1 deletion tests/webhooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from typing import TYPE_CHECKING, get_args
from unittest.mock import Mock

from githubkit.versions.latest.models import SimpleUser
from githubkit_schemas.latest.models import ( # pyright: ignore[reportMissingTypeStubs]
SimpleUser,
)
from hypothesis import strategies as st
from monalisten import events

Expand Down
Loading