jolt 0.9.440__py3-none-any.whl → 0.9.445__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.
- jolt/graph.py +3 -3
- jolt/influence.py +8 -9
- jolt/loader.py +1 -1
- jolt/pkgs/abseil.py +14 -10
- jolt/pkgs/blake3.py +15 -0
- jolt/pkgs/boost.py +13 -9
- jolt/pkgs/boringssl.py +2 -8
- jolt/pkgs/brotli.py +20 -0
- jolt/pkgs/bzip2.py +1 -3
- jolt/pkgs/cares.py +2 -7
- jolt/pkgs/catch2.py +2 -7
- jolt/pkgs/curl.py +10 -4
- jolt/pkgs/double_conversion.py +2 -7
- jolt/pkgs/flatbuffers.py +2 -7
- jolt/pkgs/fmt.py +2 -7
- jolt/pkgs/googletest.py +2 -8
- jolt/pkgs/grpc.py +2 -3
- jolt/pkgs/jsoncpp.py +2 -3
- jolt/pkgs/libarchive.py +2 -7
- jolt/pkgs/libcap.py +11 -3
- jolt/pkgs/libedit.py +2 -4
- jolt/pkgs/libevent.py +10 -2
- jolt/pkgs/libexpat.py +2 -7
- jolt/pkgs/libogg.py +2 -7
- jolt/pkgs/libtirpc.py +2 -7
- jolt/pkgs/libvorbis.py +2 -9
- jolt/pkgs/libxml2.py +2 -3
- jolt/pkgs/lz4.py +2 -7
- jolt/pkgs/mstch.py +2 -7
- jolt/pkgs/mysql.py +2 -7
- jolt/pkgs/ng_log.py +2 -7
- jolt/pkgs/openssl.py +14 -11
- jolt/pkgs/paho.py +4 -5
- jolt/pkgs/poco.py +13 -10
- jolt/pkgs/protobuf.py +2 -3
- jolt/pkgs/pugixml.py +2 -7
- jolt/pkgs/rapidjson.py +2 -5
- jolt/pkgs/rapidyaml.py +2 -8
- jolt/pkgs/re2.py +2 -7
- jolt/pkgs/sdl.py +2 -3
- jolt/pkgs/simdjson.py +2 -7
- jolt/pkgs/soci.py +2 -3
- jolt/pkgs/spdlog.py +2 -7
- jolt/pkgs/sqlite.py +3 -11
- jolt/pkgs/xz.py +2 -7
- jolt/pkgs/yamlcpp.py +2 -7
- jolt/pkgs/zeromq.py +3 -11
- jolt/pkgs/zlib.py +9 -11
- jolt/pkgs/zstd.py +2 -3
- jolt/plugins/allure.py +6 -6
- jolt/plugins/cmake.py +2 -1
- jolt/plugins/cxxinfo.py +32 -0
- jolt/plugins/ninja.py +2 -2
- jolt/plugins/selfdeploy/setup.py +1 -0
- jolt/tasks.py +12 -12
- jolt/tools.py +15 -10
- jolt/utils.py +23 -9
- jolt/version.py +1 -1
- {jolt-0.9.440.dist-info → jolt-0.9.445.dist-info}/METADATA +2 -1
- {jolt-0.9.440.dist-info → jolt-0.9.445.dist-info}/RECORD +63 -61
- {jolt-0.9.440.dist-info → jolt-0.9.445.dist-info}/WHEEL +1 -1
- {jolt-0.9.440.dist-info → jolt-0.9.445.dist-info}/entry_points.txt +0 -0
- {jolt-0.9.440.dist-info → jolt-0.9.445.dist-info}/top_level.txt +0 -0
jolt/pkgs/yamlcpp.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from jolt import attributes, BooleanParameter, Parameter
|
|
2
2
|
from jolt.pkgs import cmake
|
|
3
|
-
from jolt.plugins import git, cmake, pkgconfig
|
|
3
|
+
from jolt.plugins import cxxinfo, git, cmake, pkgconfig
|
|
4
4
|
from jolt.tasks import TaskRegistry
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ from jolt.tasks import TaskRegistry
|
|
|
8
8
|
@attributes.system
|
|
9
9
|
@cmake.requires()
|
|
10
10
|
@cmake.use_ninja()
|
|
11
|
+
@cxxinfo.publish(libraries=["yaml-cpp"])
|
|
11
12
|
class YamlCPP(cmake.CMake):
|
|
12
13
|
name = "yaml-cpp"
|
|
13
14
|
version = Parameter("bbf8bdb", help="yaml-cpp version.")
|
|
@@ -20,11 +21,5 @@ class YamlCPP(cmake.CMake):
|
|
|
20
21
|
"YAML_BUILD_TOOLS=OFF",
|
|
21
22
|
]
|
|
22
23
|
|
|
23
|
-
def publish(self, artifact, tools):
|
|
24
|
-
super().publish(artifact, tools)
|
|
25
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
26
|
-
artifact.cxxinfo.libpaths.append("lib")
|
|
27
|
-
artifact.cxxinfo.libraries.append("yaml-cpp")
|
|
28
|
-
|
|
29
24
|
|
|
30
25
|
TaskRegistry.get().add_task_class(YamlCPP)
|
jolt/pkgs/zeromq.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from jolt import attributes, BooleanParameter, Parameter
|
|
2
2
|
from jolt.pkgs import openssl
|
|
3
|
-
from jolt.plugins import cmake, git
|
|
3
|
+
from jolt.plugins import cmake, cxxinfo, git
|
|
4
4
|
from jolt.tasks import TaskRegistry
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
@attributes.requires("requires_git")
|
|
8
8
|
@cmake.requires()
|
|
9
9
|
@cmake.use_ninja()
|
|
10
|
+
@cxxinfo.publish(libraries=["zmq"])
|
|
10
11
|
class Libzmq(cmake.CMake):
|
|
11
12
|
name = "libzmq"
|
|
12
13
|
version = Parameter("4.3.5", help="ZeroMQ version.")
|
|
@@ -19,17 +20,12 @@ class Libzmq(cmake.CMake):
|
|
|
19
20
|
"CMAKE_POLICY_VERSION_MINIMUM=3.5",
|
|
20
21
|
]
|
|
21
22
|
|
|
22
|
-
def publish(self, artifact, tools):
|
|
23
|
-
super().publish(artifact, tools)
|
|
24
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
25
|
-
artifact.cxxinfo.libpaths.append("lib")
|
|
26
|
-
artifact.cxxinfo.libraries.append("zmq")
|
|
27
|
-
|
|
28
23
|
|
|
29
24
|
@attributes.requires("requires_git")
|
|
30
25
|
@attributes.requires("requires_libzmq")
|
|
31
26
|
@cmake.requires()
|
|
32
27
|
@cmake.use_ninja()
|
|
28
|
+
@cxxinfo.publish()
|
|
33
29
|
class Cppzmq(cmake.CMake):
|
|
34
30
|
name = "cppzmq"
|
|
35
31
|
version = Parameter("4.11.0", help="cppzmq version.")
|
|
@@ -38,10 +34,6 @@ class Cppzmq(cmake.CMake):
|
|
|
38
34
|
srcdir = "{git[cppzmq]}"
|
|
39
35
|
options = ["CPPZMQ_BUILD_TESTS=OFF"]
|
|
40
36
|
|
|
41
|
-
def publish(self, artifact, tools):
|
|
42
|
-
super().publish(artifact, tools)
|
|
43
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
44
|
-
|
|
45
37
|
|
|
46
38
|
TaskRegistry.get().add_task_class(Libzmq)
|
|
47
39
|
TaskRegistry.get().add_task_class(Cppzmq)
|
jolt/pkgs/zlib.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from jolt import attributes, Alias, BooleanParameter, Parameter
|
|
2
2
|
from jolt.pkgs import cmake
|
|
3
|
-
from jolt.plugins import git, cmake
|
|
3
|
+
from jolt.plugins import cxxinfo, git, cmake
|
|
4
4
|
from jolt.tasks import TaskRegistry
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ from jolt.tasks import TaskRegistry
|
|
|
8
8
|
@attributes.system
|
|
9
9
|
@cmake.requires()
|
|
10
10
|
@cmake.use_ninja()
|
|
11
|
+
@cxxinfo.publish()
|
|
11
12
|
class Zlib(cmake.CMake):
|
|
12
13
|
name = "zlib"
|
|
13
14
|
version = Parameter("1.3.1", help="Zlib version.")
|
|
@@ -22,8 +23,6 @@ class Zlib(cmake.CMake):
|
|
|
22
23
|
def publish(self, artifact, tools):
|
|
23
24
|
super().publish(artifact, tools)
|
|
24
25
|
artifact.environ.CMAKE_PREFIX_PATH.append(".")
|
|
25
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
26
|
-
artifact.cxxinfo.libpaths.append("lib")
|
|
27
26
|
if self.system == "windows":
|
|
28
27
|
self.publish_windows(artifact, tools)
|
|
29
28
|
else:
|
|
@@ -31,23 +30,23 @@ class Zlib(cmake.CMake):
|
|
|
31
30
|
|
|
32
31
|
def publish_unix(self, artifact, tools):
|
|
33
32
|
artifact.cxxinfo.libraries.append("z")
|
|
34
|
-
with tools.cwd(artifact.path
|
|
33
|
+
with tools.cwd(artifact.path):
|
|
35
34
|
if self.shared:
|
|
36
|
-
for lib in tools.glob("
|
|
35
|
+
for lib in tools.glob("lib*/*.a"):
|
|
37
36
|
tools.unlink(lib)
|
|
38
37
|
else:
|
|
39
|
-
for lib in tools.glob("
|
|
38
|
+
for lib in tools.glob("lib*/*.so*") + tools.glob("lib*/*.dylib*"):
|
|
40
39
|
tools.unlink(lib)
|
|
41
40
|
|
|
42
41
|
def publish_windows(self, artifact, tools):
|
|
43
|
-
with tools.cwd(artifact.path
|
|
42
|
+
with tools.cwd(artifact.path):
|
|
44
43
|
if self.shared:
|
|
45
44
|
artifact.cxxinfo.libraries.append("zlib")
|
|
46
|
-
for lib in tools.glob("zlibstatic.*"):
|
|
45
|
+
for lib in tools.glob("lib*/zlibstatic.*"):
|
|
47
46
|
tools.unlink(lib)
|
|
48
47
|
else:
|
|
49
48
|
artifact.cxxinfo.libraries.append("zlibstatic")
|
|
50
|
-
for lib in tools.glob("zlib.*"):
|
|
49
|
+
for lib in tools.glob("lib*/zlib.*"):
|
|
51
50
|
tools.unlink(lib)
|
|
52
51
|
|
|
53
52
|
|
|
@@ -55,6 +54,7 @@ class Zlib(cmake.CMake):
|
|
|
55
54
|
@attributes.system
|
|
56
55
|
@cmake.requires()
|
|
57
56
|
@cmake.use_ninja()
|
|
57
|
+
@cxxinfo.publish()
|
|
58
58
|
class ZlibNg(cmake.CMake):
|
|
59
59
|
name = "zlib-ng"
|
|
60
60
|
version = Parameter("2.3.2", help="Zlib version.")
|
|
@@ -69,8 +69,6 @@ class ZlibNg(cmake.CMake):
|
|
|
69
69
|
def publish(self, artifact, tools):
|
|
70
70
|
super().publish(artifact, tools)
|
|
71
71
|
artifact.environ.CMAKE_PREFIX_PATH.append(".")
|
|
72
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
73
|
-
artifact.cxxinfo.libpaths.append("lib")
|
|
74
72
|
if self.system == "windows":
|
|
75
73
|
artifact.cxxinfo.libraries.append("zlibstatic-ng")
|
|
76
74
|
else:
|
jolt/pkgs/zstd.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from jolt import attributes, BooleanParameter, Parameter
|
|
2
2
|
from jolt.pkgs import cmake
|
|
3
|
-
from jolt.plugins import git, cmake
|
|
3
|
+
from jolt.plugins import cxxinfo, git, cmake
|
|
4
4
|
from jolt.tasks import TaskRegistry
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ from jolt.tasks import TaskRegistry
|
|
|
8
8
|
@attributes.system
|
|
9
9
|
@cmake.requires()
|
|
10
10
|
@cmake.use_ninja()
|
|
11
|
+
@cxxinfo.publish()
|
|
11
12
|
class Zstd(cmake.CMake):
|
|
12
13
|
name = "zstd"
|
|
13
14
|
version = Parameter("ebc93b0", help="zstd version.")
|
|
@@ -22,8 +23,6 @@ class Zstd(cmake.CMake):
|
|
|
22
23
|
|
|
23
24
|
def publish(self, artifact, tools):
|
|
24
25
|
super().publish(artifact, tools)
|
|
25
|
-
artifact.cxxinfo.incpaths.append("include")
|
|
26
|
-
artifact.cxxinfo.libpaths.append("lib")
|
|
27
26
|
if self.system == "windows":
|
|
28
27
|
artifact.cxxinfo.libraries.append("zstd_static")
|
|
29
28
|
else:
|
jolt/plugins/allure.py
CHANGED
|
@@ -40,7 +40,7 @@ class _ReporterTest(object):
|
|
|
40
40
|
|
|
41
41
|
def attach(self, name, content, mime_type=None):
|
|
42
42
|
with self._task.tools.cwd(self._outdirfull):
|
|
43
|
-
logpath = utils.
|
|
43
|
+
logpath = utils.hashstring(content) + "-" + name
|
|
44
44
|
self._task.tools.write_file(logpath, content, expand=False)
|
|
45
45
|
self._result.attachments.append(
|
|
46
46
|
Attachment(source=logpath, name=name, type=mime_type))
|
|
@@ -96,8 +96,8 @@ class Reporter(object):
|
|
|
96
96
|
result.name = name
|
|
97
97
|
result.start = time.time() * 1000
|
|
98
98
|
result.fullName = self._task.__class__.__name__ + "." + name
|
|
99
|
-
result.testCaseId = utils.
|
|
100
|
-
result.historyId = utils.
|
|
99
|
+
result.testCaseId = utils.hashstring(result.fullName)
|
|
100
|
+
result.historyId = utils.hashstring(self._task.qualified_name + result.testCaseId)
|
|
101
101
|
result.description = description
|
|
102
102
|
result.labels.append(Label(name=LabelType.HOST, value=self._host))
|
|
103
103
|
result.labels.append(Label(name=LabelType.THREAD, value=self._thread))
|
|
@@ -202,8 +202,8 @@ class AllureHooks(TaskHook):
|
|
|
202
202
|
result.start = time.time() * 1000
|
|
203
203
|
result.fullName = task.qualified_name
|
|
204
204
|
result.description = task.task.__doc__
|
|
205
|
-
result.testCaseId = utils.
|
|
206
|
-
result.historyId = utils.
|
|
205
|
+
result.testCaseId = utils.hashstring(result.fullName)
|
|
206
|
+
result.historyId = utils.hashstring(task.qualified_name + result.testCaseId)
|
|
207
207
|
result.labels.append(Label(name=LabelType.HOST, value=host_tag()))
|
|
208
208
|
result.labels.append(Label(name=LabelType.THREAD, value=thread_tag()))
|
|
209
209
|
result.labels.append(Label(name=LabelType.FRAMEWORK, value='jolt'))
|
|
@@ -217,7 +217,7 @@ class AllureHooks(TaskHook):
|
|
|
217
217
|
with task.tools.cwd(self._logpath):
|
|
218
218
|
content = task.allure_logsink_buffer.getvalue()
|
|
219
219
|
if content:
|
|
220
|
-
logpath = utils.
|
|
220
|
+
logpath = utils.hashstring(content) + "-" + "log"
|
|
221
221
|
task.tools.write_file(logpath, content, expand=False)
|
|
222
222
|
result.attachments.append(
|
|
223
223
|
Attachment(source=logpath, name="log", type="text/plain"))
|
jolt/plugins/cmake.py
CHANGED
jolt/plugins/cxxinfo.py
CHANGED
|
@@ -72,3 +72,35 @@ class CppInfoProvider(ArtifactAttributeSetProvider):
|
|
|
72
72
|
|
|
73
73
|
def unapply(self, task, artifact):
|
|
74
74
|
pass
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def publish(incpaths=["include"], libpaths=["lib", "lib32", "lib64"], libraries=[]):
|
|
78
|
+
"""
|
|
79
|
+
Decorator to add C++ build information to a CMake task artifact.
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
import functools
|
|
83
|
+
import os
|
|
84
|
+
|
|
85
|
+
def decorate(cls):
|
|
86
|
+
old_publish = cls.publish
|
|
87
|
+
|
|
88
|
+
@functools.wraps(old_publish)
|
|
89
|
+
def new_publish(self, artifact, tools):
|
|
90
|
+
old_publish(self, artifact, tools)
|
|
91
|
+
|
|
92
|
+
for incpath in incpaths:
|
|
93
|
+
if os.path.isdir(os.path.join(artifact.path, incpath)):
|
|
94
|
+
artifact.cxxinfo.incpaths.append(incpath)
|
|
95
|
+
|
|
96
|
+
for libpath in libpaths:
|
|
97
|
+
if os.path.isdir(os.path.join(artifact.path, libpath)):
|
|
98
|
+
artifact.cxxinfo.libpaths.append(libpath)
|
|
99
|
+
|
|
100
|
+
for lib in libraries:
|
|
101
|
+
artifact.cxxinfo.libraries.append(lib)
|
|
102
|
+
|
|
103
|
+
cls.publish = new_publish
|
|
104
|
+
return cls
|
|
105
|
+
|
|
106
|
+
return decorate
|
jolt/plugins/ninja.py
CHANGED
|
@@ -1281,7 +1281,7 @@ class FileListWriter(Rule):
|
|
|
1281
1281
|
|
|
1282
1282
|
def _data(self, project, files):
|
|
1283
1283
|
data = "\n".join(files)
|
|
1284
|
-
return data, utils.
|
|
1284
|
+
return data, utils.hashstring(data)
|
|
1285
1285
|
|
|
1286
1286
|
def build(self, project, writer, infiles, implicit=None, order_only=None):
|
|
1287
1287
|
infiles = [fs.as_posix(infile) for infile in infiles] if self.posix else infiles
|
|
@@ -1320,7 +1320,7 @@ class GNUMRIWriter(FileListWriter):
|
|
|
1320
1320
|
else:
|
|
1321
1321
|
data += "addmod {}\n".format(infile)
|
|
1322
1322
|
data += "save\nend\n"
|
|
1323
|
-
return data, utils.
|
|
1323
|
+
return data, utils.hashstring(data)
|
|
1324
1324
|
|
|
1325
1325
|
@utils.cached.instance
|
|
1326
1326
|
def get_influence(self, task):
|
jolt/plugins/selfdeploy/setup.py
CHANGED
jolt/tasks.py
CHANGED
|
@@ -1977,26 +1977,26 @@ class SubTask(object):
|
|
|
1977
1977
|
|
|
1978
1978
|
@functools.cached_property
|
|
1979
1979
|
def identity(self):
|
|
1980
|
-
|
|
1980
|
+
hash = utils.hashfn()
|
|
1981
1981
|
for ident in self._identity:
|
|
1982
|
-
|
|
1982
|
+
hash.update(ident.encode())
|
|
1983
1983
|
for output in self._outputs:
|
|
1984
|
-
|
|
1984
|
+
hash.update(output.encode())
|
|
1985
1985
|
if self.message:
|
|
1986
|
-
|
|
1987
|
-
return
|
|
1986
|
+
hash.update(self.message.encode())
|
|
1987
|
+
return hash.hexdigest()
|
|
1988
1988
|
|
|
1989
1989
|
@functools.cached_property
|
|
1990
1990
|
def influence(self):
|
|
1991
|
-
|
|
1991
|
+
hash = utils.hashfn()
|
|
1992
1992
|
for infl in self._influence:
|
|
1993
1993
|
if callable(infl):
|
|
1994
|
-
|
|
1994
|
+
hash.update(infl().encode())
|
|
1995
1995
|
else:
|
|
1996
|
-
|
|
1996
|
+
hash.update(infl.encode())
|
|
1997
1997
|
for dep in self._deps:
|
|
1998
|
-
|
|
1999
|
-
return
|
|
1998
|
+
hash.update(dep.influence.encode())
|
|
1999
|
+
return hash.hexdigest()
|
|
2000
2000
|
|
|
2001
2001
|
@functools.cached_property
|
|
2002
2002
|
def is_outdated(self):
|
|
@@ -2049,7 +2049,7 @@ class SubTask(object):
|
|
|
2049
2049
|
|
|
2050
2050
|
def add_influence_file(self, path):
|
|
2051
2051
|
path = self._tools.expand_path(path)
|
|
2052
|
-
self.add_influence(utils.
|
|
2052
|
+
self.add_influence(utils.hashfile(path))
|
|
2053
2053
|
|
|
2054
2054
|
def add_influence_depfile(self, path):
|
|
2055
2055
|
def depfile():
|
|
@@ -2062,7 +2062,7 @@ class SubTask(object):
|
|
|
2062
2062
|
for output in self.outputs:
|
|
2063
2063
|
for input in deps.get(output, []):
|
|
2064
2064
|
input = self._tools.expand_path(input)
|
|
2065
|
-
result += utils.
|
|
2065
|
+
result += utils.hashfile(input)
|
|
2066
2066
|
return result
|
|
2067
2067
|
self.add_influence(depfile)
|
|
2068
2068
|
|
jolt/tools.py
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import py7zr
|
|
2
|
+
import blake3
|
|
2
3
|
import bz2
|
|
3
4
|
import copy
|
|
4
5
|
import getpass
|
|
5
6
|
import gzip
|
|
6
7
|
import json
|
|
7
8
|
import lzma
|
|
9
|
+
import mmap
|
|
8
10
|
import subprocess
|
|
9
11
|
import os
|
|
10
12
|
import platform
|
|
@@ -710,7 +712,7 @@ class Tools(object):
|
|
|
710
712
|
from jolt.loader import JoltLoader
|
|
711
713
|
return fs.path.normpath(JoltLoader.get().build_path)
|
|
712
714
|
|
|
713
|
-
def checksum_file(self, filelist, concat=False, hashfn=
|
|
715
|
+
def checksum_file(self, filelist, concat=False, hashfn=blake3.blake3):
|
|
714
716
|
""" Calculate a checksum of one or multiple files.
|
|
715
717
|
|
|
716
718
|
Args:
|
|
@@ -718,24 +720,27 @@ class Tools(object):
|
|
|
718
720
|
concat (boolean): Concatenate files and return a single digest. If False,
|
|
719
721
|
a list with one digest for each file is returned. Default: False.
|
|
720
722
|
hashfn: The hash algorithm used. Any type which provides an update() and
|
|
721
|
-
hexdigest() method is accepted. Default:
|
|
722
|
-
filterfn: An optional data filter function. It is called repeatedly
|
|
723
|
-
with each block of data read from files as its only argument.
|
|
724
|
-
It should return the data to be included in the checksum.
|
|
725
|
-
Default: None
|
|
723
|
+
hexdigest() method is accepted. Default: blake3
|
|
726
724
|
|
|
727
725
|
Returns:
|
|
728
726
|
A list of checksum digests, or a single digest if files where concatenated.
|
|
729
727
|
"""
|
|
730
728
|
files = [self.expand_path(fname) for fname in utils.as_list(filelist)]
|
|
731
|
-
filterfn = filterfn or (lambda data: data)
|
|
732
729
|
result = []
|
|
733
|
-
checksum = hashfn()
|
|
734
730
|
|
|
735
731
|
for fname in files:
|
|
732
|
+
checksum = hashfn()
|
|
736
733
|
with open(fname, "rb") as f:
|
|
737
|
-
|
|
738
|
-
|
|
734
|
+
mm = None
|
|
735
|
+
try:
|
|
736
|
+
mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
|
|
737
|
+
checksum.update(mm)
|
|
738
|
+
except ValueError:
|
|
739
|
+
# File is empty
|
|
740
|
+
pass
|
|
741
|
+
finally:
|
|
742
|
+
if mm is not None:
|
|
743
|
+
mm.close()
|
|
739
744
|
result.append(checksum.hexdigest())
|
|
740
745
|
if not concat:
|
|
741
746
|
checksum = hashfn()
|
jolt/utils.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import blake3
|
|
1
2
|
import contextlib
|
|
2
3
|
import ctypes
|
|
3
4
|
import fnmatch
|
|
5
|
+
import mmap
|
|
4
6
|
import re
|
|
5
7
|
import time
|
|
6
8
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
@@ -515,18 +517,30 @@ def map_concurrent(method, iterable, *args, **kwargs):
|
|
|
515
517
|
return [future.result() for future in futures]
|
|
516
518
|
|
|
517
519
|
|
|
518
|
-
def
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
return
|
|
520
|
+
def hashstring(string, hashfn=blake3.blake3):
|
|
521
|
+
hash = hashfn()
|
|
522
|
+
hash.update(string.encode())
|
|
523
|
+
return hash.hexdigest()
|
|
522
524
|
|
|
523
525
|
|
|
524
|
-
def
|
|
525
|
-
|
|
526
|
+
def hashfile(path, hashfn=blake3.blake3):
|
|
527
|
+
hash = hashfn()
|
|
526
528
|
with open(path, "rb") as f:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
529
|
+
mm = None
|
|
530
|
+
try:
|
|
531
|
+
mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
|
|
532
|
+
hash.update(mm)
|
|
533
|
+
except ValueError:
|
|
534
|
+
# File is empty
|
|
535
|
+
pass
|
|
536
|
+
finally:
|
|
537
|
+
if mm is not None:
|
|
538
|
+
mm.close()
|
|
539
|
+
return hash.hexdigest()
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
def hashfn(hashfn=blake3.blake3):
|
|
543
|
+
return hashfn()
|
|
530
544
|
|
|
531
545
|
|
|
532
546
|
def fromjson(filepath, ignore_errors=False):
|
jolt/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.9.
|
|
1
|
+
__version__ = "0.9.445"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jolt
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.445
|
|
4
4
|
Summary: A task executor
|
|
5
5
|
Home-page: https://github.com/srand/jolt
|
|
6
6
|
Author: Robert Andersson
|
|
@@ -33,6 +33,7 @@ Requires-Dist: SecretStorage==3.3.3
|
|
|
33
33
|
Requires-Dist: allure-python-commons==2.13.5
|
|
34
34
|
Requires-Dist: attrs==24.2.0
|
|
35
35
|
Requires-Dist: backports.tarfile==1.2.0
|
|
36
|
+
Requires-Dist: blake3==1.0.8
|
|
36
37
|
Requires-Dist: bottle==0.12.25
|
|
37
38
|
Requires-Dist: brotli==1.2.0
|
|
38
39
|
Requires-Dist: bz2file==0.98
|