generated from seapagan/poetry-dev-setup
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #516 from seapagan/migrate-to-uv
- Loading branch information
Showing
21 changed files
with
2,412 additions
and
2,711 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [seapagan] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
custom: ['https://www.buymeacoffee.com/seapagan'] | ||
github: seapagan | ||
buy_me_a_coffee: seapagan | ||
ko_fi: seapagan |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended" | ||
], | ||
"labels": [ | ||
"dependencies" | ||
], | ||
"gitIgnoredAuthors": [ | ||
"66853113+pre-commit-ci[bot]@users.noreply.github.com" | ||
], | ||
"enabled": true, | ||
"enabledManagers": [ | ||
"pep621", | ||
"github-actions" | ||
], | ||
"ignoreDeps": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Type Checking | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
mypy: | ||
# uncomment the line before to disable this job if needed. | ||
# if: false | ||
name: mypy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python | ||
run: uv python install 3.12 | ||
|
||
- name: Run mypy | ||
run: uv run --all-extras mypy . --strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,3 +215,4 @@ test-app* | |
.python-version | ||
.github_changelog_generator | ||
.changelog_generator.toml | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Define hooks for the documentation project.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Hook for MkDocs to support Google-style admonitions.""" | ||
|
||
import re | ||
from typing import Any | ||
|
||
|
||
def on_page_markdown(markdown: str, **_: dict[str, Any]) -> str: | ||
"""Hook into the markdown rendering.""" | ||
|
||
def replace_admonition(match: re.Match[str]) -> str: | ||
"""Actually replace the admonition.""" | ||
type_map: dict[str, str] = { | ||
"NOTE": "note", | ||
"TIP": "tip", | ||
"WARNING": "warning", | ||
"IMPORTANT": "info", | ||
"CAUTION": "danger", | ||
} | ||
original_type: str = match.group(1) | ||
admonition_type: str = type_map[ | ||
original_type | ||
] # Direct mapping without .lower() | ||
content: str = match.group(2).strip() | ||
|
||
# Convert original type to title case | ||
title_case_type: str = original_type.title() | ||
|
||
# Remove '>' from the beginning of each line and strip whitespace | ||
content_lines: list[str] = [ | ||
line.lstrip(">").strip() for line in content.split("\n") | ||
] | ||
|
||
# Remove any empty lines at the start of the content | ||
while content_lines and not content_lines[0]: | ||
content_lines.pop(0) | ||
|
||
# Indent each non-empty line | ||
indented_content: str = "\n".join( | ||
f" {line}" if line else "" for line in content_lines | ||
) | ||
|
||
return ( | ||
f'!!! {admonition_type} "{title_case_type}"\n\n{indented_content}\n' | ||
) | ||
|
||
# Use a single regex to match all admonition types and their content | ||
pattern: str = ( | ||
r"^> \[!(NOTE|TIP|WARNING|IMPORTANT|CAUTION)\]\n>" | ||
r"([\s\S]*?)(?=\n(?!>)|\Z)" | ||
) | ||
|
||
return re.sub(pattern, replace_admonition, markdown, flags=re.MULTILINE) |
Oops, something went wrong.