Skip to content

Commit

Permalink
Merge pull request #5625 from pypa/issue-5624
Browse files Browse the repository at this point in the history
Fix dev flag support in update/upgrade.
  • Loading branch information
matteius committed Mar 13, 2023
2 parents b3abbf7 + f888e5c commit 8c88666
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions pipenv/cli/command.py
Expand Up @@ -282,6 +282,7 @@ def upgrade(state, **kwargs):
packages=state.installstate.packages,
editable_packages=state.installstate.editables,
categories=state.installstate.categories,
dev=state.installstate.dev,
system=state.system,
lock_only=state.installstate.lock_only,
)
Expand Down
13 changes: 10 additions & 3 deletions pipenv/routines/update.py
Expand Up @@ -7,6 +7,7 @@
convert_deps_to_pip,
get_pipfile_category_using_lockfile_section,
is_star,
pep423_name,
)
from pipenv.utils.project import ensure_project
from pipenv.utils.resolver import venv_resolve_deps
Expand Down Expand Up @@ -80,6 +81,7 @@ def do_update(
editable_packages=editable,
pypi_mirror=pypi_mirror,
categories=categories,
dev=dev,
lock_only=lock_only,
)

Expand All @@ -106,13 +108,16 @@ def upgrade(
editable_packages=None,
pypi_mirror=None,
categories=None,
dev=False,
lock_only=False,
):

lockfile = project._lockfile()
if not pre:
pre = project.settings.get("allow_prereleases")
if not categories:
if dev:
categories = ["develop"]
elif not categories:
categories = ["default"]

package_args = [p for p in packages] + [f"-e {pkg}" for pkg in editable_packages]
Expand All @@ -124,6 +129,7 @@ def upgrade(
section = {}
package = Requirement.from_line(package)
package_name, package_val = package.pipfile_entry
package_name = pep423_name(package_name)
requested_packages[package_name] = package
try:
if not is_star(section[package_name]) and is_star(package_val):
Expand Down Expand Up @@ -184,8 +190,9 @@ def upgrade(
)
# Mutate the existing lockfile with the upgrade data for the categories
for package_name, _ in upgrade_lock_data.items():
correct_package_lock = full_lock_resolution[package_name]
lockfile[category][package_name] = correct_package_lock
correct_package_lock = full_lock_resolution.get(package_name)
if correct_package_lock:
lockfile[category][package_name] = correct_package_lock

lockfile.update({"_meta": project.get_lockfile_meta()})
project.write_lockfile(lockfile)

0 comments on commit 8c88666

Please sign in to comment.