Skip to content

Commit

Permalink
feat(fastapi v100 + pydantic v2):
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnksslr committed Aug 24, 2023
1 parent abf171e commit 6bdecfc
Show file tree
Hide file tree
Showing 6 changed files with 665 additions and 602 deletions.
1,232 changes: 647 additions & 585 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ license = "MIT"
python = "^3.11"
beautifulsoup4 = "^4.12.2"
lxml = "^4.9.2"
fastapi = "^0.95.0"
fastapi = "^0.100.0"
aiofiles = "^23.1.0"
jinja2 = "^3.1.2"
python-multipart = "^0.0.5"
loguru = "^0.6.0"
uvicorn = { extras = ["standard"], version = "^0.21.1" }
httpx = "^0.23.3"
pydantic = "^2.3.0"

[tool.poetry.group.dev.dependencies]
ruff = "^0.0.261"
Expand Down
10 changes: 5 additions & 5 deletions src/models/heresy_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@


class HeresyUnit(Unit):
initiative: str | None
initiative: str | None = None
unit_type: str
armor_facing: ArmorFacing | None
stat_type: str | None
weapon: dict | None
move: str | None
armor_facing: ArmorFacing | None = None
stat_type: str | None = None
weapon: dict | None = None
move: str | None = None

@staticmethod
def get_stat_type(unit_type):
Expand Down
2 changes: 1 addition & 1 deletion src/models/killteam_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class KillteamUnit(Unit):
ga: str
df: str
keywords: list
psyker_powers: dict | None
psyker_powers: dict | None = None
16 changes: 8 additions & 8 deletions src/models/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ class Unit(BaseModel):
name: str
wargear: dict
abilities: dict
weapon_skill: str | None
ballistic_skill: str | None
strength: str | None
toughness: str | None
wounds: str | None
attacks: str | None
leadership: str | None
save: str | None
weapon_skill: str | None = None
ballistic_skill: str | None = None
strength: str | None = None
toughness: str | None = None
wounds: str | None = None
attacks: str | None = None
leadership: str | None = None
save: str | None = None
4 changes: 2 additions & 2 deletions src/models/w40k_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class W40kSelection(BaseModel):
rules: dict = None
abilities: dict = None
keywords: list
psyker_powers: dict | None
transport: dict | None
psyker_powers: dict | None = None
transport: dict | None = None


class W40kUnit(Unit):
Expand Down

0 comments on commit 6bdecfc

Please sign in to comment.