jolt 0.9.342__py3-none-any.whl → 0.9.429__py3-none-any.whl

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.
Files changed (158) hide show
  1. jolt/__init__.py +47 -0
  2. jolt/cache.py +358 -159
  3. jolt/cli.py +71 -104
  4. jolt/config.py +14 -26
  5. jolt/filesystem.py +2 -2
  6. jolt/graph.py +56 -28
  7. jolt/influence.py +67 -2
  8. jolt/loader.py +150 -186
  9. jolt/log.py +12 -2
  10. jolt/manifest.py +0 -46
  11. jolt/options.py +35 -12
  12. jolt/pkgs/abseil.py +42 -0
  13. jolt/pkgs/asio.py +25 -0
  14. jolt/pkgs/autoconf.py +41 -0
  15. jolt/pkgs/automake.py +41 -0
  16. jolt/pkgs/b2.py +31 -0
  17. jolt/pkgs/boost.py +111 -0
  18. jolt/pkgs/boringssl.py +32 -0
  19. jolt/pkgs/busybox.py +39 -0
  20. jolt/pkgs/bzip2.py +43 -0
  21. jolt/pkgs/cares.py +29 -0
  22. jolt/pkgs/catch2.py +36 -0
  23. jolt/pkgs/cbindgen.py +17 -0
  24. jolt/pkgs/cista.py +19 -0
  25. jolt/pkgs/clang.py +44 -0
  26. jolt/pkgs/cli11.py +23 -0
  27. jolt/pkgs/cmake.py +48 -0
  28. jolt/pkgs/cpython.py +196 -0
  29. jolt/pkgs/crun.py +29 -0
  30. jolt/pkgs/curl.py +38 -0
  31. jolt/pkgs/dbus.py +18 -0
  32. jolt/pkgs/double_conversion.py +24 -0
  33. jolt/pkgs/fastfloat.py +21 -0
  34. jolt/pkgs/ffmpeg.py +28 -0
  35. jolt/pkgs/flatbuffers.py +29 -0
  36. jolt/pkgs/fmt.py +27 -0
  37. jolt/pkgs/fstree.py +20 -0
  38. jolt/pkgs/gflags.py +18 -0
  39. jolt/pkgs/glib.py +18 -0
  40. jolt/pkgs/glog.py +25 -0
  41. jolt/pkgs/glslang.py +21 -0
  42. jolt/pkgs/golang.py +16 -11
  43. jolt/pkgs/googlebenchmark.py +18 -0
  44. jolt/pkgs/googletest.py +46 -0
  45. jolt/pkgs/gperf.py +15 -0
  46. jolt/pkgs/grpc.py +73 -0
  47. jolt/pkgs/hdf5.py +19 -0
  48. jolt/pkgs/help2man.py +14 -0
  49. jolt/pkgs/inja.py +28 -0
  50. jolt/pkgs/jsoncpp.py +31 -0
  51. jolt/pkgs/libarchive.py +43 -0
  52. jolt/pkgs/libcap.py +44 -0
  53. jolt/pkgs/libdrm.py +44 -0
  54. jolt/pkgs/libedit.py +42 -0
  55. jolt/pkgs/libevent.py +31 -0
  56. jolt/pkgs/libexpat.py +27 -0
  57. jolt/pkgs/libfastjson.py +21 -0
  58. jolt/pkgs/libffi.py +16 -0
  59. jolt/pkgs/libglvnd.py +30 -0
  60. jolt/pkgs/libogg.py +28 -0
  61. jolt/pkgs/libpciaccess.py +18 -0
  62. jolt/pkgs/libseccomp.py +21 -0
  63. jolt/pkgs/libtirpc.py +24 -0
  64. jolt/pkgs/libtool.py +42 -0
  65. jolt/pkgs/libunwind.py +35 -0
  66. jolt/pkgs/libva.py +18 -0
  67. jolt/pkgs/libvorbis.py +33 -0
  68. jolt/pkgs/libxml2.py +35 -0
  69. jolt/pkgs/libxslt.py +17 -0
  70. jolt/pkgs/libyajl.py +16 -0
  71. jolt/pkgs/llvm.py +81 -0
  72. jolt/pkgs/lua.py +54 -0
  73. jolt/pkgs/lz4.py +26 -0
  74. jolt/pkgs/m4.py +14 -0
  75. jolt/pkgs/make.py +17 -0
  76. jolt/pkgs/mesa.py +81 -0
  77. jolt/pkgs/meson.py +17 -0
  78. jolt/pkgs/mstch.py +28 -0
  79. jolt/pkgs/mysql.py +60 -0
  80. jolt/pkgs/nasm.py +49 -0
  81. jolt/pkgs/ncurses.py +30 -0
  82. jolt/pkgs/ng_log.py +25 -0
  83. jolt/pkgs/ninja.py +45 -0
  84. jolt/pkgs/nlohmann_json.py +25 -0
  85. jolt/pkgs/nodejs.py +19 -11
  86. jolt/pkgs/opencv.py +24 -0
  87. jolt/pkgs/openjdk.py +26 -0
  88. jolt/pkgs/openssl.py +103 -0
  89. jolt/pkgs/paho.py +76 -0
  90. jolt/pkgs/patchelf.py +16 -0
  91. jolt/pkgs/perl.py +42 -0
  92. jolt/pkgs/pkgconfig.py +64 -0
  93. jolt/pkgs/poco.py +39 -0
  94. jolt/pkgs/protobuf.py +77 -0
  95. jolt/pkgs/pugixml.py +27 -0
  96. jolt/pkgs/python.py +19 -0
  97. jolt/pkgs/qt.py +35 -0
  98. jolt/pkgs/rapidjson.py +26 -0
  99. jolt/pkgs/rapidyaml.py +28 -0
  100. jolt/pkgs/re2.py +30 -0
  101. jolt/pkgs/re2c.py +17 -0
  102. jolt/pkgs/readline.py +15 -0
  103. jolt/pkgs/rust.py +41 -0
  104. jolt/pkgs/sdl.py +28 -0
  105. jolt/pkgs/simdjson.py +27 -0
  106. jolt/pkgs/soci.py +46 -0
  107. jolt/pkgs/spdlog.py +29 -0
  108. jolt/pkgs/spirv_llvm.py +21 -0
  109. jolt/pkgs/spirv_tools.py +24 -0
  110. jolt/pkgs/sqlite.py +83 -0
  111. jolt/pkgs/ssl.py +12 -0
  112. jolt/pkgs/texinfo.py +15 -0
  113. jolt/pkgs/tomlplusplus.py +22 -0
  114. jolt/pkgs/wayland.py +26 -0
  115. jolt/pkgs/x11.py +58 -0
  116. jolt/pkgs/xerces_c.py +20 -0
  117. jolt/pkgs/xorg.py +360 -0
  118. jolt/pkgs/xz.py +29 -0
  119. jolt/pkgs/yamlcpp.py +30 -0
  120. jolt/pkgs/zeromq.py +47 -0
  121. jolt/pkgs/zlib.py +69 -0
  122. jolt/pkgs/zstd.py +33 -0
  123. jolt/plugins/autotools.py +66 -0
  124. jolt/plugins/cmake.py +74 -6
  125. jolt/plugins/conan.py +238 -0
  126. jolt/plugins/cxxinfo.py +7 -0
  127. jolt/plugins/docker.py +3 -3
  128. jolt/plugins/environ.py +11 -0
  129. jolt/plugins/fetch.py +141 -0
  130. jolt/plugins/gdb.py +10 -6
  131. jolt/plugins/git.py +60 -11
  132. jolt/plugins/libtool.py +63 -0
  133. jolt/plugins/linux.py +990 -0
  134. jolt/plugins/meson.py +61 -0
  135. jolt/plugins/ninja-compdb.py +11 -7
  136. jolt/plugins/ninja.py +245 -26
  137. jolt/plugins/paths.py +11 -1
  138. jolt/plugins/pkgconfig.py +219 -0
  139. jolt/plugins/podman.py +15 -41
  140. jolt/plugins/python.py +137 -0
  141. jolt/plugins/rust.py +25 -0
  142. jolt/plugins/scheduler.py +18 -14
  143. jolt/plugins/selfdeploy/setup.py +2 -1
  144. jolt/plugins/selfdeploy.py +21 -30
  145. jolt/plugins/strings.py +19 -10
  146. jolt/scheduler.py +428 -138
  147. jolt/tasks.py +159 -7
  148. jolt/tools.py +105 -51
  149. jolt/utils.py +16 -1
  150. jolt/version.py +1 -1
  151. {jolt-0.9.342.dist-info → jolt-0.9.429.dist-info}/METADATA +64 -9
  152. jolt-0.9.429.dist-info/RECORD +207 -0
  153. {jolt-0.9.342.dist-info → jolt-0.9.429.dist-info}/WHEEL +1 -1
  154. jolt/plugins/debian.py +0 -338
  155. jolt/plugins/repo.py +0 -253
  156. jolt-0.9.342.dist-info/RECORD +0 -93
  157. {jolt-0.9.342.dist-info → jolt-0.9.429.dist-info}/entry_points.txt +0 -0
  158. {jolt-0.9.342.dist-info → jolt-0.9.429.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
+ import importlib_metadata
1
2
  import os
2
- import pkg_resources
3
3
 
4
4
  from jolt import config
5
5
  from jolt import filesystem as fs
@@ -12,12 +12,9 @@ from jolt.cache import ArtifactCache
12
12
  from jolt.error import raise_error_if
13
13
  from jolt.graph import GraphBuilder
14
14
  from jolt.loader import JoltLoader
15
- from jolt.manifest import JoltManifest
16
15
  from jolt.scheduler import JoltEnvironment
17
16
  from jolt.scheduler import LocalExecutor
18
17
  from jolt.scheduler import LocalExecutorFactory
19
- from jolt.scheduler import NetworkExecutorExtension
20
- from jolt.scheduler import NetworkExecutorExtensionFactory
21
18
  from jolt.tasks import Task, TaskRegistry
22
19
 
23
20
 
@@ -99,43 +96,37 @@ class Jolt(Task):
99
96
  artifact.collect(fs.path.basename(e))
100
97
 
101
98
 
102
- class SelfDeployExtension(NetworkExecutorExtension):
103
- @utils.cached.instance
104
- def get_parameters(self, _):
105
- client = get_client()
106
- params = {}
107
- if client.identity:
108
- params["jolt_identity"] = client.identity
109
- if client.url:
110
- params["jolt_url"] = client.url
111
- return params
112
-
113
-
114
- @NetworkExecutorExtensionFactory.Register
115
- class SelfDeployExtensionFactory(NetworkExecutorExtensionFactory):
116
- def create(self):
117
- return SelfDeployExtension()
118
-
119
-
120
99
  @utils.cached.method
121
100
  def get_dependencies(packages=None):
122
101
  reqs = packages or ["jolt"]
123
102
  pkgs = {}
103
+ skip = set()
124
104
 
125
105
  while reqs:
126
106
  req = reqs.pop()
127
107
 
128
- dist = pkg_resources.working_set.by_key.get(req)
108
+ try:
109
+ dist = importlib_metadata.distribution(req)
110
+ except (ImportError, importlib_metadata.PackageNotFoundError):
111
+ dist = None
112
+ except Exception:
113
+ dist = None
129
114
  if dist is None:
130
- log.debug("[SelfDeploy] Dependency not found: {}", req)
131
- pkgs[req] = req
115
+ skip.add(req)
132
116
  continue
133
117
 
134
- for dep in dist.requires():
135
- if dep.name not in pkgs:
136
- reqs.append(dep.name)
118
+ for dep in dist.requires or []:
119
+ dep = dep.split(" ", 1)[0].strip()
120
+ dep = dep.split("[", 1)[0].strip()
121
+ dep = dep.split(";", 1)[0].strip()
122
+ dep = dep.split(">", 1)[0].strip()
123
+ dep = dep.split("=", 1)[0].strip()
124
+ dep = dep.split("<", 1)[0].strip()
125
+ dep = dep.split("!", 1)[0].strip()
126
+ if dep not in pkgs and dep not in skip:
127
+ reqs.append(dep)
137
128
 
138
- pkgs[req] = f"{dist.project_name}=={dist.version}"
129
+ pkgs[req] = f"{dist.name}=={dist.version}"
139
130
 
140
131
  try:
141
132
  del pkgs["jolt"]
@@ -157,7 +148,7 @@ def publish_artifact():
157
148
  registry.add_task_class(Jolt)
158
149
  acache = ArtifactCache.get()
159
150
  env = JoltEnvironment(cache=acache, queue=None)
160
- gb = GraphBuilder(registry, acache, JoltManifest())
151
+ gb = GraphBuilder(registry, acache)
161
152
  dag = gb.build(["jolt"])
162
153
  task = dag.select(lambda graph, task: True)
163
154
  assert len(task) == 1, "Too many selfdeploy tasks found"
jolt/plugins/strings.py CHANGED
@@ -2,23 +2,34 @@ from jolt.cache import ArtifactAttributeSetProvider
2
2
 
3
3
 
4
4
  class StringVariableSet(object):
5
+ """
6
+ A set of string variables for an artifact.
7
+
8
+ Example:
9
+
10
+ .. code-block:: python
11
+
12
+ artifact.strings.foo = "bar"
13
+ print(artifact.strings.foo)
14
+
15
+ """
16
+
5
17
  def __init__(self, artifact):
6
18
  super(StringVariableSet, self).__setattr__("_attributes", {})
19
+ super(StringVariableSet, self).__setattr__("_artifact", artifact)
7
20
 
8
21
  def _get_attributes(self):
9
22
  return self._attributes
10
23
 
11
24
  def __getattr__(self, name):
12
25
  attributes = self._get_attributes()
13
- if name not in attributes:
14
- return None
15
- return attributes[name]
26
+ return attributes.get(name, None)
16
27
 
17
28
  def __setattr__(self, name, value):
18
29
  if not isinstance(value, str):
19
30
  raise ValueError(f"Value assigned to artifact.strings.{name} must be a string, got {type(value)}")
20
31
  attributes = self._get_attributes()
21
- attributes[name] = value
32
+ attributes[name] = self._artifact.tools.expand(value)
22
33
  return value
23
34
 
24
35
  def __dict__(self):
@@ -30,6 +41,10 @@ class StringVariableSet(object):
30
41
 
31
42
  @ArtifactAttributeSetProvider.Register
32
43
  class StringVariableSetProvider(ArtifactAttributeSetProvider):
44
+ """
45
+ A provider of string variable sets.
46
+ """
47
+
33
48
  def create(self, artifact):
34
49
  setattr(artifact, "strings", StringVariableSet(artifact))
35
50
 
@@ -46,9 +61,3 @@ class StringVariableSetProvider(ArtifactAttributeSetProvider):
46
61
 
47
62
  for key, value in artifact.strings.items():
48
63
  content["strings"][key] = str(value)
49
-
50
- def apply(self, task, artifact):
51
- pass
52
-
53
- def unapply(self, task, artifact):
54
- pass