Skip to content

Commit 38242b3

Browse files
Copilothsluoyz
andcommitted
Fix setup.py to read dependencies from requirements.in instead of requirements.txt
The previous implementation incorrectly parsed pip-compile generated requirements.txt which included comment lines. This fix properly reads from the source requirements.in file and filters out comments and empty lines, ensuring only pycasbin (not casbin) is used as a dependency. Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
1 parent 6954ac7 commit 38242b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
print(long_description)
1414

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

19-
install_requires = [x.strip() for x in all_reqs if "git+" not in x]
19+
install_requires = [x.strip() for x in all_reqs if x.strip() and not x.startswith("#") and "git+" not in x]
2020
dependency_links = [
2121
x.strip().replace("git+", "") for x in all_reqs if x.startswith("git+")
2222
]

0 commit comments

Comments
 (0)