Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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)