Improve handling of pip arguments when detecting local dependencies

pull/866/head
Tim Head 2020-03-27 15:28:19 +01:00
rodzic 5ef65f9806
commit 110d34d041
2 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -466,7 +466,15 @@ def is_local_pip_requirement(line):
if line.startswith(("-r", "-c")):
# local -r or -c references break isolation
return True
# strip off `-e, etc.`
if line.startswith(("--requirement", "--constraint")):
# as above but flags are spelt out
return True
# strip off things like `--editable=`. Long form arguments require a =
if line.startswith("--"):
line = line.split("=", 1)[1]
# strip off short form arguments like `-e`. Short form arguments can be
# followed by a space `-e foo` or use `-e=foo`. The latter is not handled
# here. We can deal with it when we see someone using it.
if line.startswith("-"):
line = line.split(None, 1)[1]
if "file://" in line:

Wyświetl plik

@ -135,6 +135,7 @@ def test_open_guess_encoding():
[
("-r requirements.txt", True),
("-e .", True),
("--editable=.", True),
("file://subdir", True),
("file://./subdir", True),
("git://github.com/jupyter/repo2docker", False),