File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 6
6
from pathlib import Path
7
7
from typing import Any
8
8
9
+ import requirements
9
10
import pkg_resources
10
11
import tomli
11
12
@@ -97,8 +98,9 @@ def _doGetReqs(
97
98
if not reqPath .exists ():
98
99
raise RuntimeError (f"Could not find specification of requirements ({ reqPath } )." )
99
100
100
- for req in reqPath .read_text ("utf-8" ).strip ().split ("\n " ):
101
- reqs .add (resolveReq (req ))
101
+ with open (reqPath , encoding = "utf-8" ) as requirementsTxt :
102
+ for req in requirements .parse (requirementsTxt ):
103
+ reqs .add (str (req .name ).lower ())
102
104
103
105
try :
104
106
reqs .remove ("PYTHON" )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ licensecheck = 'licensecheck:cli'
28
28
29
29
[tool .poetry .dependencies ]
30
30
python = " ^3.8"
31
+ requirements-parser = " <2,>=0.5.0"
31
32
requests = " <3,>=2.31.0"
32
33
fhconfparser = " <2024,>=2022"
33
34
tomli = " <3,>=2.0.1"
You can’t perform that action at this time.
0 commit comments