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

Use context manager to restore environment variables in resolve() #1255

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Use context manager to restore environment variables in resolve() #1255

merged 1 commit into from
Dec 2, 2020

Conversation

jdufresne
Copy link
Member

In the event of an unexpected exception, the system's environment
variable PIP_EXISTS_ACTION should still be restored to its previous
state.

This context manager already exists in the upstream pip library. Can
reuse it to avoid duplication.

Unlike the previous implementation, if the PIP_EXISTS_ACTION environment
variable existed prior to executing pip-tools, that state will be
restored.

Contributor checklist
  • Provided the tests for the changes.
  • Gave a clear one-line description in the PR (that the maintainers can add to CHANGELOG.md on release).
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@jdufresne jdufresne added this to the 5.5.0 milestone Nov 29, 2020
Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

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

Nice! 👍

@atugushev atugushev added enhancement Improvements to functionality refactor Refactoring code labels Dec 2, 2020
In the event of an unexpected exception, the system's environment
variable PIP_EXISTS_ACTION should still be restored to its previous
state.

This context manager already exists in the upstream pip library. Can
reuse it to avoid duplication.

Unlike the previous implementation, if the PIP_EXISTS_ACTION environment
variable existed prior to executing pip-tools, that state will be
restored.
@jdufresne jdufresne merged commit fccb27a into jazzband:master Dec 2, 2020
@jdufresne jdufresne deleted the env-context-manager branch December 2, 2020 11:33
@atugushev atugushev added bug fix and removed enhancement Improvements to functionality labels Dec 30, 2020
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants