q8s 0.8.0.dev2__tar.gz → 0.8.0.dev4__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.
Files changed (41) hide show
  1. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/PKG-INFO +1 -1
  2. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/pyproject.toml +1 -1
  3. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/project.py +38 -6
  4. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/PKG-INFO +1 -1
  5. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/LICENSE +0 -0
  6. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/README.md +0 -0
  7. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/__init__.py +0 -0
  8. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/__main__.py +0 -0
  9. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/cli.py +0 -0
  10. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/constants.py +0 -0
  11. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/__init__.py +0 -0
  12. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/code_analyzer.py +0 -0
  13. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/parser.py +0 -0
  14. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/enums.py +0 -0
  15. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/execution.py +0 -0
  16. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/install.py +0 -0
  17. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/kernel.py +0 -0
  18. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/matplotlib/backend.py +0 -0
  19. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/multifiles.py +0 -0
  20. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/__init__.py +0 -0
  21. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/cpu_job.py +0 -0
  22. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/cuda_job.py +0 -0
  23. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/job_template_spec.py +0 -0
  24. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/utils.py +0 -0
  25. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/workload.py +0 -0
  26. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/SOURCES.txt +0 -0
  27. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/dependency_links.txt +0 -0
  28. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/entry_points.txt +0 -0
  29. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/requires.txt +0 -0
  30. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/top_level.txt +0 -0
  31. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/setup.cfg +0 -0
  32. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/__init__.py +0 -0
  33. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/fixtures/cache/app.py +0 -0
  34. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/fixtures/simple/qiskit.py +0 -0
  35. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_backend.py +0 -0
  36. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_deps.py +0 -0
  37. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_job_template_spec.py +0 -0
  38. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_kernel.py +0 -0
  39. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_multifiles.py +0 -0
  40. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_project.py +0 -0
  41. {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q8s
3
- Version: 0.8.0.dev2
3
+ Version: 0.8.0.dev4
4
4
  Summary: Kernel extension for executing quantum programs in simulators on q8s clusters
5
5
  Author-email: Vlad Stirbu <vstirbu@gmail.com>
6
6
  License: Apache License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "q8s"
3
- version = "0.8.0.dev2"
3
+ version = "0.8.0.dev4"
4
4
  description = "Kernel extension for executing quantum programs in simulators on q8s clusters"
5
5
  authors = [{ name = "Vlad Stirbu", email = "vstirbu@gmail.com" }]
6
6
  readme = "README.md"
@@ -1,3 +1,4 @@
1
+ import configparser
1
2
  from dataclasses import dataclass
2
3
  from datetime import datetime
3
4
  from pathlib import Path
@@ -43,7 +44,7 @@ def _read_stream_lines(stream, progress, silent, is_error: bool = False):
43
44
  """
44
45
  while True:
45
46
  line = stream.readline()
46
- if line == '':
47
+ if line == "":
47
48
  break
48
49
  if not silent:
49
50
  if is_error:
@@ -96,6 +97,7 @@ class Q8SDocker:
96
97
  username: str
97
98
  registry: Optional[str]
98
99
 
100
+
99
101
  @dataclass
100
102
  class Q8SProject:
101
103
  name: str
@@ -112,9 +114,11 @@ class CacheNotBuiltException(Exception):
112
114
  class ProjectNotFoundException(Exception):
113
115
  pass
114
116
 
117
+
115
118
  class ProjectInvalidConfigurationException(Exception):
116
119
  pass
117
120
 
121
+
118
122
  class Project:
119
123
  name: str
120
124
  __path: str
@@ -215,14 +219,15 @@ class Project:
215
219
  stderr=STDOUT,
216
220
  bufsize=1,
217
221
  universal_newlines=True,
218
- encoding="utf-8", # force UTF-8 decoding
219
- errors="replace", # avoid crashing on bad bytes
222
+ encoding="utf-8", # force UTF-8 decoding
223
+ errors="replace", # avoid crashing on bad bytes
220
224
  )
221
225
 
222
226
  if sys.platform == "win32":
223
227
  # Windows-safe: read line by line instead of using selectors
224
228
  _handle_subprocess_output(build_process, progress, silent)
225
229
  else:
230
+
226
231
  def handle_output(stream, mask):
227
232
  # Because the process' output is line buffered, there's only ever one
228
233
  # line to read when this function is called
@@ -270,8 +275,8 @@ class Project:
270
275
  stderr=STDOUT,
271
276
  bufsize=1,
272
277
  universal_newlines=True,
273
- encoding="utf-8", # force UTF-8 decoding
274
- errors="replace", # avoid crashing on bad bytes
278
+ encoding="utf-8", # force UTF-8 decoding
279
+ errors="replace", # avoid crashing on bad bytes
275
280
  )
276
281
 
277
282
  if sys.platform == "win32":
@@ -279,6 +284,7 @@ class Project:
279
284
  _handle_subprocess_output(push_process, progress, silent)
280
285
 
281
286
  else:
287
+
282
288
  def handle_output(stream, mask):
283
289
  # Because the process' output is line buffered, there's only ever one
284
290
  # line to read when this function is called
@@ -325,7 +331,7 @@ class Project:
325
331
 
326
332
  def __image_name(self, target: str):
327
333
  registry = self.configuration.docker.registry
328
- username = self.__docker_login()
334
+ username = self.__docker_login().lower()
329
335
 
330
336
  # Build image name based on available information
331
337
  if registry and username:
@@ -388,6 +394,15 @@ class Project:
388
394
  file=f,
389
395
  )
390
396
  print(f"LABEL org.opencontainers.image.title={self.name}", file=f)
397
+
398
+ url = self.__get_project_url()
399
+
400
+ if url is not None:
401
+ print(
402
+ f"LABEL org.opencontainers.image.source={url.strip()}",
403
+ file=f,
404
+ )
405
+
391
406
  print("", file=f)
392
407
 
393
408
  print(f"WORKDIR {WORKSPACE}", file=f)
@@ -399,3 +414,20 @@ class Project:
399
414
  raise Exception(f"Target {target} not found")
400
415
 
401
416
  return getattr(self.configuration.targets, target)
417
+
418
+ def __get_project_url(self) -> Optional[str]:
419
+ """
420
+ Get the project URL from setup.cfg if available
421
+ """
422
+ cfg_path = Path(self.__path) / "setup.cfg"
423
+ if not cfg_path.exists():
424
+ return None
425
+
426
+ config = configparser.ConfigParser()
427
+ config.read(cfg_path)
428
+
429
+ url = config.get("metadata", "url", fallback=None)
430
+ if url is not None:
431
+ return url.strip()
432
+
433
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q8s
3
- Version: 0.8.0.dev2
3
+ Version: 0.8.0.dev4
4
4
  Summary: Kernel extension for executing quantum programs in simulators on q8s clusters
5
5
  Author-email: Vlad Stirbu <vstirbu@gmail.com>
6
6
  License: Apache License
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes