Skip to content

Commit a1ffb1b

Browse files
authored
Merge pull request #9481 from cthorn42/maint/main/PE-39019_update_pip_provider_with_new_regex
(maint) Update pip provider regex
2 parents e65bc7d + 371e0f2 commit a1ffb1b

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

lib/puppet/provider/package/pip.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def available_versions_with_new_pip(command_version)
160160
command = resource_or_provider_command
161161
self.class.validate_command(command)
162162

163-
command_and_options = [self.class.quote(command), 'install', "#{@resource[:name]}==versionplease"]
163+
command_and_options = [self.class.quote(command), 'install', "#{@resource[:name]}==9!0dev0+x"]
164164
extra_arg = list_extra_flags(command_version)
165165
command_and_options << extra_arg if extra_arg
166166
command_and_options << install_options if @resource[:install_options]

spec/unit/provider/package/pip_spec.rb

+20-20
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@
281281
it "should use legacy-resolver argument" do
282282
p = StringIO.new(
283283
<<-EOS
284-
Collecting real-package==versionplease
285-
Could not find a version that satisfies the requirement real-package==versionplease (from versions: 1.1.3, 1.0, 1.9b1)
286-
No matching distribution found for real-package==versionplease
284+
Collecting real-package==9!0dev0+x
285+
Could not find a version that satisfies the requirement real-package==9!0dev0+x (from versions: 1.1.3, 1.0, 1.9b1)
286+
No matching distribution found for real-package==9!0dev0+x
287287
EOS
288288
)
289-
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==versionplease",
289+
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==9!0dev0+x",
290290
"--use-deprecated=legacy-resolver"]).and_yield(p).once
291291
@resource[:name] = "real_package"
292292
@provider.latest
@@ -300,12 +300,12 @@
300300
it "should not use legacy-resolver argument" do
301301
p = StringIO.new(
302302
<<-EOS
303-
Collecting real-package==versionplease
304-
Could not find a version that satisfies the requirement real-package==versionplease (from versions: 1.1.3, 1.0, 1.9b1)
305-
No matching distribution found for real-package==versionplease
303+
Collecting real-package==9!0dev0+x
304+
Could not find a version that satisfies the requirement real-package==9!0dev0+x (from versions: 1.1.3, 1.0, 1.9b1)
305+
No matching distribution found for real-package==9!0dev0+x
306306
EOS
307307
)
308-
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==versionplease"]).and_yield(p).once
308+
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==9!0dev0+x"]).and_yield(p).once
309309
@resource[:name] = "real_package"
310310
@provider.latest
311311
end
@@ -314,12 +314,12 @@
314314
it "should find a version number for real_package" do
315315
p = StringIO.new(
316316
<<-EOS
317-
Collecting real-package==versionplease
318-
Could not find a version that satisfies the requirement real-package==versionplease (from versions: 1.1.3, 1.2, 1.9b1)
319-
No matching distribution found for real-package==versionplease
317+
Collecting real-package==9!0dev0+x
318+
Could not find a version that satisfies the requirement real-package==9!0dev0+x (from versions: 1.1.3, 1.2, 1.9b1)
319+
No matching distribution found for real-package==9!0dev0+x
320320
EOS
321321
)
322-
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==versionplease"]).and_yield(p).once
322+
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==9!0dev0+x"]).and_yield(p).once
323323
@resource[:name] = "real_package"
324324
latest = @provider.latest
325325
expect(latest).to eq('1.9b1')
@@ -328,25 +328,25 @@
328328
it "should not find a version number for fake_package" do
329329
p = StringIO.new(
330330
<<-EOS
331-
Collecting fake-package==versionplease
332-
Could not find a version that satisfies the requirement fake-package==versionplease (from versions: )
333-
No matching distribution found for fake-package==versionplease
331+
Collecting fake-package==9!0dev0+x
332+
Could not find a version that satisfies the requirement fake-package==9!0dev0+x (from versions: )
333+
No matching distribution found for fake-package==9!0dev0+x
334334
EOS
335335
)
336-
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "fake_package==versionplease"]).and_yield(p).once
336+
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "fake_package==9!0dev0+x"]).and_yield(p).once
337337
@resource[:name] = "fake_package"
338338
expect(@provider.latest).to eq(nil)
339339
end
340340

341341
it "should handle out-of-order version numbers for real_package" do
342342
p = StringIO.new(
343343
<<-EOS
344-
Collecting real-package==versionplease
345-
Could not find a version that satisfies the requirement real-package==versionplease (from versions: 1.11, 13.0.3, 1.6, 1!1.2.rev33+123456, 1.9, 1.3.2, 14.0.1, 12.0.7, 13.0.3, 1.7.2, 1.8.4, 1.2+123abc456, 1.6.1, 0.9.2, 1.3, 1.8.3, 12.1.1, 1.1, 1.11.6, 1.2+123456, 1.4.8, 1.6.3, 1!1.0b2.post345.dev456, 1.10.1, 14.0.2, 1.11.3, 14.0.3, 1.4rc1, 1.0b2.post345.dev456, 0.8.4, 1.0, 1!1.0.post456, 12.0.5, 14.0.6, 1.11.5, 1.0rc2, 1.7.1.1, 1.11.4, 13.0.1, 13.1.2, 1.3.3, 0.8.2, 14.0.0, 12.0, 1.8, 1.3.4, 12.0, 1.2, 12.0.6, 0.9.1, 13.1.1, 2!2.3.4.alpha5.rev6.dev7+abc89, 14.0.5, 15.0.2, 15.0.0, 1.4.5, 1.4.3, 13.1.1, 1.11.2, 13.1.2, 1.2+abc123def, 1.3.1, 13.1.0, 12.0.2, 1.11.1, 12.0.1, 12.1.0, 0.9, 1.4.4, 1.2+abc123, 13.0.0, 1.4.9, 1.1.dev1, 12.1.0, 1.7.1, 1.4.2, 14.0.5, 0.8.1, 1.4.6, 0.8.3, 1.11.3, 1.5.1, 1.4.7, 13.0.2, 12.0.7, 1!13.0, 0!13.0, 1.9.1, 1.0.post456.dev34, 1.8.2, 14.0.1, 14.0.0, 1.2.rev33+123456, 14.0.4, 1.6.2, 15.0.1, 13.1.0, 0.8, 1.2+1234.abc, 1.7, 15.0.2, 12.0.5, 13.0.1, 1.8.1, 1.11.6, 15.0.1, 12.0.4, 1.2+123abc, 12.1.1, 13.0.2, 1.11.4, 1.10, 1.2.r32+123456, 14.0.4, 14.0.6, 1.4.1, 1.4, 1.5.2, 12.0.2, 12.0.1, 14.0.3, 14.0.2, 1.11.1, 1.7.1.2, 15.0.0, 12.0.4, 1.6.4, 1.11.2, 1.5, 0.1, 0.10, 0.10.1, 0.10.1.0.1, 1.0.dev456, 1.0a1, 1.0a2.dev456, 1.0a12.dev456, 1.0a12, 1.0b1.dev456, 1.0b2, 1.0b2.post345, 1.0b2-346, 1.0c1.dev456, 1.0c1, 1.0c3, 1.0, 1.0.post456, 1.2+abc, 1!1.0, 1!1.0.post456.dev34)
346-
No distributions matching the version for real-package==versionplease
344+
Collecting real-package==9!0dev0+x
345+
Could not find a version that satisfies the requirement real-package==9!0dev0+x (from versions: 1.11, 13.0.3, 1.6, 1!1.2.rev33+123456, 1.9, 1.3.2, 14.0.1, 12.0.7, 13.0.3, 1.7.2, 1.8.4, 1.2+123abc456, 1.6.1, 0.9.2, 1.3, 1.8.3, 12.1.1, 1.1, 1.11.6, 1.2+123456, 1.4.8, 1.6.3, 1!1.0b2.post345.dev456, 1.10.1, 14.0.2, 1.11.3, 14.0.3, 1.4rc1, 1.0b2.post345.dev456, 0.8.4, 1.0, 1!1.0.post456, 12.0.5, 14.0.6, 1.11.5, 1.0rc2, 1.7.1.1, 1.11.4, 13.0.1, 13.1.2, 1.3.3, 0.8.2, 14.0.0, 12.0, 1.8, 1.3.4, 12.0, 1.2, 12.0.6, 0.9.1, 13.1.1, 2!2.3.4.alpha5.rev6.dev7+abc89, 14.0.5, 15.0.2, 15.0.0, 1.4.5, 1.4.3, 13.1.1, 1.11.2, 13.1.2, 1.2+abc123def, 1.3.1, 13.1.0, 12.0.2, 1.11.1, 12.0.1, 12.1.0, 0.9, 1.4.4, 1.2+abc123, 13.0.0, 1.4.9, 1.1.dev1, 12.1.0, 1.7.1, 1.4.2, 14.0.5, 0.8.1, 1.4.6, 0.8.3, 1.11.3, 1.5.1, 1.4.7, 13.0.2, 12.0.7, 1!13.0, 0!13.0, 1.9.1, 1.0.post456.dev34, 1.8.2, 14.0.1, 14.0.0, 1.2.rev33+123456, 14.0.4, 1.6.2, 15.0.1, 13.1.0, 0.8, 1.2+1234.abc, 1.7, 15.0.2, 12.0.5, 13.0.1, 1.8.1, 1.11.6, 15.0.1, 12.0.4, 1.2+123abc, 12.1.1, 13.0.2, 1.11.4, 1.10, 1.2.r32+123456, 14.0.4, 14.0.6, 1.4.1, 1.4, 1.5.2, 12.0.2, 12.0.1, 14.0.3, 14.0.2, 1.11.1, 1.7.1.2, 15.0.0, 12.0.4, 1.6.4, 1.11.2, 1.5, 0.1, 0.10, 0.10.1, 0.10.1.0.1, 1.0.dev456, 1.0a1, 1.0a2.dev456, 1.0a12.dev456, 1.0a12, 1.0b1.dev456, 1.0b2, 1.0b2.post345, 1.0b2-346, 1.0c1.dev456, 1.0c1, 1.0c3, 1.0, 1.0.post456, 1.2+abc, 1!1.0, 1!1.0.post456.dev34)
346+
No distributions matching the version for real-package==9!0dev0+x
347347
EOS
348348
)
349-
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==versionplease"]).and_yield(p).once
349+
expect(Puppet::Util::Execution).to receive(:execpipe).with(["/fake/bin/pip", "install", "real_package==9!0dev0+x"]).and_yield(p).once
350350
@resource[:name] = "real_package"
351351
expect(@provider.latest).to eq('2!2.3.4.alpha5.rev6.dev7+abc89')
352352
end

0 commit comments

Comments
 (0)