From ddd7879ae2cdc5cfb13de774feb4ac73cd42de37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rpel?= Date: Mon, 23 Dec 2024 03:05:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Properly=20?= =?UTF-8?q?handle=20poetry=20extras?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python.yml | 2 +- Makefile | 2 +- poetry.lock | 52 +++++++++++++++++++++++++++++++----- pyproject.toml | 19 +++++++------ 4 files changed, 56 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 9285367..527f715 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -45,7 +45,7 @@ jobs: path: ~/.cache/pre-commit key: pre-commit-${{ runner.os }}-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} - name: Install dependencies - run: poetry install --with dev + run: poetry install --with dev --all-extras - name: Run pre-commit hooks run: poetry run pre-commit run - name: Lint with flake8 diff --git a/Makefile b/Makefile index 460af4c..ccd9d69 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: clean install test install: - poetry install --with dev + poetry install --with dev --all-extras lint: poetry run flake8 ftmq --count --select=E9,F63,F7,F82 --show-source --statistics diff --git a/poetry.lock b/poetry.lock index d1c0112..ef7c79b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -262,7 +262,7 @@ test = ["astroid (>=2,<4)", "pytest", "pytest-cov", "pytest-xdist"] name = "async-timeout" version = "5.0.1" description = "Timeout context manager for asyncio programs" -optional = false +optional = true python-versions = ">=3.8" files = [ {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, @@ -985,6 +985,28 @@ files = [ [package.extras] tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] +[[package]] +name = "fakeredis" +version = "2.26.2" +description = "Python implementation of redis API, can be used for testing purposes." +optional = true +python-versions = "<4.0,>=3.7" +files = [ + {file = "fakeredis-2.26.2-py3-none-any.whl", hash = "sha256:86d4129df001efc25793cb334008160fccc98425d9f94de47884a92b63988c14"}, + {file = "fakeredis-2.26.2.tar.gz", hash = "sha256:3ee5003a314954032b96b1365290541346c9cc24aab071b52cc983bb99ecafbf"}, +] + +[package.dependencies] +redis = {version = ">=4.3", markers = "python_full_version > \"3.8.0\""} +sortedcontainers = ">=2,<3" + +[package.extras] +bf = ["pyprobables (>=0.6,<0.7)"] +cf = ["pyprobables (>=0.6,<0.7)"] +json = ["jsonpath-ng (>=1.6,<2.0)"] +lua = ["lupa (>=2.1,<3.0)"] +probabilistic = ["pyprobables (>=0.6,<0.7)"] + [[package]] name = "filelock" version = "3.16.1" @@ -2926,7 +2948,7 @@ testing = ["pytest", "pytest-benchmark"] name = "plyvel" version = "1.5.1" description = "Plyvel, a fast and feature-rich Python interface to LevelDB" -optional = false +optional = true python-versions = "*" files = [ {file = "plyvel-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8394aed946000fca2c92d7ae8537d9907c8169debf7f55c7ecb53751f3bf4e7"}, @@ -3806,13 +3828,13 @@ orjson = ["orjson (>=3.9.14,<4)"] [[package]] name = "redis" -version = "5.2.0" +version = "5.2.1" description = "Python client for Redis database and key-value store" -optional = false +optional = true python-versions = ">=3.8" files = [ - {file = "redis-5.2.0-py3-none-any.whl", hash = "sha256:ae174f2bb3b1bf2b09d54bf3e51fbc1469cf6c10aa03e21141f51969801a7897"}, - {file = "redis-5.2.0.tar.gz", hash = "sha256:0b1087665a771b1ff2e003aa5bdd354f15a70c9e25d5a7dbf9c722c16528a7b0"}, + {file = "redis-5.2.1-py3-none-any.whl", hash = "sha256:ee7e1056b9aea0f04c6c2ed59452947f34c4940ee025f5dd83e6a6418b6989e4"}, + {file = "redis-5.2.1.tar.gz", hash = "sha256:16f2e22dff21d5125e8481515e386711a34cbec50f0e44413dd7d9c060a54e0f"}, ] [package.dependencies] @@ -4184,6 +4206,17 @@ files = [ {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] +[[package]] +name = "sortedcontainers" +version = "2.4.0" +description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +optional = true +python-versions = "*" +files = [ + {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, + {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, +] + [[package]] name = "sqlalchemy" version = "2.0.36" @@ -4686,7 +4719,12 @@ idna = ">=2.0" multidict = ">=4.0" propcache = ">=0.2.0" +[extras] +level = ["plyvel"] +redis = ["fakeredis", "redis"] +sql = ["sqlalchemy"] + [metadata] lock-version = "2.0" python-versions = ">=3.11,<4" -content-hash = "50b6ac486c2da913304f87dcc7e5b1e921aa4bc3b8f5d5ff72778f0e827b6a7e" +content-hash = "8bef51540514ca971f98aad5b7d275c70724ae206725f48eb5d341fb37f19287" diff --git a/pyproject.toml b/pyproject.toml index 636bfdb..baf8847 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,15 @@ nomenklatura = "^3.14.0" anystore = "^0.2.1" structlog = "^24.4.0" rigour = "^0.8.2" +redis = {version = "^5.2.1", optional = true} +plyvel = {version = "^1.5.1", optional = true} +sqlalchemy = {version = "^2.0.36", optional = true} +fakeredis = {version = "^2.26.2", optional = true} + +[tool.poetry.extras] +sql = ["sqlalchemy"] +redis = ["redis", "fakeredis"] +level = ["plyvel"] [tool.poetry.group.dev.dependencies] pytest = ">=7.4.3,<9.0.0" @@ -66,16 +75,6 @@ mkdocs-click = "^0.8.1" # [tool.poetry.group.clickhouse.dependencies] # ftm-columnstore = "^0.3.0" -[tool.poetry.group.level.dependencies] -plyvel = "^1.5.1" - -[tool.poetry.group.redis.dependencies] -redis = "^5.0.1" - - -[tool.poetry.group.sql.dependencies] -sqlalchemy = "^2.0.36" - [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"