Skip to content

Commit

Permalink
Merge pull request #8 from DemocracyClub/upgrades20241015
Browse files Browse the repository at this point in the history
test on python 3.12
  • Loading branch information
chris48s authored Oct 16, 2024
2 parents e048b42 + 44d5443 commit e22b430
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12' ]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: pip install -r dev-requirements.txt

- name: Lint
run: |
ruff format . --check
ruff check .
- name: Test
run: pytest
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.12
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==7.3.0
Faker==18.4.0
ruff
ruff==0.6.9
.
2 changes: 1 addition & 1 deletion response_builder/v1/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Point(BaseModel):
type: str
coordinates: List[float]

@validator('type')
@validator("type")
def validate_type(cls, v):
if not v == "Point":
raise ValueError("Point required")
Expand Down
6 changes: 4 additions & 2 deletions response_builder/v1/models/polling_stations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Optional, Union, List, Tuple
from typing import Dict, List, Optional, Tuple, Union

from pydantic import BaseModel, Field

Expand All @@ -10,7 +10,9 @@ class AdvanceVotingStation(BaseModel):
address: str
postcode: str
location: Point
opening_times: List[Tuple[str, str, str]] # List of tuples with date and opening/closing times
opening_times: List[
Tuple[str, str, str]
] # List of tuples with date and opening/closing times


class StationProperties(BaseModel):
Expand Down

0 comments on commit e22b430

Please sign in to comment.