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.
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/PKG-INFO +1 -1
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/pyproject.toml +1 -1
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/project.py +38 -6
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/PKG-INFO +1 -1
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/LICENSE +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/README.md +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/__init__.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/__main__.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/cli.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/constants.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/__init__.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/code_analyzer.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/deps/parser.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/enums.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/execution.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/install.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/kernel.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/matplotlib/backend.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/multifiles.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/__init__.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/cpu_job.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/cuda_job.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/plugins/job_template_spec.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/utils.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s/workload.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/SOURCES.txt +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/dependency_links.txt +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/entry_points.txt +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/requires.txt +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/q8s.egg-info/top_level.txt +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/setup.cfg +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/__init__.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/fixtures/cache/app.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/fixtures/simple/qiskit.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_backend.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_deps.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_job_template_spec.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_kernel.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_multifiles.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_project.py +0 -0
- {q8s-0.8.0.dev2 → q8s-0.8.0.dev4}/tests/test_utils.py +0 -0
|
@@ -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",
|
|
219
|
-
errors="replace",
|
|
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",
|
|
274
|
-
errors="replace",
|
|
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
|
|
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
|
|
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
|