Skip to content

Instructions api2 #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6.4
current_version = 1.6.5
commit = False
tag = False

Expand Down
2,443 changes: 1,239 additions & 1,204 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rasenmaeher_api"
version = "1.6.4"
version = "1.6.5"
description = "python-rasenmaeher-api"
authors = [
"Aciid <703382+Aciid@users.noreply.github.com>",
Expand Down Expand Up @@ -82,7 +82,8 @@ multikeyjwt = "^1.0"
uvicorn = {version = "^0.20", extras = ["standard"]}
gunicorn = "^20.1"
pyopenssl = "^23.1"
libpvarki = { git="https://github.com/pvarki/python-libpvarki.git", tag="1.9.0"}
# Can't update to 2.0 before pydantic migration is done
libpvarki = { git="https://github.com/pvarki/python-libpvarki.git", tag="1.9.1"}
openapi-readme = "^0.2"
python-multipart = "^0.0.6"
aiohttp = ">=3.11.10,<4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/rasenmaeher_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""python-rasenmaeher-api"""

__version__ = "1.6.4" # NOTE Use `bump2version --config-file patch` to bump versions correctly
__version__ = "1.6.5" # NOTE Use `bump2version --config-file patch` to bump versions correctly
8 changes: 4 additions & 4 deletions src/rasenmaeher_api/web/api/instructions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import cast, Optional
import logging

from fastapi import Depends, APIRouter, Request
from fastapi import Depends, APIRouter, Request, HTTPException
from libpvarki.schemas.product import UserCRUDRequest, UserInstructionFragment


Expand Down Expand Up @@ -71,8 +71,8 @@ async def get_product_instructions(request: Request, product: str, language: str
endpoint_url = f"api/v1/instructions/{language}"
response = await post_to_product(product, endpoint_url, user.dict(), InstructionData)
if response is None:
LOGGER.error("post_to_product({}, {}): failed".format(product, endpoint_url))
# TODO: Raise a reasonable error instead
return None
_reason = f"Unable to get instructions for {product}"
LOGGER.error("{} : {}".format(request.url, _reason))
raise HTTPException(status_code=404, detail=_reason)
response = cast(InstructionData, response)
return response
10 changes: 5 additions & 5 deletions tests/ptfpapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aiohttp==3.8.6
cryptography==41.0.5
fastapi==0.104.1
libadvian==1.4.0
aiohttp==3.11.18
cryptography==41.0.7
fastapi==0.115.12
libadvian==1.7.0
pyOpenSSL==23.3.0
Brotli==1.1.0
libpvarki @ git+https://github.com/pvarki/python-libpvarki.git@1.7.0
libpvarki @ git+https://github.com/pvarki/python-libpvarki.git@1.9.1
2 changes: 1 addition & 1 deletion tests/test_rasenmaeher_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def test_version() -> None:
"""Make sure version matches expected"""
assert __version__ == "1.6.4"
assert __version__ == "1.6.5"


@pytest.mark.asyncio(loop_scope="session")
Expand Down