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
87 changes: 87 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Bug Report
description: Report a bug or unexpected behaviour in wattnet-api.
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug. Please fill in as much detail as possible to help us reproduce and fix the issue.

- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
placeholder: "When I call `GET /v1/footprints`, it returns a 500 error even though the API is running."
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Steps to Reproduce
description: Minimal steps needed to reproduce the behaviour.
placeholder: |
1. Start the API with `wattnet-api`
2. Send a `GET /v1/footprints?zone=ES` request
3. Observe error
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behaviour
description: What did you expect to happen?
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Behaviour
description: What actually happened? Include the full traceback if applicable.
render: text
validations:
required: true

- type: input
id: version
attributes:
label: wattnet-api Version
placeholder: "e.g. 1.0.0"
validations:
required: true

- type: input
id: python
attributes:
label: Python Version
placeholder: "e.g. 3.12.3"
validations:
required: true

- type: input
id: os
attributes:
label: Operating System
placeholder: "e.g. Ubuntu 24.04, macOS 15.2"
validations:
required: false

- type: textarea
id: logs
attributes:
label: Relevant Logs or Configuration
description: Paste any relevant log output or configuration (redact credentials).
render: text
validations:
required: false

- type: textarea
id: context
attributes:
label: Additional Context
description: Any other context that might help diagnose the issue.
validations:
required: false
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Feature Request
description: Propose a new feature or improvement for wattnet-api.
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thank you for suggesting an improvement. Please describe your proposal clearly so we can evaluate it.

- type: textarea
id: problem
attributes:
label: Problem or Motivation
description: What problem does this feature solve, or what use case does it enable?
placeholder: "I need to filter footprints by multiple zones in a single request, but the current API only accepts one zone per call."
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed Solution
description: Describe the feature or change you would like to see.
placeholder: "Allow the `zone` query parameter to accept a comma-separated list of zone identifiers."
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Have you considered any alternative solutions or workarounds?
validations:
required: false

- type: dropdown
id: area
attributes:
label: Area
description: Which part of the project does this relate to?
options:
- API endpoint
- Request / response models
- Authentication / dependencies
- Configuration
- Documentation
- CI / tooling
- Other
validations:
required: true

- type: textarea
id: context
attributes:
label: Additional Context
description: Any other context, examples, or references that support the request.
validations:
required: false
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Description

<!-- Describe what this PR does and why. Link the related issue if applicable. -->

Closes #

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor (no functional change)
- [ ] Documentation
- [ ] CI / tooling
- [ ] Other: <!-- describe -->

## Checklist

- [ ] All existing tests pass (`pytest` / `tox`)
- [ ] New tests added for the changed behaviour
- [ ] Code is formatted (`black wattnet/`, `isort wattnet/`)
- [ ] Linter passes (`flake8 wattnet/`)
- [ ] Type-check passes (`mypy -p wattnet.api`)
- [ ] Security scan passes (`bandit -r wattnet/`)
- [ ] Docstrings updated where needed
- [ ] `CONTRIBUTING.md` still accurate (update if the dev workflow changed)

## Notes for Reviewers

<!-- Anything that needs special attention during review. -->
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
day: monday
commit-message:
prefix: "build(deps)"
open-pull-requests-limit: 5
groups:
dev-dependencies:
dependency-type: development

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
commit-message:
prefix: "ci(deps)"
open-pull-requests-limit: 5
groups:
github-actions:
patterns:
- "*"
123 changes: 123 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: pip-${{ matrix.python-version }}-

- name: Cache Poetry virtualenvs
uses: actions/cache@v5
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: poetry-${{ matrix.python-version }}-

- name: Install tox
run: pip install tox tox-gh-actions poetry==2.2.1

- name: Run tox
run: tox

- name: Upload coverage to Codecov
if: matrix.python-version == '3.14'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

integration:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
allow-prereleases: true

- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: pip-3.14-${{ hashFiles('poetry.lock') }}
restore-keys: pip-3.14-

- name: Cache Poetry virtualenvs
uses: actions/cache@v5
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-3.14-${{ hashFiles('poetry.lock') }}
restore-keys: poetry-3.14-

- name: Install tox
run: pip install tox poetry==2.2.1

- name: Run integration tests
run: tox -e integration

wheel:
name: Packaging — verify installed data paths
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
allow-prereleases: true

- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: pip-3.14-wheel-${{ hashFiles('poetry.lock') }}
restore-keys: pip-3.14-wheel-

- name: Install tox and Poetry
run: pip install tox poetry==2.2.1

- name: Run wheel packaging check
run: tox -e wheel
Loading
Loading