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.
MODIFY
repo2docker/utils.py
repo2docker/utils.py
@@ -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]

MODIFY
tests/unit/test_utils.py
tests/unit/test_utils.py
@@ -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):

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.