From 9b6c454056aa2747c29b2c12cf96e8376205622b Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 8 Dec 2023 00:26:20 +0100 Subject: [PATCH 1/4] Chore: Permit installation on Python 3.7 --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 02d4f5a..f4db32a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ authors = [ { name = "Marija Selakovic", email = "marija@crate.io" }, { name = "Andreas Motl", email = "andreas.motl@crate.io" }, ] -requires-python = ">=3.8" +requires-python = ">=3.7" classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", @@ -46,6 +46,7 @@ classifiers = [ "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -85,7 +86,7 @@ dynamic = [ dependencies = [ "boltons<24", "click<9", - "click-aliases<2,>=1.0.3", + "click-aliases<2,>=1.0.4", "colorama<1", "colorlog", "crash", From 70325a68cff41e579623a9b24592521097a04d34 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 8 Dec 2023 00:36:27 +0100 Subject: [PATCH 2/4] Tests: Improve test isolation by pruning environment variables --- tests/conftest.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index efc96b4..637e152 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,7 @@ # Copyright (c) 2021-2023, Crate.io Inc. # Distributed under the terms of the AGPLv3 license, see LICENSE. +import os + import pytest import responses @@ -28,7 +30,21 @@ @pytest.fixture(scope="session", autouse=True) -def configure_database_schema(session_mocker): +def prune_environment(): + """ + Delete all environment variables starting with `CRATEDB_` or `CRATE_`, + to prevent leaking from the developer's environment to the test suite. + """ + delete_items = [] + for envvar in os.environ.keys(): + if envvar.startswith("CRATEDB_") or envvar.startswith("CRATE_"): + delete_items.append(envvar) + for envvar in delete_items: + del os.environ[envvar] + + +@pytest.fixture(scope="session", autouse=True) +def configure_database_schema(session_mocker, prune_environment): """ Configure the machinery to use a different schema for storing subsystem database tables, so that they do not accidentally touch the production system. From d9f6fa5f2e0a336a1cfa06c3776b9138166ce3e3 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 8 Dec 2023 00:36:54 +0100 Subject: [PATCH 3/4] Chore: Use `pueblo[dataframe]` GA release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f4db32a..53b2af0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,7 +129,7 @@ release = [ "twine<5", ] test = [ - "pueblo[dataframe]@ git+https://github.com/pyveci/pueblo.git@develop", + "pueblo[dataframe]", "pytest<8", "pytest-cov<5", "pytest-mock<4", From c387c42463817ac72009fa93dad8f48fa2f47ece Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 8 Dec 2023 00:39:41 +0100 Subject: [PATCH 4/4] Chore: Use `black[jupyter]` for code formatting --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 53b2af0..854dc9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,7 @@ all = [ "cratedb-toolkit[influxdb,io,mongodb]", ] develop = [ - "black<24", + "black[jupyter]<24", "mypy==1.6.1", "poethepoet<0.25", "pyproject-fmt<1.4",