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
4 changes: 2 additions & 2 deletions .github/workflows/2.build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -43,7 +43,7 @@ jobs:
git pull origin main
echo "Current version: v$(./scripts/get-version.sh)"
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pre-Commit

on:
pull_request:
branches:
- main
- dev
types:
- opened
- synchronize
- reopened

jobs:
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Cache pip
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
- name: Install pre-commit and dependencies
run: |
python -m pip install -U pip
python -m pip install -r ./requirements.txt
python -m pip install -U pre-commit pyright pytest
- name: Cache pre-commit
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit on all files
run: |
pre-commit run --all-files --show-diff-on-failure --color=always
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
36 changes: 9 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ repos:

# --- Markdown ---
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.49.0
rev: v0.49.1
hooks:
- id: markdownlint
name: "📝 markdownlint - Lint markdown files"
Expand Down Expand Up @@ -153,38 +153,20 @@ repos:
files: \.pyi?$
args: ["--skip=B101"] # skip assert-use warning


# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.408
# rev: v1.1.411
# hooks:
# - id: pyright
# name: "🐍 pyright - Static type checker"
# files: \.pyi?$

# - repo: local
# hooks:
# - id: pyright
# name: "🐍 pyright (local) - Static type checker"
# language: system
# entry: "python -m pyright"
# files: \.pyi?$

# --- Tests ---
# - repo: local
# hooks:
# - id: pytest-collect
# name: "🧪 pytest-collect (local) - Validate test formatting"
# language: system
# entry: "python -m pytest --collect-only"
# pass_filenames: false
# always_run: true

# - id: pytest
# name: "🧪 pytest (local) - Run tests"
# language: system
# entry: "./scripts/test.sh -l -v -c"
# pass_filenames: false
# always_run: true
- repo: local
hooks:
- id: pyright
name: "🐍 pyright (local) - Static type checker"
language: system
entry: "python -m pyright"
files: \.pyi?$

# --- Cleanup ---
# - repo: local
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=70.3.0,<83.0.0", "setuptools-scm>=8.0.4,<11.0.0"]
requires = ["setuptools>=70.3.0,<84.0.0", "setuptools-scm>=8.0.4,<11.0.0"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.build.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools>=70.3.0,<83.0.0
setuptools>=70.3.0,<84.0.0
wheel>=0.43.0,<1.0.0
build>=1.1.1,<2.0.0
twine>=6.0.1,<7.0.0
2 changes: 1 addition & 1 deletion src/beans_logging/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class LoguruHandlerPM(ExtraBaseModel):

class LogHandlerPM(LoguruHandlerPM):
type_: LogHandlerTypeEnum = Field(default=LogHandlerTypeEnum.UNKNOWN)
sink: _SinkType | None = Field(default=None)
sink: _SinkType | None = Field(default=None) # type: ignore
level: str | int | LogLevelEnum | None = Field(default=None)
custom_serialize: bool | None = Field(default=None)
error: bool = Field(default=False)
Expand Down