Skip to content

Commit 0d8526a

Browse files
Merge upstream/master into feature/set-retry-status
Made-with: Cursor
2 parents 08a1571 + b9ad178 commit 0d8526a

150 files changed

Lines changed: 2729 additions & 901 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.code_quality/.flake8

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[flake8]
2+
extend-ignore = E203
3+
exclude =
4+
.git,
5+
__pycache__,
6+
docs,
7+
old,
8+
build,
9+
dist,
10+
./venv,
11+
.venv,
12+
migrations,
13+
alembic
14+
max-complexity = 12
15+
show-source = True
16+
statistics = True
17+
count = True
18+
max-line-length = 79

.code_quality/.gitkeep

Whitespace-only changes.

.code_quality/black.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.black]
2+
line-length = 79
3+
target-version = ['py312']
4+
include = '\.pyi?$'
5+
extend-exclude = '''
6+
/(
7+
# directories
8+
\.eggs
9+
| \.git
10+
| \.hg
11+
| \.mypy_cache
12+
| \.tox
13+
| \.venv
14+
| venv
15+
| _build
16+
| buck-out
17+
| build
18+
| dist
19+
| migrations
20+
| alembic
21+
)/
22+
'''

.code_quality/isort.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[isort]
2+
profile = black
3+
line_length = 79
4+
multi_line_output = 3
5+
include_trailing_comma = True
6+
force_grid_wrap = 0
7+
use_parentheses = True
8+
ensure_newline_before_comments = True
9+
skip_gitignore = True
10+
11+
known_first_party = app
12+
13+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
14+
15+
skip_glob =
16+
*/migrations/*
17+
*/alembic/*
18+
*/build/*
19+
*/dist/*
20+
*/.venv/*
21+
*/venv/*

.code_quality/mypy.ini

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[mypy]
2+
python_version = 3.12
3+
4+
warn_return_any = True
5+
warn_unused_configs = True
6+
disallow_untyped_defs = False
7+
disallow_incomplete_defs = False
8+
check_untyped_defs = True
9+
disallow_untyped_decorators = False
10+
no_implicit_optional = True
11+
warn_redundant_casts = True
12+
warn_unused_ignores = True
13+
warn_no_return = True
14+
warn_unreachable = True
15+
strict_equality = True
16+
show_error_codes = True
17+
18+
exclude = build/,dist/,venv/,.venv/,migrations/,alembic/
19+
20+
[mypy-mkdocs.*]
21+
ignore_missing_imports = True
22+
23+
[mypy-mkdocs_simple_blog.*]
24+
disallow_untyped_defs = False
25+
26+
[mypy-tests.*]
27+
disallow_untyped_defs = False

.code_quality/ruff.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Ruff configuration
2+
# Modern and fast Python linter
3+
4+
# Line length
5+
line-length = 79
6+
7+
# Target Python version
8+
target-version = "py312"
9+
10+
# Exclude patterns
11+
exclude = [
12+
".git",
13+
"__pycache__",
14+
".venv",
15+
"venv",
16+
"build",
17+
"dist",
18+
"migrations",
19+
"alembic",
20+
"*.egg-info",
21+
]
22+
23+
# Lint configuration
24+
[lint]
25+
# Enable specific rule sets
26+
select = [
27+
"E", # pycodestyle errors
28+
"W", # pycodestyle warnings
29+
"F", # pyflakes
30+
"I", # isort
31+
"B", # flake8-bugbear
32+
"C4", # flake8-comprehensions
33+
"UP", # pyupgrade
34+
"ARG", # flake8-unused-arguments
35+
"SIM", # flake8-simplify
36+
]
37+
38+
# Ignore specific rules
39+
ignore = [
40+
"E501", # Line too long (handled by formatter)
41+
"B008", # Do not perform function calls in argument defaults
42+
"E203", # Whitespace before ':' (flake8 compatibility - handled separately)
43+
"B027", # Empty method in ABC without abstractmethod (intentional in base providers)
44+
"ARG001", # Unused function argument (intentional in interface implementations)
45+
"ARG002", # Unused method argument (intentional in *args/**kwargs constructors and providers)
46+
"UP007", # Use X | Y for unions — incompatible with Pydantic v2 on Python 3.9
47+
]
48+
49+
# Allowed configurations for specific rules
50+
[lint.per-file-ignores]
51+
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
52+
"tests/**" = ["ARG001", "S101"] # Allow unused arguments and assert in tests
53+
54+
# Import sorting (isort)
55+
[lint.isort]
56+
known-first-party = ["dotflow"]
57+
force-single-line = false
58+
59+
# Formatting (alternative to black)
60+
[format]
61+
quote-style = "double"
62+
indent-style = "space"
63+
skip-magic-trailing-comma = false
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Package
2+
description: Build Python package using build
3+
4+
inputs:
5+
python-version:
6+
description: Python version to use
7+
required: true
8+
default: "3.10"
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: 🐍 Set up Python ${{ inputs.python-version }}
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: ${{ inputs.python-version }}
17+
18+
- name: ⚙️ Install dependencies
19+
shell: bash
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build --no-cache-dir
23+
24+
- name: 📦 Build Package
25+
shell: bash
26+
run: python -m build
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Commit and Push
2+
description: Commit and push changes to repository
3+
4+
inputs:
5+
message:
6+
description: Commit message
7+
required: true
8+
files:
9+
description: Files to commit (space-separated)
10+
required: true
11+
branch:
12+
description: Branch to push to
13+
required: false
14+
default: ""
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- name: 💾 Commit and push changes
20+
shell: bash
21+
run: |
22+
git config --local user.email "action@github.com"
23+
git config --local user.name "GitHub Action"
24+
git add ${{ inputs.files }}
25+
26+
if git diff --staged --quiet; then
27+
echo "No changes to commit"
28+
exit 0
29+
fi
30+
31+
git commit -m "${{ inputs.message }}"
32+
33+
if [ -z "${{ inputs.branch }}" ]; then
34+
git push
35+
else
36+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
37+
if [ "$CURRENT_BRANCH" = "${{ inputs.branch }}" ]; then
38+
git push origin "$CURRENT_BRANCH"
39+
else
40+
git push origin HEAD:${{ inputs.branch }}
41+
fi
42+
fi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Extract Version
2+
description: Extract version from release tag
3+
4+
inputs:
5+
tag:
6+
description: Release tag name
7+
required: true
8+
9+
outputs:
10+
version:
11+
description: Extracted version without 'v' prefix
12+
value: ${{ steps.get_version.outputs.version }}
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- name: 🔍 Extract version from tag
18+
id: get_version
19+
shell: bash
20+
run: |
21+
VERSION="${{ inputs.tag }}"
22+
VERSION="${VERSION#v}"
23+
echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
echo "Extracted version: $VERSION"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Setup Poetry
2+
description: Setup Poetry with caching
3+
4+
inputs:
5+
python-version:
6+
description: Python version to use
7+
required: true
8+
poetry-version:
9+
description: Poetry version to install
10+
required: false
11+
default: 1.8.3
12+
install-deps:
13+
description: Dependencies groups to install (e.g., dev,code-quality)
14+
required: false
15+
default: ""
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: 🐍 Set up Python ${{ inputs.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
allow-prereleases: true
25+
26+
- name: 📦 Install Poetry
27+
uses: snok/install-poetry@v1
28+
with:
29+
version: ${{ inputs.poetry-version }}
30+
virtualenvs-create: true
31+
virtualenvs-in-project: true
32+
33+
- name: 💾 Cache Poetry dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
.venv
38+
~/.cache/pypoetry
39+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-poetry-
42+
43+
- name: 🔒 Update lock file if needed
44+
shell: bash
45+
run: |
46+
poetry lock --no-update 2>/dev/null || poetry lock
47+
48+
- name: ⚙️ Install dependencies
49+
if: inputs.install-deps != ''
50+
shell: bash
51+
run: |
52+
poetry install --with ${{ inputs.install-deps }} --no-interaction --no-ansi

0 commit comments

Comments
 (0)