Skip to content

Conversation

matteius
Copy link
Member

The issue

This flag, which was never fully explained in the documentation, leads to a source of a lot of confusion and issue because the underlying concept is flawed. It cannot be used until a consistent lock file is generated with pipenv lock or pipenv install and then when applied it will bring in any new package from a new consistent lock phase which is not already defined in the Pipfile.lock thus often creating inconsistent and unexpected locks.

The fix

This was always a workaround to avoid managing the Pipfile specifiers and packages listed/pinned in the Pipfile, which is the inputs into the resolver for the new lock phase whenever modifying package requirements. Instead, users that do not want packages updated while upgrading other packages should be pinning those in the Pipfile so they can be used as proper inputs to the pip resolver.

How does this pull request fix your problem? Did you consider any alternatives? Why is this the best solution, in your opinion?

I have considered for a year now how to make --keep-outdated better, but the reality is it was a flawed idea that existed before the switch to using the pip resolver, and it no longer makes sense to keep around because it leads to confusion and support tickets that shouldn't exist.

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix.rst, .feature.rst, .behavior.rst, .doc.rst. .vendor.rst. or .trivial.rst (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@matteius matteius requested a review from oz123 December 19, 2022 20:44
state = ctx.ensure_object(State)
state.installstate.keep_outdated = value
if value:
click.echo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use click.secho.

click.echo(
click.style(
"Use of --keep-outdated has been deprecated for removal."
"The flag does not respect package resolver results and leads to inconsistent lock files. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer
"The flag --keep-outdated has been deprecated and marked for removal.
It does not respect ..."

Copy link
Contributor

@oz123 oz123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matteius please see comments. Small changes desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants