Skip to content

Commit 8782b26

Browse files
committed
Cleanup unused settings
Signed-off-by: Samuel Monson <smonson@redhat.com>
1 parent 118064a commit 8782b26

File tree

2 files changed

+2
-55
lines changed

2 files changed

+2
-55
lines changed

src/guidellm/settings.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import json
44
from collections.abc import Sequence
5-
from enum import Enum
65
from typing import Literal
76

8-
from pydantic import BaseModel, Field, model_validator
7+
from pydantic import BaseModel, Field
98
from pydantic_settings import BaseSettings, SettingsConfigDict
109

1110
__all__ = [
1211
"DatasetSettings",
13-
"Environment",
1412
"LoggingSettings",
1513
"Settings",
1614
"print_config",
@@ -19,25 +17,6 @@
1917
]
2018

2119

22-
class Environment(str, Enum):
23-
"""
24-
Enum for the supported environments
25-
"""
26-
27-
LOCAL = "local"
28-
DEV = "dev"
29-
STAGING = "staging"
30-
PROD = "prod"
31-
32-
33-
ENV_REPORT_MAPPING = {
34-
Environment.PROD: "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/v0.5.4/index.html",
35-
Environment.STAGING: "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/release/v0.4.0/index.html",
36-
Environment.DEV: "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/dev/index.html",
37-
Environment.LOCAL: "http://localhost:3000/index.html",
38-
}
39-
40-
4120
class LoggingSettings(BaseModel):
4221
"""
4322
Logging settings for the application
@@ -79,7 +58,7 @@ class ReportGenerationSettings(BaseModel):
7958
Report generation settings for the application
8059
"""
8160

82-
source: str = ""
61+
source: str = "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/v0.5.4/index.html"
8362

8463

8564
class Settings(BaseSettings):
@@ -103,7 +82,6 @@ class Settings(BaseSettings):
10382
)
10483

10584
# general settings
106-
env: Environment = Environment.PROD
10785
default_async_loop_sleep: float = 10e-5
10886
logging: LoggingSettings = LoggingSettings()
10987
default_sweep_number: int = 10
@@ -138,13 +116,6 @@ class Settings(BaseSettings):
138116
table_headers_border_char: str = "-"
139117
table_column_separator_char: str = "|"
140118

141-
@model_validator(mode="after")
142-
@classmethod
143-
def set_default_source(cls, values):
144-
if not values.report_generation.source:
145-
values.report_generation.source = ENV_REPORT_MAPPING.get(values.env)
146-
return values
147-
148119
def generate_env_file(self) -> str:
149120
"""
150121
Generate the .env file from the current settings

tests/unit/test_settings.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from guidellm.settings import (
44
DatasetSettings,
5-
Environment,
65
LoggingSettings,
76
ReportGenerationSettings,
87
Settings,
@@ -19,7 +18,6 @@
1918
@pytest.mark.smoke
2019
def test_default_settings():
2120
settings = Settings()
22-
assert settings.env == Environment.PROD
2321
assert settings.logging == LoggingSettings()
2422
assert settings.report_generation.source.startswith(BASE_URL)
2523

@@ -29,36 +27,16 @@ def test_settings_from_env_variables(mocker):
2927
mocker.patch.dict(
3028
"os.environ",
3129
{
32-
"GUIDELLM__env": "dev",
3330
"GUIDELLM__logging__disabled": "true",
3431
"GUIDELLM__REPORT_GENERATION__SOURCE": "http://custom.url",
3532
},
3633
)
3734

3835
settings = Settings()
39-
assert settings.env == Environment.DEV
4036
assert settings.logging.disabled is True
4137
assert settings.report_generation.source == "http://custom.url"
4238

4339

44-
@pytest.mark.smoke
45-
def test_report_generation_default_source():
46-
settings = Settings(env=Environment.LOCAL)
47-
assert settings.report_generation.source == "http://localhost:3000/index.html"
48-
49-
settings = Settings(env=Environment.DEV)
50-
assert (
51-
settings.report_generation.source
52-
== "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/dev/index.html"
53-
)
54-
55-
settings = Settings(env=Environment.STAGING)
56-
assert settings.report_generation.source.startswith(BASE_URL)
57-
58-
settings = Settings(env=Environment.PROD)
59-
assert settings.report_generation.source.startswith(BASE_URL)
60-
61-
6240
@pytest.mark.sanity
6341
def test_logging_settings():
6442
logging_settings = LoggingSettings(
@@ -90,12 +68,10 @@ def test_reload_settings(mocker):
9068
mocker.patch.dict(
9169
"os.environ",
9270
{
93-
"GUIDELLM__env": "staging",
9471
"GUIDELLM__logging__disabled": "false",
9572
},
9673
)
9774
reload_settings()
98-
assert settings.env == Environment.STAGING
9975
assert settings.logging.disabled is False
10076

10177

0 commit comments

Comments
 (0)