Skip to content

Commit fc88e37

Browse files
committed
Fixed errors in setup.py !minor
1 parent 478a7d3 commit fc88e37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from setuptools import setup
66

77

8-
def parse_reqs_in(filepath: Path, visited: Optional[set] = None) -> List[str]:
8+
def parse_reqs_in(filepath: Path, visited: Optional[set] = None) -> List[str]: # noqa: C901
99
"""
1010
Parse a file path containing a pip-tools requirements.in and return a list of requirements.
1111
@@ -25,9 +25,9 @@ def parse_reqs_in(filepath: Path, visited: Optional[set] = None) -> List[str]:
2525
visited = set()
2626
reqstr: str = filepath.read_text()
2727
reqs: List[str] = []
28-
for line in reqstr.splitlines():
29-
line = line.strip()
30-
if line == "":
28+
for line in reqstr.splitlines(keepends=False):
29+
line = line.strip() # noqa: PLW2901
30+
if not line:
3131
continue
3232
elif not line or line.startswith("#"):
3333
# comments are lines that start with # only

0 commit comments

Comments
 (0)