Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os


from setuptools import setup, find_packages

setup(
Expand All @@ -11,9 +9,10 @@
author="OpenAI",
packages=find_packages(exclude=["tests*"]),
install_requires=[
line.strip()
stripped
for line in open(os.path.join(os.path.dirname(__file__), "requirements.txt"))
if line.strip() and not line.startswith("#")
for stripped in [line.strip()]
if stripped and not stripped.startswith("#")
Comment on lines 11 to +15
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open(..."requirements.txt") is used directly inside the list comprehension without a context manager, so the file handle may remain unclosed until GC. Consider reading the file with a with open(...) (and ideally an explicit encoding) before constructing install_requires to avoid resource warnings and improve robustness on Windows.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +15
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested comprehension pattern for stripped in [line.strip()] is an uncommon idiom and makes install_requires harder to read/maintain. It would be clearer to strip once in a small helper (or pre-process the lines) rather than using a single-item list to bind an intermediate value.

Copilot uses AI. Check for mistakes.
],
include_package_data=True,
extras_require={'dev': ['pytest']},
Expand Down
Loading