mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 23:55:15 -05:00
[PR #24118] [MERGED] style(env): satisfy ruff lint on backend/open_webui/env.py #114820
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24118
Author: @ashm-dev
Created: 4/25/2026
Status: ✅ Merged
Merged: 5/8/2026
Merged by: @tjbck
Base:
dev← Head:ruff_env📝 Commits (1)
c3944bdstyle(env): satisfy ruff (datetime alias, line length, identity check)📊 Changes
1 file changed (+12 additions, -11 deletions)
View changed files
📝
backend/open_webui/env.py(+12 -11)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.ruff check+ruff format --checkpass; module imports cleanly;JSONFormatterstill emits valid ISO-8601 UTC timestamps for both info and exception records.dev, no unrelated changes.style:— does not affect the meaning of the code.Changelog Entry
Description
backend/open_webui/env.pypassruff checkandruff formatcleanly under the project's existing ruff config (no rule changes). Three lint violations are addressed without altering runtime behavior.Changed
from datetime import UTC, datetimewithimport datetime as dtto comply with the repo'sflake8-import-conventionsconfig (datetimeis inbanned-from, aliasdt). Updated the single call site inJSONFormatter.formataccordingly.USE_CUDAinto two lines (E501).if DATABASE_POOL_SIZE != None:withis not None(E711).Fixed
ruff check --fix backend/open_webui/env.py && ruff format backend/open_webui/env.pyerrors (ICN003, E501, E711) reported on this file.Additional Information
JSONFormatterproduces identical output (verified manually with both info and exception records);DATABASE_POOL_SIZEbranch logic is identity-equivalent to the previous!=comparison.env.py. Other modules in the repo still usefrom datetime import ...and would need a separate, broader PR to migrate.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.