Skip to content

Commit

Permalink
Merge pull request #221 from steersbob/feature/bookworm
Browse files Browse the repository at this point in the history
bump dependencies
  • Loading branch information
steersbob authored Sep 13, 2023
2 parents 8630f0e + e3f78dd commit e11a2b9
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 288 deletions.
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"python.defaultInterpreterPath": ".venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.terminal.activateEnvironment": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.testing.pytestArgs": [
"--no-cov",
"."
Expand All @@ -18,6 +16,5 @@
},
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.formatting.provider": "none"
}
}
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-bullseye as base
FROM python:3.11-bookworm as base

COPY ./dist /app/dist

Expand All @@ -11,7 +11,7 @@ RUN set -ex \
&& pip3 wheel --wheel-dir=/wheeley -r /app/dist/requirements.txt \
&& pip3 wheel --wheel-dir=/wheeley /app/dist/*.tar.gz

FROM python:3.9-slim-bullseye
FROM python:3.11-slim-bookworm
EXPOSE 5000
WORKDIR /app

Expand Down
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
# History Service

The history service is the gatekeeper for Brewblox databases. It writes data from history events, and offers REST interfaces for querying the InfluxDB and Redis databases.

## Features

### QueryClient ([influx.py](./brewblox_history/influx.py))

Handles directly querying InfluxDB. API functions eventually call this.

### InfluxWriter ([influx.py](./brewblox_history/influx.py))

Periodically writes scheduled data points to InfluxDB.

Publicly offers the `write_soon()` function, where data can be scheduled for writing.

### DataRelay ([relays.py](./brewblox_history/relays.py))

Subscribes to the `--history-topic` topic on the event bus, and schedules all received data for writing to the database.

### Datastore ([redis.py](./brewblox_history/redis.py))

Offers a simple wrapper around the Redis API.
Changes are broadcast to the `--datastore-topic` topic.

## REST API

### queries ([query_api.py](./brewblox_history/query_api.py))

REST API for the InfluxDB database. Also offers WebSocket endpoints for streamed values.

### datastore ([datastore_api](./brewblox_history/datastore_api.py))

REST API for the Redis datastore.
The history service is the gatekeeper for Brewblox databases. It writes data from history events, and offers REST interfaces for querying the Victoria and Redis databases.
2 changes: 1 addition & 1 deletion brewblox_history/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from itertools import groupby
from typing import Optional

import aioredis
from aiohttp import web
from brewblox_service import brewblox_logger, features, mqtt

from brewblox_history.models import DatastoreValue, ServiceConfig
from redis import asyncio as aioredis

LOGGER = brewblox_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion brewblox_history/victoria.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def ping(self):
url = f'{self._url}/health'
async with http.session(self.app).get(url) as resp:
status = await resp.text()
if status != 'OK':
if status != 'OK': # pragma: no branch
raise ConnectionError(f'Database ping returned warning: "{status}"')

async def _json_query(self, query: str, url: str, session: ClientSession):
Expand Down
342 changes: 101 additions & 241 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.9,<4"
brewblox-service = "^3.1.2"
aioredis = "^2.0.1"
brewblox-service = "^3.3.2"
ciso8601 = "^2.2.0"
pytimeparse = "^1.1.8"
llist = "^0.7.1"
cryptography = "40.0.1"
redis = "^5.0.0"

[tool.poetry.group.dev.dependencies]
pytest-cov = "*"
Expand All @@ -24,8 +23,8 @@ autopep8 = "*"
flake8-quotes = "*"
aresponses = "*"
pytest = "*"
invoke = "^2.2.0"
invoke = "*"

[build-system]
requires = ["poetry>=0.12", "cryptography==40.0.1"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit e11a2b9

Please sign in to comment.