Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
67a491f
just copy over
toro-berlin Apr 1, 2025
e1c6567
move to uv
toro-berlin Apr 1, 2025
c18c131
add fastapi to top project
toro-berlin Apr 1, 2025
0a6de72
move ruff & remove poetry stuff
toro-berlin Apr 1, 2025
f3f3c4d
add uv lock
toro-berlin Apr 1, 2025
2f39ee3
move pre-commit
toro-berlin Apr 1, 2025
f6b3e7e
make mypy and ruff work
toro-berlin Apr 1, 2025
84528ec
remove custom bins for mypy and ruff
toro-berlin Apr 1, 2025
3d693ca
get pytest qworking
toro-berlin Apr 1, 2025
81de4af
remove duplicate files
toro-berlin Apr 1, 2025
2f89d35
move linter settings
toro-berlin Apr 1, 2025
a9fbe11
remove linting scripts
toro-berlin Apr 1, 2025
fa12e23
removing abandond command
toro-berlin Apr 1, 2025
0f3436e
adding hatch target for pydantic
toro-berlin Apr 1, 2025
2523599
Merge branch 'main' into add-fastapi
gadomski Apr 1, 2025
b348cc4
Update stapi-fastapi/pyproject.toml
toro-berlin Apr 1, 2025
d08eb34
Update stapi-fastapi/pyproject.toml
toro-berlin Apr 1, 2025
c2b986b
remove nox
toro-berlin Apr 1, 2025
6f26f34
run pre-commit hooks through uv run
toro-berlin Apr 1, 2025
e0d587b
comment ruff rules
toro-berlin Apr 1, 2025
83106d3
remove explicit ruff includes
toro-berlin Apr 1, 2025
d2a9d20
change order of ruff hooks
toro-berlin Apr 1, 2025
bb82075
bring back order and let ruff fix it
toro-berlin Apr 1, 2025
07f60c3
increase line lenght
toro-berlin Apr 1, 2025
d7b8ba5
remove original .github form fastapi
toro-berlin Apr 1, 2025
5bdd317
pre-commit hooks includes/excludes
toro-berlin Apr 1, 2025
3b53c80
apply ruff linting/format & make mypy happy
toro-berlin Apr 1, 2025
e6ab75f
change pre-commit hooks instead of scripts
toro-berlin Apr 1, 2025
64dd76e
use uv for pre-commit hooks
toro-berlin Apr 1, 2025
0a3d2e8
Merge branch 'stapi-spec:main' into add-fastapi
toro-berlin Apr 1, 2025
cf47215
make linter happy
toro-berlin Apr 1, 2025
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
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ jobs:
- uses: astral-sh/setup-uv@v5
- name: Sync
run: uv sync
- name: Lint
run: scripts/lint
- name: Pre-Commit Hooks
run: uv run pre-commit run --all-files
- name: Test
run: uv run pytest
- name: Docs
run: uv run mkdocs build --strict
- uses: actions/upload-pages-artifact@v3
with:
path: site/

docs:
name: Deploy docs
runs-on: ubuntu-latest
Expand Down
85 changes: 85 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
repos:
- repo: local
hooks:

- id: ruff-check
name: Lint with ruff
entry: uv run ruff check --fix
language: system
types: [python]
pass_filenames: false
verbose: true

- id: ruff-format
name: Format with ruff
entry: uv run ruff format
language: system
types: [python]
pass_filenames: false
verbose: true

- id: mypy
name: Check typing with mypy
entry: uv run mypy
language: system
types: [python]
pass_filenames: false
verbose: true

- id: pymarkdown
name: Markdownlint
description: Run markdownlint on Markdown files
entry: uv run pymarkdown scan
language: system
files: \.(md|mdown|markdown)$

- id: check-added-large-files
name: Check for added large files
entry: uv run check-added-large-files
language: system

- id: check-toml
name: Check Toml
entry: uv run check-toml
language: system
types: [toml]

- id: check-yaml
name: Check Yaml
entry: uv run check-yaml
language: system
types: [yaml]
exclude: ^mkdocs.yml$

- id: mixed-line-ending
name: Check mixed line endings
entry: uv run mixed-line-ending
language: system
types: [text]
stages: [pre-commit, pre-push, manual]

- id: end-of-file-fixer
name: Fix End of Files
entry: uv run end-of-file-fixer
language: system
types: [text]
stages: [pre-commit, pre-push, manual]

- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: uv run trailing-whitespace-fixer
language: system
types: [text]
stages: [pre-commit, pre-push, manual]

- id: check-merge-conflict
name: Check merge conflicts
entry: uv run check-merge-conflict
language: system

- id: no-commit-to-branch
name: Check not committting to main
entry: uv run no-commit-to-branch
language: system
args: ["--branch", "main"]
pass_filenames: false
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
2. Determine the next version, following [semantic versioning](https://semver.org/)
3. Create a release branch: `git checkout -b release/{package}-v{version}`
4. Update that package's CHANGELOG with:
- A new header with the new version
- A new link at the bottom of the CHANGELOG for that header
- A new header with the new version
- A new link at the bottom of the CHANGELOG for that header
5. `git push -u origin`
6. Once approved, merge the PR
7. `git checkout main && git pull && git tag {package}/v{version} && git push {package}/v{version}`
Expand Down
60 changes: 58 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"stapi-pydantic",
"stapi-fastapi",
]

[dependency-groups]
dev = [
"pytest>=8.1.1",
"pytest-coverage>=0.0",
"mypy>=1.15.0",
"pytest>=8.3.5",
"ruff>=0.11.2",
"pymarkdownlnt>=0.9.25",
"pre-commit>=4.2.0",
"pre-commit-hooks>=5.0.0",
]
docs = [
"mkdocs-material>=9.6.11",
Expand All @@ -23,11 +29,61 @@ docs = [
default-groups = ["dev", "docs"]

[tool.uv.workspace]
members = ["stapi-pydantic"]
members = ["stapi-pydantic", "stapi-fastapi"]

[tool.uv.sources]
stapi-pydantic.workspace = true
stapi-fastapi.workspace = true

[tool.ruff]
line-length = 120

[tool.ruff.format]
quote-style = 'double'

[tool.ruff.lint]
select = [
"E", # pydocstyle error
"W", # pydocstyle warning
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"C9" # mccabe complexity
]

[tool.ruff.lint.mccabe]
max-complexity = 8 # default 10

[tool.mypy]
strict = true
files = "stapi-pydantic/src/stapi_pydantic/**/*.py"
files = [
"stapi-pydantic/src/stapi_pydantic/**/*.py",
"stapi-fastapi/src/stapi_fastapi/**/*.py"
]

[[tool.mypy.overrides]]
module = "pygeofilter.parsers.*"
ignore_missing_imports = true

[tool.pymarkdown]
plugins.md013.line_length = 120
plugins.md024.enabled = false # duplicate headers in changelog

[tool.coverage.report]
show_missing = true
skip_empty = true
sort = "Cover"
omit = [
"stapi-pydantic/tests/**/*.py",
"stapi-fastapi/tests/**/*.py",
]

[tool.pytest.ini_options]
addopts="--cov=stapi-pydantic/src/stapi_pydantic --cov=stapi-fastapi/src/stapi_fastapi"
filterwarnings = [
"ignore:The 'app' shortcut is now deprecated.:DeprecationWarning",
"ignore:Pydantic serializer warnings:UserWarning",
]
markers = [
"mock_products",
]
4 changes: 0 additions & 4 deletions scripts/format

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/lint

This file was deleted.

Loading