kopia lustrzana https://github.com/jupyterhub/repo2docker
Handle requirements.txt with `--pre` lines
This is a global flag which our inspection of requirements.txt files should ignore as it doesn't imply a local reference.pull/943/head
rodzic
cb3da62645
commit
6d2b129ed8
|
@ -469,6 +469,10 @@ def is_local_pip_requirement(line):
|
|||
if line.startswith(("--requirement", "--constraint")):
|
||||
# as above but flags are spelt out
|
||||
return True
|
||||
# the `--pre` flag is a global flag and should appear on a line by itself
|
||||
# we just care that this isn't a "local pip requirement"
|
||||
if line.startswith("--pre"):
|
||||
return False
|
||||
# strip off things like `--editable=`. Long form arguments require a =
|
||||
if line.startswith("--"):
|
||||
line = line.split("=", 1)[1]
|
||||
|
|
|
@ -146,6 +146,8 @@ def test_open_guess_encoding():
|
|||
("git+https://github.com/jupyterhub/repo2docker", False),
|
||||
("numpy", False),
|
||||
("# -e .", False),
|
||||
("--pre", False),
|
||||
("--pre pandas", False),
|
||||
],
|
||||
)
|
||||
def test_local_pip_requirement(req, is_local):
|
||||
|
|
Ładowanie…
Reference in New Issue