Skip to content

Commit 6876f06

Browse files
authored
Ignore requirement lines starting with dash (#315)
* Add failing test * Ignore requirement lines starting with `-`
1 parent 89fefa6 commit 6876f06

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/nox_poetry/sessions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def to_constraint(requirement_string: str, line: int) -> Optional[str]:
5959
"""Convert requirement to constraint."""
6060
if any(
6161
requirement_string.startswith(prefix)
62-
for prefix in ("-e ", "file://", "git+https://", "http://", "https://")
62+
for prefix in ("-", "file://", "git+https://", "http://", "https://")
6363
):
6464
return None
6565

tests/unit/test_sessions.py

+5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ def test_session_build_package(proxy: nox_poetry.Session) -> None:
152152
"regex==2020.10.28; python_version == '3.5'",
153153
'regex==2020.10.28; python_version == "3.5"',
154154
),
155+
("-e ../lib/foo", ""),
156+
(
157+
"--extra-index-url https://example.com/pypi/simple",
158+
"",
159+
),
155160
],
156161
)
157162
def test_to_constraints(requirements: str, expected: str) -> None:

0 commit comments

Comments
 (0)