[PR #24118] [MERGED] style(env): satisfy ruff lint on backend/open_webui/env.py #98548

Closed
opened 2026-05-16 01:21:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: devHead: ruff_env


📝 Commits (1)

  • c3944bd style(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:

  • Target branch: Verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Add docs in Open WebUI Docs Repository. — N/A, no user-facing behavior change.
  • Dependencies: Are there any new or upgraded dependencies? — None.
  • Testing: Perform manual tests. — Verified ruff check + ruff format --check pass; module imports cleanly; JSONFormatter still emits valid ISO-8601 UTC timestamps for both info and exception records.
  • Agentic AI Code: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review AND manual testing.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Design & Architecture: No new settings or architectural changes — pure lint compliance.
  • Git Hygiene: Single atomic commit, rebased on dev, no unrelated changes.
  • Title Prefix: style: — does not affect the meaning of the code.

Changelog Entry

Description

  • Make backend/open_webui/env.py pass ruff check and ruff format cleanly under the project's existing ruff config (no rule changes). Three lint violations are addressed without altering runtime behavior.

Changed

  • Replaced from datetime import UTC, datetime with import datetime as dt to comply with the repo's flake8-import-conventions config (datetime is in banned-from, alias dt). Updated the single call site in JSONFormatter.format accordingly.
  • Split the over-length comment above USE_CUDA into two lines (E501).
  • Replaced if DATABASE_POOL_SIZE != None: with is not None (E711).

Fixed

  • Resolves the remaining ruff check --fix backend/open_webui/env.py && ruff format backend/open_webui/env.py errors (ICN003, E501, E711) reported on this file.

Additional Information

  • Behavior is unchanged: JSONFormatter produces identical output (verified manually with both info and exception records); DATABASE_POOL_SIZE branch logic is identity-equivalent to the previous != comparison.
  • Scope is intentionally limited to env.py. Other modules in the repo still use from 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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/24118 **Author:** [@ashm-dev](https://github.com/ashm-dev) **Created:** 4/25/2026 **Status:** ✅ Merged **Merged:** 5/8/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `ruff_env` --- ### 📝 Commits (1) - [`c3944bd`](https://github.com/open-webui/open-webui/commit/c3944bdd5dde1c5d003b678c1391d8d8ce990a33) style(env): satisfy ruff (datetime alias, line length, identity check) ### 📊 Changes **1 file changed** (+12 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/env.py` (+12 -11) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** Add docs in [Open WebUI Docs Repository](https://github.com/open-webui/docs). — N/A, no user-facing behavior change. - [x] **Dependencies:** Are there any new or upgraded dependencies? — None. - [x] **Testing:** Perform manual tests. — Verified `ruff check` + `ruff format --check` pass; module imports cleanly; `JSONFormatter` still emits valid ISO-8601 UTC timestamps for both info and exception records. - [x] **Agentic AI Code:** Confirm this Pull Request is **not written by any AI Agent** or has at least **gone through additional human review AND manual testing**. - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Design & Architecture:** No new settings or architectural changes — pure lint compliance. - [x] **Git Hygiene:** Single atomic commit, rebased on `dev`, no unrelated changes. - [x] **Title Prefix:** `style:` — does not affect the meaning of the code. # Changelog Entry ### Description - Make `backend/open_webui/env.py` pass `ruff check` and `ruff format` cleanly under the project's existing ruff config (no rule changes). Three lint violations are addressed without altering runtime behavior. ### Changed - Replaced `from datetime import UTC, datetime` with `import datetime as dt` to comply with the repo's `flake8-import-conventions` config (`datetime` is in `banned-from`, alias `dt`). Updated the single call site in `JSONFormatter.format` accordingly. - Split the over-length comment above `USE_CUDA` into two lines (E501). - Replaced `if DATABASE_POOL_SIZE != None:` with `is not None` (E711). ### Fixed - Resolves the remaining `ruff check --fix backend/open_webui/env.py && ruff format backend/open_webui/env.py` errors (ICN003, E501, E711) reported on this file. --- ### Additional Information - Behavior is unchanged: `JSONFormatter` produces identical output (verified manually with both info and exception records); `DATABASE_POOL_SIZE` branch logic is identity-equivalent to the previous `!=` comparison. - Scope is intentionally limited to `env.py`. Other modules in the repo still use `from datetime import ...` and would need a separate, broader PR to migrate. ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-16 01:21:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#98548