Jira (PUP-10296) Add SemVerRange support to pip package provider

20 views
Skip to first unread message

Gabriel Nagy (JIRA)

unread,
Feb 18, 2020, 7:27:05 AM2/18/20
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / New Feature PUP-10296
Add SemVerRange support to pip package provider
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2020/02/18 4:26 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

Implement SemVerRange type support for the pip provider.

Sample manifest with a range passed for a package:

package { 'Flask':
  # this will be parsed as: >= 1.0.0 < 1.1.0
  ensure => SemVerRange('~> 1.0')
}
 
package { 'Flask':
  ensure => SemVerRange('>= 1')
}
 
package { 'Flask':
  ensure => SemVerRange('< 1')
}
 
package { 'Flask':
  # this is a valid range, but we should not support it in this provider
  ensure => SemVerRange('~> 0.5 || ~> 1.0')
}

This value should be handled inside the pip provider code, and should be munged into a valid string for the pip install command. We should also make sure we don't take additional actions if the range is already satisfied (i.e. puppet apply with a SemVerRange should be idempotent)

Sample code on how the ensure property can be treated inside the provider:

if @resource.should(:ensure).is_a?(SemanticPuppet::VersionRange)
  version = @resource.should(:ensure).ranges.first
 
  case version
  when SemanticPuppet::VersionRange::MinMaxRange
    # pip requires min/max ranges to be separated by a comma
    version.to_s.tr(' ', ',')
  else
    version.to_s
  end
end

Example pip install with a version range (note the double quotes):

pip install "Flask>=1.0.0,<1.1.0"

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Mihai Buzgau (JIRA)

unread,
Feb 18, 2020, 7:44:04 AM2/18/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Component/s: Types and Providers

Gabriel Nagy (JIRA)

unread,
Feb 18, 2020, 10:46:04 AM2/18/20
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:12:07 AM2/19/20
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:13:06 AM2/19/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-03-04

Gabriel Nagy (JIRA)

unread,
Feb 19, 2020, 7:58:03 AM2/19/20
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Feb 26, 2020, 4:48:06 AM2/26/20
to puppe...@googlegroups.com
Mihai Buzgau assigned an issue to Luchian Nemes
Change By: Mihai Buzgau
Assignee: Gabriel Nagy Luchian Nemes

Mihai Buzgau (Jira)

unread,
Mar 5, 2020, 3:54:03 AM3/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04 , NW - 2020-03-17
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Mar 18, 2020, 4:54:04 AM3/18/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04, NW - 2020-03-17 , NW - 2020-04-01

Gabriel Nagy (Jira)

unread,
Apr 23, 2020, 8:02:04 AM4/23/20
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
Fix Version/s: PUP 6.15.0

Claire Cadman (Jira)

unread,
Apr 27, 2020, 8:53:03 AM4/27/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages