poise-python 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7500de072f7a8087c804a127c870a8c6b16b5aca
4
- data.tar.gz: d600e7a8144e251e8d2faa81bb8da5d1a58dcdad
3
+ metadata.gz: 9f304a2454721479e3c38acad468e98a2774757e
4
+ data.tar.gz: b232e65292bf44a165365aff618bf43eba398fcb
5
5
  SHA512:
6
- metadata.gz: d0673eb2b7dfe1d1b3e946edb8de5d8ff4c8a7253ce7499f608e8f6321698bba79c21b9d66b8df3706f2855d71225ef8c3278bda434dbad5e5d2b9d17869bf73
7
- data.tar.gz: b995f972baacd4f6482cae93ec8405194a7e1ad9584b7df66bab06066aa2df5a54e9ba270b2778c62c0a7df3d88336efbf2924d51400af8cb7af9e4bd5559136
6
+ metadata.gz: 78e693a8d1fdb7d0928ffc6946fbcc4c229bddc9b492999cc4067ae6f8ae7f51a77197a1863567a02056429864806febf39d7914f75b4ce6371b6d6710c59c82
7
+ data.tar.gz: 73957a301bf9c69bde856b5afedc5f7628a0d31e8d3c4166d9e68bd210293c0d4ad557eba770a955f8671aef69dbd8feddc6acbac65be9574f349d023df4c818
@@ -1,5 +1,9 @@
1
1
  # Poise-Python Changelog
2
2
 
3
+ ## v1.5.1
4
+
5
+ * Fix handling of packages with underscores in the name.
6
+
3
7
  ## v1.5.0
4
8
 
5
9
  * Support new SCL structure and packages.
data/Gemfile CHANGED
@@ -31,5 +31,5 @@ dev_gem 'halite'
31
31
  dev_gem 'poise'
32
32
  dev_gem 'poise-archive'
33
33
  dev_gem 'poise-boiler'
34
- dev_gem 'poise-languages', github: 'poise/poise-languages'
34
+ dev_gem 'poise-languages'
35
35
  dev_gem 'poise-profiler'
@@ -188,13 +188,13 @@ EOH
188
188
  @candidate_version = []
189
189
  versions = []
190
190
  [resource.package_name].flatten.each do |name|
191
- ver = version_data[parse_package_name(name).downcase]
191
+ ver = version_data[parse_package_name(name)]
192
192
  versions << ver[:current]
193
193
  @candidate_version << ver[:candidate]
194
194
  end
195
195
  resource.version(versions)
196
196
  else
197
- ver = version_data[parse_package_name(resource.package_name).downcase]
197
+ ver = version_data[parse_package_name(resource.package_name)]
198
198
  resource.version(ver[:current])
199
199
  @candidate_version = ver[:candidate]
200
200
  end
@@ -316,7 +316,7 @@ EOH
316
316
  # Example of a line:
317
317
  # boto (2.25.0)
318
318
  if md = line.match(/^(\S+)\s+\(([^\s,]+).*\)$/i)
319
- memo[md[1].downcase] = md[2]
319
+ memo[parse_package_name(md[1])] = md[2]
320
320
  else
321
321
  Chef::Log.debug("[#{new_resource}] Unparsable line in pip list: #{line}")
322
322
  end
@@ -340,7 +340,7 @@ EOH
340
340
  $1
341
341
  else
342
342
  raw_name
343
- end
343
+ end.downcase.gsub(/_/, '-')
344
344
  end
345
345
 
346
346
  end
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoisePython
19
- VERSION = '1.5.0'
19
+ VERSION = '1.5.1'
20
20
  end
@@ -21,5 +21,5 @@ gem 'halite', github: 'poise/halite'
21
21
  gem 'poise', github: 'poise/poise'
22
22
  gem 'poise-archive', github: 'poise/poise-archive'
23
23
  gem 'poise-boiler', github: 'poise/poise-boiler'
24
- # gem 'poise-languages', github: 'poise/poise-languages'
24
+ gem 'poise-languages', github: 'poise/poise-languages'
25
25
  gem 'poise-profiler', github: 'poise/poise-profiler'
@@ -97,6 +97,17 @@ describe PoisePython::Resources::PythonPackage do
97
97
  it { expect(candidate_version).to eq '1.0.0' }
98
98
  end # /context with a package with extras
99
99
 
100
+ context 'with a package with underscores' do
101
+ let(:package_name) { 'cx_foo' }
102
+ before do
103
+ stub_cmd(%w{-m pip.__main__ list}, stdout: '')
104
+ stub_cmd(%w{- cx-foo}, input: kind_of(String), stdout: '{"cx-foo":"1.0.0"}')
105
+ end
106
+
107
+ its(:version) { is_expected.to be nil }
108
+ it { expect(candidate_version).to eq '1.0.0' }
109
+ end # /context with a package with underscores
110
+
100
111
  context 'with options' do
101
112
  let(:package_name) { 'foo' }
102
113
  before do
@@ -189,6 +200,15 @@ describe PoisePython::Resources::PythonPackage do
189
200
  subject
190
201
  end
191
202
  end # /context with a package with extras
203
+
204
+ context 'with a package with underscores' do
205
+ let(:package_name) { 'cx_foo' }
206
+ let(:candidate_version) { '1.0.0' }
207
+ it do
208
+ stub_cmd(%w{-m pip.__main__ install cx_foo==1.0.0})
209
+ subject
210
+ end
211
+ end # /context with a package with underscores
192
212
  end # /describe action :install
193
213
 
194
214
  describe 'action :upgrade' do
@@ -250,8 +270,9 @@ eventlet (0.12.1)
250
270
  Fabric (1.9.1)
251
271
  fabric-rundeck (1.2, /Users/coderanger/src/bal/fabric-rundeck)
252
272
  flake8 (2.1.0.dev0)
273
+ cx-Freeze (4.3.4)
253
274
  EOH
254
- it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2', 'flake8' => '2.1.0.dev0'}) }
275
+ it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2', 'flake8' => '2.1.0.dev0', 'cx-freeze' => '4.3.4'}) }
255
276
  end # /context with standard content
256
277
 
257
278
  context 'with malformed content' do
@@ -260,8 +281,9 @@ eventlet (0.12.1)
260
281
  Fabric (1.9.1)
261
282
  fabric-rundeck (1.2, /Users/coderanger/src/bal/fabric-rundeck)
262
283
  flake 8 (2.1.0.dev0)
284
+ cx_Freeze (4.3.4)
263
285
  EOH
264
- it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2'}) }
286
+ it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2', 'cx-freeze' => '4.3.4'}) }
265
287
  end # /context with malformed content
266
288
  end # /describe #parse_pip_list
267
289
  end # /describe PoisePython::Resources::PythonPackage::Provider
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-python
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef