From 8687256ffe66df96ca7396407a760c910f917913 Mon Sep 17 00:00:00 2001 From: Tim Orme Date: Sun, 19 Mar 2023 21:07:45 -0700 Subject: [PATCH] Fix builds --- .github/workflows/pr.yml | 2 +- aqimon/config.py | 15 --------- poetry.lock | 73 ++-------------------------------------- pyproject.toml | 1 - 4 files changed, 4 insertions(+), 87 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1796208..2ea9fc3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -24,7 +24,7 @@ jobs: - name: elm-format install run: npm install -g elm-format - name: Install dev dependencies - run: poetry install --only=dev + run: poetry install --no-root env: POETRY_VIRTUALENVS_CREATE: false - name: Check linting diff --git a/aqimon/config.py b/aqimon/config.py index f52916e..09244e3 100644 --- a/aqimon/config.py +++ b/aqimon/config.py @@ -1,13 +1,10 @@ """Config module.""" import os.path from dataclasses import dataclass -from serde import serde -from serde.toml import to_toml, from_toml DEFAULT_DB_PATH = "~/.aqimon/db.sqlite" -@serde @dataclass(frozen=True) class Config: """Config data for the application.""" @@ -41,18 +38,6 @@ class Config: ) -def _load_config(path: str) -> Config: - """Load config data from a toml file.""" - with open(path, "r") as file: - return from_toml(Config, file.read()) - - -def save_config(config: Config, path: str): - """Save config data to a given path as a toml file.""" - with open(path, "w") as file: - file.write(to_toml(config)) - - def get_config_from_env() -> Config: """Get the config from environment variables.""" return Config( diff --git a/poetry.lock b/poetry.lock index 6743885..3914609 100644 --- a/poetry.lock +++ b/poetry.lock @@ -83,18 +83,6 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] -[[package]] -name = "casefy" -version = "0.1.7" -description = "Utilities for string case conversion." -category = "main" -optional = false -python-versions = ">=3.6" -files = [ - {file = "casefy-0.1.7-py3-none-any.whl", hash = "sha256:ab05ff1c67f2a8e62d9f8986fa9a849416d61ac5413ec57d1f827b4f36589cf6"}, - {file = "casefy-0.1.7.tar.gz", hash = "sha256:6accce985a64b9edb2a610a29ac489d78fac80e52ff8f2d137e294f2f92b8027"}, -] - [[package]] name = "click" version = "8.1.3" @@ -414,7 +402,7 @@ reports = ["lxml"] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "main" +category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -515,33 +503,6 @@ typing-extensions = ">=4.2.0" dotenv = ["python-dotenv (>=0.10.4)"] email = ["email-validator (>=1.0.3)"] -[[package]] -name = "pyserde" -version = "0.10.2" -description = "Yet another serialization library on top of dataclasses" -category = "main" -optional = false -python-versions = ">=3.7.0,<4.0.0" -files = [ - {file = "pyserde-0.10.2-py3-none-any.whl", hash = "sha256:1996c901d1a3b467058b538324dbf93824fa55b692c946287aaa7ebe4fc28283"}, - {file = "pyserde-0.10.2.tar.gz", hash = "sha256:5a5a47a18c1db02dcc0e0c391dd6f12a2a11a72190c032caedf73752ed2fe6d3"}, -] - -[package.dependencies] -casefy = "*" -jinja2 = "*" -tomli = {version = "*", optional = true, markers = "extra == \"toml\" or extra == \"all\""} -tomli-w = {version = "*", optional = true, markers = "extra == \"toml\" or extra == \"all\""} -typing_inspect = ">=0.4.0" - -[package.extras] -all = ["msgpack", "numpy (>1.21.0)", "numpy (>1.21.0)", "numpy (>1.21.0)", "numpy (>1.22.0)", "orjson", "pyyaml", "tomli", "tomli-w"] -msgpack = ["msgpack"] -numpy = ["numpy (>1.21.0)", "numpy (>1.21.0)", "numpy (>1.21.0)", "numpy (>1.22.0)"] -orjson = ["orjson"] -toml = ["tomli", "tomli-w"] -yaml = ["pyyaml"] - [[package]] name = "pyserial" version = "3.5" @@ -694,7 +655,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyam name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -702,18 +663,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "tomli-w" -version = "1.0.0" -description = "A lil' TOML writer" -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli_w-1.0.0-py3-none-any.whl", hash = "sha256:9f2a07e8be30a0729e533ec968016807069991ae2fd921a78d42f429ae5f4463"}, - {file = "tomli_w-1.0.0.tar.gz", hash = "sha256:f463434305e0336248cac9c2dc8076b707d8a12d019dd349f5c1e382dd1ae1b9"}, -] - [[package]] name = "typing-extensions" version = "4.5.0" @@ -726,22 +675,6 @@ files = [ {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, ] -[[package]] -name = "typing-inspect" -version = "0.8.0" -description = "Runtime inspection utilities for typing module." -category = "main" -optional = false -python-versions = "*" -files = [ - {file = "typing_inspect-0.8.0-py3-none-any.whl", hash = "sha256:5fbf9c1e65d4fa01e701fe12a5bca6c6e08a4ffd5bc60bfac028253a447c5188"}, - {file = "typing_inspect-0.8.0.tar.gz", hash = "sha256:8b1ff0c400943b6145df8119c41c244ca8207f1f10c9c057aeed1560e4806e3d"}, -] - -[package.dependencies] -mypy-extensions = ">=0.3.0" -typing-extensions = ">=3.7.4" - [[package]] name = "uvicorn" version = "0.21.0" @@ -764,4 +697,4 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "3b689e094ddb77cb29ffc7b6bc8eca9d8a35836bdf4049996b012b344fc36ca3" +content-hash = "8352d5071c797798e1db271d217bd6ce8b2197b41308498d474db523f9eb1bda" diff --git a/pyproject.toml b/pyproject.toml index 677f6a0..6506e8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ uvicorn = "^0.21.0" databases = {extras = ["aiosqlite"], version = "^0.7.0"} jinja2 = "^3.1.2" fastapi-utils = "^0.2.1" -pyserde = {extras = ["toml"], version = "^0.10.2"} [tool.poetry.group.dev.dependencies]