Skip to content

Commit c038117

Browse files
committed
Fix missing index_urls parsing (#127)
1 parent 0ad23ab commit c038117

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/python_inspector/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def resolve_dependencies(
154154
deps = dependencies.get_dependencies_from_requirements(requirements_file=req_file)
155155
for extra_data in dependencies.get_extra_data_from_requirements(requirements_file=req_file):
156156
index_urls = (*index_urls, *tuple(extra_data.get("extra_index_urls") or []))
157+
index_urls = (*index_urls, *tuple(extra_data.get("index_urls") or []))
157158
direct_dependencies.extend(deps)
158159
package_data = [
159160
pkg_data.to_dict() for pkg_data in PipRequirementsFileHandler.parse(location=req_file)

tests/data/requirements-test.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
attrs
22
--extra-index-url https://pypi.python.org/simple/
33
--extra-index-url https://testpypi.python.org/simple/
4-
--extra-index-url https://pypi1.python.org/simple/
4+
--extra-index-url https://pypi1.python.org/simple/
5+
--index-url https://pypi-index1.python.org/simple/
6+
--index-url https://pypi-index2.python.org/simple/

tests/test_requirement_parsing.py

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def test_get_extra_data_from_requirements():
2424
"https://pypi.python.org/simple/",
2525
"https://testpypi.python.org/simple/",
2626
"https://pypi1.python.org/simple/",
27+
],
28+
"index_urls": [
29+
"https://pypi-index1.python.org/simple/",
30+
"https://pypi-index2.python.org/simple/",
2731
]
2832
}
2933
]

0 commit comments

Comments
 (0)