Example #1
0
def relative_paths():
    relative_leaders = (".", "..")
    separators = [
        to_text(sep) for sep in (os.sep, os.path.sep, os.path.altsep) if sep is not None
    ]
    return st.builds(
        relative_path,
        leading_dots=st.sampled_from(relative_leaders),
        separator=st.sampled_from(separators),
        dest=legal_path_chars(),
    )
Example #2
0
def test_keep_outdated_keeps_markers_not_removed(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        c = p.pipenv("install six click")
        assert c.ok
        lockfile = Path(p.lockfile_path)
        lockfile_content = lockfile.read_text()
        lockfile_json = json.loads(lockfile_content)
        assert "six" in lockfile_json["default"]
        lockfile_json["default"]["six"]["markers"] = "python_version >= '2.7'"
        lockfile.write_text(to_text(json.dumps(lockfile_json)))
        c = p.pipenv("lock --keep-outdated")
        assert c.ok
        assert p.lockfile["default"]["six"].get("markers", "") == "python_version >= '2.7'"
Example #3
0
def _requirement_as_line(requirement, include_hashes):
    line = to_text(requirement.as_line(include_hashes=include_hashes))
    return line