Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print -e option and path for editable package when using pipenv requirements #5071

Merged
merged 5 commits into from
Apr 23, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,21 +759,25 @@ def requirements(state, dev=False, dev_only=False, hash=False):
lockfile = state.project.lockfile_content
for i, package_index in enumerate(lockfile["_meta"]["sources"]):
prefix = "-i" if i == 0 else "--extra-index-url"
echo(crayons.normal(" ".join([prefix, package_index["url"]])))
echo(" ".join([prefix, package_index["url"]]))
if not dev_only:
for req_name, value in lockfile["default"].items():
if hash:
if value.get("editable", False):
echo("-e " + value["path"])
elif hash:
hashes = [f" \\\n --hash={h}" for h in value.get("hashes", [])]
echo("".join([req_name, value["version"], *hashes]))
else:
hashes = []
echo(crayons.normal("".join([req_name, value["version"], *hashes])))
echo("".join([req_name, value["version"]]))
if dev or dev_only:
for req_name, value in lockfile["develop"].items():
if hash:
if value.get("editable", False):
echo("-e " + value["path"])
elif hash:
hashes = [f" \\\n --hash={h}" for h in value.get("hashes", [])]
echo("".join([req_name, value["version"], *hashes]))
else:
hashes = []
echo(crayons.normal("".join([req_name, value["version"], *hashes])))
echo("".join([req_name, value["version"]]))
sys.exit(0)


Expand Down