yamlscript 0.2.20__tar.gz → 0.2.22__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yamlscript
3
- Version: 0.2.20
3
+ Version: 0.2.22
4
4
  Summary: Program in YAML — Code is Data
5
5
  Home-page: https://github.com/ingydotnet/yamlscript
6
6
  Author: Ingy döt Net
@@ -16,7 +16,7 @@ object that the YAMLScript code evaluates to.
16
16
  # This value is automatically updated by 'make bump'.
17
17
  # The version number is used to find the correct shared library file.
18
18
  # We currently only support binding to an exact version of libys.
19
- yamlscript_version = '0.2.20'
19
+ yamlscript_version = '0.2.22'
20
20
 
21
21
  import os, sys
22
22
  import ctypes
@@ -30,39 +30,45 @@ assert sys.version_info >= (3, 6), \
30
30
  # Find the libys shared library file path:
31
31
  def find_libys_path():
32
32
  # We currently only support platforms that GraalVM supports.
33
- # And Windows is not yet implemented...
34
33
  # Confirm platform and determine file extension:
35
34
  if sys.platform == 'linux':
36
- so = 'so'
35
+ libys_name = \
36
+ "libys.so.%s" % yamlscript_version
37
37
  elif sys.platform == 'darwin':
38
- so = 'dylib'
38
+ libys_name = \
39
+ "libys.dylib.%s" % yamlscript_version
40
+ elif sys.platform == 'win32':
41
+ libys_name = 'libys.dll'
39
42
  else:
40
43
  raise Exception(
41
44
  "Unsupported platform '%s' for yamlscript." % sys.platform)
42
45
 
43
46
  # We currently bind to an exact version of libys.
44
- # eg 'libys.so.0.2.20'
45
- libys_name = \
46
- "libys.%s.%s" % (so, yamlscript_version)
47
-
47
+ # eg 'libys.so.0.2.22'
48
48
  # First look for the shared library bundled in platform wheels.
49
49
  bundled_path = \
50
50
  Path(__file__).resolve().parent / 'libys' / libys_name
51
51
  if bundled_path.is_file():
52
52
  return str(bundled_path)
53
53
 
54
- # Then use LD_LIBRARY_PATH to find libys shared library, or default
55
- # to '/usr/local/lib' (where it is installed by default):
56
- ld_library_path = os.environ.get('LD_LIBRARY_PATH')
57
- ld_library_paths = ld_library_path.split(':') if ld_library_path else []
58
- ld_library_paths.append('/usr/local/lib')
59
- ld_library_paths.append(os.environ.get('HOME') + '/.local/lib')
54
+ # Then use the platform library path plus common install locations.
55
+ if sys.platform == 'win32':
56
+ library_path = os.environ.get('PATH')
57
+ library_paths = library_path.split(os.pathsep) if library_path else []
58
+ else:
59
+ library_path = os.environ.get('LD_LIBRARY_PATH')
60
+ library_paths = library_path.split(os.pathsep) if library_path else []
61
+ library_paths.append('/usr/local/lib')
62
+
63
+ home = os.environ.get('HOME') or os.path.expanduser('~')
64
+ if home:
65
+ library_paths.append(os.path.join(home, '.local', 'lib'))
60
66
 
61
67
  libys_path = None
62
- for path in ld_library_paths:
63
- path = path + '/' + libys_name
64
- if os.path.isfile(path):
65
- libys_path = path
68
+ for path in library_paths:
69
+ full_path = os.path.join(path, libys_name)
70
+ if os.path.isfile(full_path):
71
+ libys_path = full_path
66
72
  break
67
73
 
68
74
  if not libys_path:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yamlscript
3
- Version: 0.2.20
3
+ Version: 0.2.22
4
4
  Summary: Program in YAML — Code is Data
5
5
  Home-page: https://github.com/ingydotnet/yamlscript
6
6
  Author: Ingy döt Net
@@ -1,7 +1,7 @@
1
1
  import pathlib
2
2
  from setuptools import setup
3
3
 
4
- version = '0.2.20'
4
+ version = '0.2.22'
5
5
 
6
6
  root = pathlib.Path(__file__).parent.resolve()
7
7
 
@@ -43,6 +43,7 @@ setup(
43
43
  'yamlscript': [
44
44
  'libys/libys.so.*',
45
45
  'libys/libys.dylib.*',
46
+ 'libys/libys.dll',
46
47
  ],
47
48
  },
48
49
  cmdclass = cmdclass,
File without changes
File without changes
File without changes
File without changes