Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

## Checklist

- [ ] Tests pass: `uv run pytest`
- [ ] Tests pass: `./scripts/run-tests.sh`
- [ ] Checks pass: `uv run pre-commit run --all-files`
- [ ] CHANGELOG is updated (if necessary)
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Pre-Commit Hooks
run: uv run pre-commit run --all-files
- name: Test
run: uv run pytest
run: ./scripts/run-tests.sh
- name: Validate test server
run: uv run scripts/validate-stapi-fastapi
- name: Docs
Expand Down
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ repos:
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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ uv sync
Test:

```shell
uv run pytest
./scripts/run-tests.sh
```

Check formatting and other lints:
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ dependencies = [

[dependency-groups]
dev = [
"pytest>=8.1.1",
"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",
"fastapi[standard]>=0.115.12",
"types-click>=7.1.8",
"pygithub>=2.6.1",
"respx>=0.22.0",
]
docs = [
"mkdocs-material>=9.6.11",
Expand Down
4 changes: 3 additions & 1 deletion pystapi-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readme = "README.md"
authors = [
{ name = "Kaveh Karimi-Asli", email = "ka7eh@pm.me" },
{ name = "Philip Weiss", email = "philip.weiss@orbitalsidekick.com" },
{ name = "Stella Reinhardt", email = "stella@stellamaria.de"}
{ name = "Stella Reinhardt", email = "stella@stellamaria.de" },
]
maintainers = [{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" }]
keywords = ["stapi"]
Expand All @@ -18,6 +18,8 @@ dependencies = [
"python-dateutil>=2.8.2",
"click>=8.1.8",
]
[dependency-groups]
dev = ["pytest>=8.3.5", "respx>=0.22.0", "types-click>=7.1.8"]

[project.scripts]
stapi = "pystapi_client.scripts.cli:cli"
Expand Down
19 changes: 19 additions & 0 deletions scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# set -x # print each command before executing

for path in stapi-fastapi pystapi-validator pystapi-client stapi-pydantic; do
name=$(basename "$path")

set +e
uv sync --package "$name"
uv run --package "$name" --directory "$path" pytest -p no:sugar
code=$?
set -e

case "$code" in
0) : ;;
5) echo " (no tests in $name, skipping)";;
*) echo " pytest failed in $name (exit $code)"; exit "$code";;
esac
done
2 changes: 1 addition & 1 deletion scripts/validate-stapi-fastapi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
scripts="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
root=$(dirname "$scripts")

uv run fastapi dev "$root/stapi-fastapi/tests/application.py" >/dev/null 2>&1 &
uv run --package stapi-fastapi fastapi dev "$root/stapi-fastapi/tests/application.py" >/dev/null 2>&1 &
server_pid=$!

set +e
Expand Down
6 changes: 6 additions & 0 deletions stapi-fastapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ dependencies = [
"stapi-pydantic>=0.0.3",
]

[dependency-groups]
dev = [
"fastapi[standard]>=0.115.0",
"pytest>=8.3.5",
]

[tool.hatch.build.targets.sdist]
include = ["src/stapi_fastapi"]

Expand Down
5 changes: 5 additions & 0 deletions stapi-pydantic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ authors = [
requires-python = ">=3.11"
dependencies = ["pydantic>=2.12", "cql2>=0.3.6", "geojson-pydantic>=1.2.0"]

[dependency-groups]
dev = [
"pytest>=8.3.5",
]

[project.scripts]
stapi-pydantic = "stapi_pydantic:main"

Expand Down
55 changes: 40 additions & 15 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.