Skip to content

(PUP-10015) Add support for arbitrary equality to pip provider#7703

Closed
butlern wants to merge 1 commit intopuppetlabs:masterfrom
butlern:fix/master/pip_provider_arbitrary_equality_support
Closed

(PUP-10015) Add support for arbitrary equality to pip provider#7703
butlern wants to merge 1 commit intopuppetlabs:masterfrom
butlern:fix/master/pip_provider_arbitrary_equality_support

Conversation

@butlern
Copy link
Contributor

@butlern butlern commented Sep 9, 2019

Without this patch the pip provider doesn't correctly parse pip freeze
output specified with arbitrary equality.

https://www.python.org/dev/peps/pep-0440/#arbitrary-equality

This is manifest with triple === separating the package name from the
package version, e.g.

$ pip freeze | grep pytz
pytz===2012f

By not correctly parsing this output, puppet tries to continually
install this package on each run.

The patch updates the regex to handle arbitrary equality.

Without this patch the pip provider doesn't correctly parse pip freeze
output specified with arbitrary equality.

https://www.python.org/dev/peps/pep-0440/#arbitrary-equality

This is manifest with triple === separating the package name from the
package version, e.g.

$ pip freeze | grep pytz
pytz===2012f

By not correctly parsing this output, puppet tries to continually
install this package on each run.

The patch updates the regex to handle arbitrary equality.
@butlern butlern requested review from a team September 9, 2019 21:45
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@puppetcla
Copy link

CLA signed by all contributors.

Copy link
Contributor

@ciprianbadescu ciprianbadescu left a comment

Choose a reason for hiding this comment

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

LGTM!

@ciprianbadescu ciprianbadescu requested a review from a team September 10, 2019 12:52
@joshcooper
Copy link
Contributor

Verified pytz is only installed once with this change. Previously puppet would install it every time it ran:

root@lpnl99pdpf4ft3o:~/puppet# bundle exec puppet apply -e "package { 'pytz': ensure => '2012f', provider => pip }"
Notice: Compiled catalog for lpnl99pdpf4ft3o.delivery.puppetlabs.net in environment production in 0.32 seconds
Notice: /Stage[main]/Main/Package[pytz]/ensure: created
Notice: Applied catalog in 3.77 seconds
root@lpnl99pdpf4ft3o:~/puppet# bundle exec puppet apply -e "package { 'pytz': ensure => '2012f', provider => pip }"
Notice: Compiled catalog for lpnl99pdpf4ft3o.delivery.puppetlabs.net in environment production in 0.32 seconds
Notice: Applied catalog in 1.41 seconds
root@lpnl99pdpf4ft3o:~/puppet# bundle exec puppet resource package pytz --param provider
package { 'pytz':
  ensure   => '2012f',
  provider => 'pip',
}

@joshcooper joshcooper added the blocked PRs blocked on work external to the PR itself label Sep 11, 2019
@joshcooper
Copy link
Contributor

Waiting to merge until 6.9.0 tag is created.

@joshcooper joshcooper changed the base branch from master to 6.4.x September 11, 2019 21:57
@joshcooper joshcooper changed the base branch from 6.4.x to master September 11, 2019 21:58
@joshcooper
Copy link
Contributor

Thank you for your contribution @butlern! I retargeted this for 6.4.x, and opened a new PR #7713.

@joshcooper joshcooper closed this Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked PRs blocked on work external to the PR itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants