From 4aa9b8d5e720128fbf948990431915d942ff2476 Mon Sep 17 00:00:00 2001 From: kahghi Date: Tue, 21 Jan 2025 15:38:41 +0800 Subject: [PATCH] removed unused pytest-env and imports --- backend/open_webui/storage/provider.py | 2 +- .../test/apps/webui/storage/test_provider.py | 1 - pyproject.toml | 6 ----- uv.lock | 26 +++++++------------ 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/backend/open_webui/storage/provider.py b/backend/open_webui/storage/provider.py index fa29f9889..b3230ac87 100644 --- a/backend/open_webui/storage/provider.py +++ b/backend/open_webui/storage/provider.py @@ -208,7 +208,7 @@ def get_storage_provider(storage_provider: str): Storage = LocalStorageProvider() elif storage_provider == "s3": Storage = S3StorageProvider() - elif storage_provider == "gcs" and GCS_BUCKET_NAME: + elif storage_provider == "gcs": Storage = GCSStorageProvider() else: raise RuntimeError(f"Unsupported storage provider: {storage_provider}") diff --git a/backend/open_webui/test/apps/webui/storage/test_provider.py b/backend/open_webui/test/apps/webui/storage/test_provider.py index 37b608d37..94203578c 100644 --- a/backend/open_webui/test/apps/webui/storage/test_provider.py +++ b/backend/open_webui/test/apps/webui/storage/test_provider.py @@ -7,7 +7,6 @@ from moto import mock_aws from open_webui.storage import provider from gcp_storage_emulator.server import create_server from google.cloud import storage -from google.cloud.exceptions import NotFound def mock_upload_dir(monkeypatch, tmp_path): diff --git a/pyproject.toml b/pyproject.toml index c237da31b..4d69f069e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,7 +105,6 @@ dependencies = [ "ldap3==2.9.1", "google-cloud-storage==2.19.0", "gcp-storage-emulator>=2024.8.3", - "pytest-env>=1.1.5", ] readme = "README.md" requires-python = ">= 3.11, < 3.13.0a1" @@ -127,11 +126,6 @@ open-webui = "open_webui:app" requires = ["hatchling"] build-backend = "hatchling.build" -[tool.pytest.ini_options] -env = [ - "GCS_BUCKET_NAME=my-bucket" -] - [tool.rye] managed = true dev-dependencies = [] diff --git a/uv.lock b/uv.lock index a223e9770..00b6c29b4 100644 --- a/uv.lock +++ b/uv.lock @@ -27,7 +27,9 @@ resolution-markers = [ "python_full_version < '3.12' and platform_system == 'Darwin'", "python_full_version < '3.12' and platform_system == 'Darwin'", "python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system == 'Darwin'", - "python_full_version < '3.13' and platform_system == 'Darwin'", + "python_full_version < '3.12' and platform_system == 'Darwin'", + "python_full_version < '3.12.4' and platform_system == 'Darwin'", + "python_full_version >= '3.12.4' and platform_system == 'Darwin'", "python_full_version >= '3.13' and platform_system == 'Darwin'", "python_full_version >= '3.13' and platform_system == 'Darwin'", "python_full_version >= '3.13' and platform_system == 'Darwin'", @@ -59,7 +61,9 @@ resolution-markers = [ "python_full_version < '3.12' and platform_machine == 'aarch64' and platform_system == 'Linux'", "python_full_version < '3.12' and platform_machine == 'aarch64' and platform_system == 'Linux'", "python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "python_full_version < '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux'", + "python_full_version < '3.12' and platform_machine == 'aarch64' and platform_system == 'Linux'", + "python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux'", + "python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux'", "python_full_version >= '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux'", "python_full_version >= '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux'", "python_full_version >= '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux'", @@ -91,7 +95,9 @@ resolution-markers = [ "(python_full_version < '3.12' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version < '3.12' and platform_system != 'Darwin' and platform_system != 'Linux')", "(python_full_version < '3.12' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version < '3.12' and platform_system != 'Darwin' and platform_system != 'Linux')", "(python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux')", - "(python_full_version < '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version < '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')", + "(python_full_version < '3.12' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version < '3.12' and platform_system != 'Darwin' and platform_system != 'Linux')", + "(python_full_version < '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version < '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux')", + "(python_full_version >= '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version >= '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux')", "(python_full_version >= '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version >= '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')", "(python_full_version >= '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version >= '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')", "(python_full_version >= '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_full_version >= '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')", @@ -2862,7 +2868,6 @@ dependencies = [ { name = "pypdf" }, { name = "pytest" }, { name = "pytest-docker" }, - { name = "pytest-env" }, { name = "python-jose" }, { name = "python-multipart" }, { name = "python-pptx" }, @@ -2948,7 +2953,6 @@ requires-dist = [ { name = "pypdf", specifier = "==4.3.1" }, { name = "pytest", specifier = "~=8.3.2" }, { name = "pytest-docker", specifier = "~=3.1.1" }, - { name = "pytest-env", specifier = ">=1.1.5" }, { name = "python-jose", specifier = "==3.3.0" }, { name = "python-multipart", specifier = "==0.0.18" }, { name = "python-pptx", specifier = "==1.0.0" }, @@ -3954,18 +3958,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1a/a4/69defc13bf77ee5aeb3e7b7c45393d6c7312e9c4d8b55d280a094ff76ff3/pytest_docker-3.1.1-py3-none-any.whl", hash = "sha256:fd0d48d6feac41f62acbc758319215ec9bb805c2309622afb07c27fa5c5ae362", size = 8243 }, ] -[[package]] -name = "pytest-env" -version = "1.1.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytest" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/1f/31/27f28431a16b83cab7a636dce59cf397517807d247caa38ee67d65e71ef8/pytest_env-1.1.5.tar.gz", hash = "sha256:91209840aa0e43385073ac464a554ad2947cc2fd663a9debf88d03b01e0cc1cf", size = 8911 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/de/b8/87cfb16045c9d4092cfcf526135d73b88101aac83bc1adcf82dfb5fd3833/pytest_env-1.1.5-py3-none-any.whl", hash = "sha256:ce90cf8772878515c24b31cd97c7fa1f4481cd68d588419fd45f10ecaee6bc30", size = 6141 }, -] - [[package]] name = "python-dateutil" version = "2.9.0.post0"