qlever 0.3.9__py3-none-any.whl → 0.4.1__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.

Potentially problematic release.


This version of qlever might be problematic. Click here for more details.

qlever/config.py CHANGED
@@ -4,6 +4,7 @@ import argparse
4
4
  import os
5
5
  import traceback
6
6
  from pathlib import Path
7
+ from importlib.metadata import version
7
8
 
8
9
  import argcomplete
9
10
 
@@ -180,6 +181,8 @@ class QleverConfig:
180
181
  # are defined in the modules in `qlever/commands`. In `__init__.py`
181
182
  # an object of each class is created and stored in `command_objects`.
182
183
  parser = argparse.ArgumentParser()
184
+ parser.add_argument("--version", action="version",
185
+ version=f"%(prog)s {version('qlever')}")
183
186
  add_qleverfile_option(parser)
184
187
  subparsers = parser.add_subparsers(dest='command')
185
188
  subparsers.required = True
qlever/util.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- import random
3
+ import secrets
4
4
  import re
5
5
  import shlex
6
6
  import shutil
@@ -93,7 +93,7 @@ def get_curl_cmd_for_sparql_query(
93
93
  """
94
94
  Get curl command for given SPARQL query.
95
95
  """
96
- curl_cmd = (f"curl -s http::{host}:{port}"
96
+ curl_cmd = (f"curl -s http://{host}:{port}"
97
97
  f" -H \"Accept: {media_type}\" "
98
98
  f" --data-urlencode query={shlex.quote(query)}")
99
99
  if pinresult and access_token is not None:
@@ -137,8 +137,9 @@ def show_process_info(psutil_process, cmdline_regex, show_heading=True):
137
137
  pinfo = psutil_process.as_dict(
138
138
  attrs=['pid', 'username', 'create_time',
139
139
  'memory_info', 'cmdline'])
140
- cmdline = " ".join(pinfo['cmdline'])
141
- if not re.search(cmdline_regex, cmdline):
140
+ # Note: pinfo[`cmdline`] is `None` if the process is a zombie.
141
+ cmdline = " ".join(pinfo['cmdline'] or [])
142
+ if len(cmdline) == 0 or not re.search(cmdline_regex, cmdline):
142
143
  return False
143
144
  pid = pinfo['pid']
144
145
  user = pinfo['username'] if pinfo['username'] else ""
@@ -162,6 +163,5 @@ def get_random_string(length: int) -> str:
162
163
  Helper function that returns a randomly chosen string of the given
163
164
  length. Take the current time as seed.
164
165
  """
165
- random.seed(datetime.now())
166
- return "".join(random.choices(string.ascii_letters + string.digits,
167
- k=length))
166
+ characters = string.ascii_letters + string.digits
167
+ return "".join(secrets.choice(characters) for _ in range(length))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qlever
3
- Version: 0.3.9
3
+ Version: 0.4.1
4
4
  Summary: Script for using the QLever SPARQL engine.
5
5
  Author-email: Hannah Bast <bast@cs.uni-freiburg.de>
6
6
  License: Apache License
@@ -214,6 +214,7 @@ Description-Content-Type: text/markdown
214
214
  License-File: LICENSE
215
215
  Requires-Dist: psutil
216
216
  Requires-Dist: termcolor
217
+ Requires-Dist: argcomplete
217
218
 
218
219
  # QLever
219
220
 
@@ -1,15 +1,12 @@
1
1
  qlever/__init__.py,sha256=IyfS1OhlVE7-rjtv6FPlL0R56VxcNsS6KS7NJQhTDIM,1367
2
2
  qlever/__main__.py,sha256=MqM37bEzQeJEGUXZvuLcilIvnObZiG2eTGIkfKGpdnw,62016
3
- qlever/argcomplete-test.py,sha256=MJosqJc313c9aiPfuGJiaI2vwCf-dwAu-SVZ2TX5Wzk,463
4
3
  qlever/command.py,sha256=yOr0Uc8D8-AM7EjwDsVzbc3KNYjPH-FVOZhIHkqO588,2749
5
- qlever/config.py,sha256=LOVW8alFCVgZz_GAWm7vnjZVMVE7m3QTecy34lHgjGE,10017
4
+ qlever/config.py,sha256=-jjHAL8jdp25v53SqXKP4gWip6Qw9OdlDvFN6X7uk_4,10184
6
5
  qlever/containerize.py,sha256=p8g3O3G8a_0XLzSTzl_e5t9dqjbCQ-ippoA8vI2Z9pI,4193
7
- qlever/customhelp-test.py,sha256=fYLu-KMCHJQkQ8-XE6PtaYqPTMwI-Ew5B_EnIdHKxv4,1505
8
6
  qlever/log.py,sha256=k9Mq4hxQ_d2k0e-5ZVgcB2XIRhOsGMO9I3rIR7YQyDA,1376
9
7
  qlever/qlever_main.py,sha256=k8vIQYK7zqObFNet11iLf--nrLdPooL5amprmlySi4k,2300
10
8
  qlever/qleverfile.py,sha256=6Ll81xkzel_s2Ju9ZfBXUGlRfikaAzZM6Do-dTrdo3k,12934
11
- qlever/test_copilot.py,sha256=NL2YMvBY0myCyxIoppa7dgN_vr54r6Pe8Mmc41OfelI,17
12
- qlever/util.py,sha256=WM09PMRffUoPpEse4VwK9BzUavFkaB2Bm8KfVWxC3sQ,6161
9
+ qlever/util.py,sha256=dwqtpY14P3ds_PYx5bgqus_nsx_BhPQzUSa0Z86ONdo,6236
13
10
  qlever/Qleverfiles/Qleverfile.dblp,sha256=SFjBD20aOSWod4mEQnxHSDWdInoE_EFp2nyMw7ev7ZA,1167
14
11
  qlever/Qleverfiles/Qleverfile.dblp-plus,sha256=Dwd9pK1vPcelKfw6sA-IuyhbZ6yIxOh6_84JgPYnB9Q,1332
15
12
  qlever/Qleverfiles/Qleverfile.default,sha256=mljl6I1RCkpIWOqMQwjzPZIsarYQx1R0mIlc583KuqU,1869
@@ -42,9 +39,9 @@ qlever/commands/status.py,sha256=5S6EdapZEwFKV9cQZtNYcZhMbAXAY-FP6ggjIhfX8ek,163
42
39
  qlever/commands/stop.py,sha256=TZs4bxKHvujlZAU8BZmFjA5eXSZNAa6EeNzvPpEZsuI,4139
43
40
  qlever/commands/ui.py,sha256=rV8u017WLbfz0zVT_c9GC4d9v1WWwrTM3kfGONbeCvQ,2499
44
41
  qlever/commands/warmup.py,sha256=WOZSxeV8U_F6pEEnAb6YybXLQMxZFTRJXs4BPHUhsmc,1030
45
- qlever-0.3.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- qlever-0.3.9.dist-info/METADATA,sha256=xSj11QMM7EztxVfk0Yi1N7F65h2XKfNsghyWxF96wg8,17049
47
- qlever-0.3.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
48
- qlever-0.3.9.dist-info/entry_points.txt,sha256=s0iWBHKRUzsJ7B6nVGiyMdOJtiOS84IJMSSxgbNU6LU,85
49
- qlever-0.3.9.dist-info/top_level.txt,sha256=kd3zsYqiFd0--Czh5XTVkfEq6XR-XgRFW35X0v0GT-c,7
50
- qlever-0.3.9.dist-info/RECORD,,
42
+ qlever-0.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
+ qlever-0.4.1.dist-info/METADATA,sha256=GkXf_oneu0Oe02UOPR8OvqVzxDNA-ljS6yPGLi2x_Bk,17076
44
+ qlever-0.4.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
45
+ qlever-0.4.1.dist-info/entry_points.txt,sha256=s0iWBHKRUzsJ7B6nVGiyMdOJtiOS84IJMSSxgbNU6LU,85
46
+ qlever-0.4.1.dist-info/top_level.txt,sha256=kd3zsYqiFd0--Czh5XTVkfEq6XR-XgRFW35X0v0GT-c,7
47
+ qlever-0.4.1.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env python3
2
- # PYTHON_ARGCOMPLETE_OK
3
-
4
- import argparse
5
- import argcomplete
6
- import os
7
- import sys
8
-
9
- def main():
10
- parser = argparse.ArgumentParser()
11
- parser.add_argument('--foo', required=True, help='foo help')
12
- comp_line = os.getenv('COMP_LINE', '[not in AC mode]')
13
- print('COMP_LINE: %s' % comp_line, file=sys.stderr)
14
- argcomplete.autocomplete(parser)
15
- args = parser.parse_args()
16
- print(args.foo)
17
-
18
- if __name__ == '__main__':
19
- main()
qlever/customhelp-test.py DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env python3
2
- # PYTHON_ARGCOMPLETE_OK
3
-
4
- import argparse
5
- import argcomplete
6
-
7
- # class MyHelpFormatter(argparse.HelpFormatter):
8
- # def _format_action_invocation(self, action):
9
- # if not action.option_strings:
10
- # default = self._get_default_metavar_for_positional(action)
11
- # metavar = getattr(action, 'metavar', default)
12
- # return metavar
13
- # else:
14
- # parts = []
15
- # if action.nargs == 0:
16
- # parts.extend(action.option_strings)
17
- # else:
18
- # default = self._get_default_metavar_for_optional(action)
19
- # args_string = self._format_args(action, default)
20
- # parts.extend(action.option_strings)
21
- # parts[-1] += ' ' + args_string
22
- # return ', '.join(parts)
23
- #
24
- class MyHelpAction(argparse.Action):
25
- def __call__(self, parser, namespace, values, option_string=None):
26
- parser.print_help()
27
- parser.print_help()
28
- parser.exit()
29
-
30
- def main():
31
- parser = argparse.ArgumentParser(description='This is MY script')
32
- parser.add_argument('--foo', required=True, help='foo help')
33
- # parser.add_argument('--help', action=MyHelpAction, nargs=0,
34
- # help='this is MY help message')
35
- # parser.add_argument('--help', action=MyHelpAction, help='show this help message and exit')
36
- argcomplete.autocomplete(parser)
37
- args = parser.parse_args()
38
- print(args.foo)
39
-
40
- if __name__ == '__main__':
41
- main()
qlever/test_copilot.py DELETED
@@ -1 +0,0 @@
1
- if __name__ == "
File without changes