Skip to content
Closed
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
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
print(long_description)

# get the dependencies and installs
with open(path.join(here, "requirements.txt"), encoding="utf-8") as f:
with open(path.join(here, "requirements.in"), encoding="utf-8") as f:
all_reqs = f.read().split("\n")

install_requires = [x.strip() for x in all_reqs if "git+" not in x]
install_requires = [x.strip() for x in all_reqs if x.strip() and not x.startswith("#") and "git+" not in x]
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The comment filtering check not x.startswith("#") is applied to the unstripped line x, while the empty line check uses x.strip(). This means a line with leading whitespace followed by # (e.g., " # comment") would not be filtered out and could be included in install_requires.

Apply the startswith("#") check to the stripped version:

install_requires = [x.strip() for x in all_reqs if x.strip() and not x.strip().startswith("#") and "git+" not in x]

Or more efficiently, strip once:

stripped_reqs = [x.strip() for x in all_reqs]
install_requires = [x for x in stripped_reqs if x and not x.startswith("#") and "git+" not in x]
Suggested change
install_requires = [x.strip() for x in all_reqs if x.strip() and not x.startswith("#") and "git+" not in x]
stripped_reqs = [x.strip() for x in all_reqs]
install_requires = [x for x in stripped_reqs if x and not x.startswith("#") and "git+" not in x]

Copilot uses AI. Check for mistakes.
dependency_links = [
x.strip().replace("git+", "") for x in all_reqs if x.startswith("git+")
]
Expand Down Expand Up @@ -47,7 +47,7 @@
packages=find_packages(exclude=["docs", "test*"]),
install_requires=install_requires,
python_requires=">=3.6",
data_files=[desc_file, "requirements.txt"],
data_files=[desc_file, "requirements.in", "requirements.txt"],
include_package_data=True,
dependency_links=dependency_links,
license="Apache 2.0",
Expand Down