pycall 0.1.0.alpha.20170311 → 0.1.0.alpha.20170317

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0fa9f2771f8c95a9d13d448e0369e9b7e9480f6
4
- data.tar.gz: 4995b342604508cb01faadde8d6c90f35a402783
3
+ metadata.gz: 82eaa5c280e2f8206627b19e57cc630938807c4d
4
+ data.tar.gz: 7d78f624374cf5ef65d7a292f96de5ba3fc218f0
5
5
  SHA512:
6
- metadata.gz: 107f426b7baa846f92dee733e1e2fa797f8a8fe9690e6690257254d3bf9e0d996f83b733c5d31c71136880fa9d1872c22bc4e8d3290319ff19b21c8844a63ccf
7
- data.tar.gz: 31a974c8e52b665b61b73078edb3f366f8ff736d1828762f6ca4f1ad103e42208362a2a202b9aaa7d30c8189fcd00d6a3d08a12c24830e51da480a98e35ad745
6
+ metadata.gz: c4b46544cebf53e321c1436d20fd523d3c58a7f1d54fa64dcc92b9eb76657bd808ac1aece7be3be8bfbaa8a418b4d4686b761eb93cfacc499b9960ff97a00ab1
7
+ data.tar.gz: 8667a9bd1f58598db6de020c4739f14619ce4fa694d71ef50435ccaedc725536c2013b8682c205ff4fe316d51a4027d5b0487c57575457310e30db09aac32733
@@ -41,7 +41,7 @@ module PyCall
41
41
  executable = python_config[:executable]
42
42
  libpaths = [ python_config[:LIBDIR] ]
43
43
  if FFI::Platform.windows?
44
- libpaths << dirname(executable)
44
+ libpaths << File.dirname(executable)
45
45
  else
46
46
  libpaths << File.expand_path('../../lib', executable)
47
47
  end
@@ -73,10 +73,16 @@ module PyCall
73
73
  libsuffix = FFI::Platform::LIBSUFFIX
74
74
  libs.each do |lib|
75
75
  libpaths.each do |libpath|
76
- libpath_lib = File.join(libpath, lib)
76
+ next unless libpath
77
+ # NOTE: File.join doesn't use File::ALT_SEPARATOR
78
+ libpath_lib = [libpath, lib].join(File::ALT_SEPARATOR || File::SEPARATOR)
77
79
  if File.file?("#{libpath_lib}.#{libsuffix}")
78
- libs = ffi_lib("#{libpath_lib}.#{libsuffix}")
79
- return libs.first
80
+ begin
81
+ libs = ffi_lib("#{libpath_lib}.#{libsuffix}")
82
+ return libs.first
83
+ rescue LoadError
84
+ # skip load error
85
+ end
80
86
  end
81
87
  end
82
88
  end
@@ -88,7 +94,7 @@ module PyCall
88
94
  {}.tap do |config|
89
95
  io.each_line do |line|
90
96
  key, value = line.chomp.split(': ', 2)
91
- config[key.to_sym] = value
97
+ config[key.to_sym] = value if value != 'None'
92
98
  end
93
99
  end
94
100
  end
@@ -24,7 +24,7 @@ module PyCall
24
24
 
25
25
  def to_s
26
26
  "#{type}: #{value}".tap do |msg|
27
- unless traceback&.null?
27
+ unless traceback.nil? || traceback.null?
28
28
  if (o = PyCall.format_traceback(traceback))
29
29
  msg.concat("\n", *o)
30
30
  end
@@ -1,6 +1,6 @@
1
1
  from distutils.sysconfig import get_config_var
2
2
  import sys
3
3
  for var in ('executable', 'exec_prefix', 'prefix'):
4
- print(var + ': ' + getattr(sys, var))
4
+ print(var + ': ' + str(getattr(sys, var)))
5
5
  for var in ('VERSION', 'LIBRARY', 'LDLIBRARY', 'LIBDIR', 'PYTHONFRAMEWORKPREFIX'):
6
- print(var + ': ' + get_config_var(var))
6
+ print(var + ': ' + str(get_config_var(var)))
@@ -1,3 +1,3 @@
1
1
  module PyCall
2
- VERSION = "0.1.0.alpha.20170311"
2
+ VERSION = "0.1.0.alpha.20170317"
3
3
  end
data/pycall.gemspec CHANGED
@@ -15,8 +15,15 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
18
+ case f
19
+ when %r{^Guardfile}, # NOTE: Skip symlink for Windows
20
+ %r{^(test|spec|features)/}
21
+ true
22
+ else
23
+ false
24
+ end
19
25
  end
26
+
20
27
  spec.bindir = "exe"
21
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
29
  spec.require_paths = ["lib"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pycall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.20170311
4
+ version: 0.1.0.alpha.20170317
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-11 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -77,7 +77,6 @@ files:
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
79
  - Gemfile
80
- - Guardfile
81
80
  - LICENSE.txt
82
81
  - README.md
83
82
  - Rakefile
data/Guardfile DELETED
@@ -1 +0,0 @@
1
- ./config/Guardfile