|
26 | 26 | from python_inspector.resolution import parse_reqs_from_setup_py_insecurely
|
27 | 27 | from python_inspector.utils_pypi import PYPI_PUBLIC_REPO
|
28 | 28 | from python_inspector.utils_pypi import Environment
|
| 29 | +from python_inspector.utils_pypi import PypiSimpleRepository |
29 | 30 |
|
30 | 31 | setup_test_env = FileDrivenTesting()
|
31 | 32 | setup_test_env.test_data_dir = os.path.join(os.path.dirname(__file__), "data")
|
@@ -130,6 +131,34 @@ def test_get_resolved_dependencies_with_tilde_requirement_using_json_api():
|
130 | 131 | ]
|
131 | 132 |
|
132 | 133 |
|
| 134 | +@pytest.mark.online |
| 135 | +def test_get_resolved_dependencies_with_url_encoded_char_plus(): |
| 136 | + req = Requirement("torch==2.0.0+cpu") |
| 137 | + req.is_requirement_resolved = True |
| 138 | + _, plist = get_resolved_dependencies( |
| 139 | + requirements=[req], |
| 140 | + environment=Environment( |
| 141 | + python_version="310", |
| 142 | + operating_system="linux", |
| 143 | + ), |
| 144 | + repos=[ |
| 145 | + PypiSimpleRepository(index_url="https://download.pytorch.org/whl/cpu", credentials=None) |
| 146 | + ], |
| 147 | + as_tree=False, |
| 148 | + ) |
| 149 | + |
| 150 | + assert plist == [ |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + "pkg:pypi/[email protected]%2Bcpu", |
| 158 | + |
| 159 | + ] |
| 160 | + |
| 161 | + |
133 | 162 | @pytest.mark.online
|
134 | 163 | def test_without_supported_wheels():
|
135 | 164 | req = Requirement("autobahn==22.3.2")
|
|
0 commit comments