PyProd 0.7.0__py3-none-any.whl → 0.9.0__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.
- pyprod/__init__.py +1 -1
- pyprod/main.py +1 -4
- pyprod/prod.py +33 -14
- {pyprod-0.7.0.dist-info → pyprod-0.9.0.dist-info}/METADATA +1 -1
- pyprod-0.9.0.dist-info/RECORD +11 -0
- pyprod-0.7.0.dist-info/RECORD +0 -11
- {pyprod-0.7.0.dist-info → pyprod-0.9.0.dist-info}/WHEEL +0 -0
- {pyprod-0.7.0.dist-info → pyprod-0.9.0.dist-info}/entry_points.txt +0 -0
- {pyprod-0.7.0.dist-info → pyprod-0.9.0.dist-info}/licenses/LICENSE +0 -0
pyprod/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.
|
1
|
+
__version__ = "0.9.0"
|
pyprod/main.py
CHANGED
@@ -137,10 +137,7 @@ def main():
|
|
137
137
|
sys.exit("No default target")
|
138
138
|
targets = [target]
|
139
139
|
|
140
|
-
ret =
|
141
|
-
for target in targets:
|
142
|
-
ret += asyncio.run(prod.start([target]))
|
143
|
-
|
140
|
+
ret = asyncio.run(prod.start(targets))
|
144
141
|
if not ret:
|
145
142
|
print(f"Nothing to be done for {targets}")
|
146
143
|
|
pyprod/prod.py
CHANGED
@@ -240,8 +240,9 @@ class Rule:
|
|
240
240
|
if not depend:
|
241
241
|
continue
|
242
242
|
|
243
|
-
|
244
|
-
|
243
|
+
if not callable(depend):
|
244
|
+
depend = _name_to_str(depend)
|
245
|
+
_check_pattern_count(depend)
|
245
246
|
self.depends.append(depend)
|
246
247
|
|
247
248
|
self.uses = []
|
@@ -249,9 +250,10 @@ class Rule:
|
|
249
250
|
if not use:
|
250
251
|
continue
|
251
252
|
|
252
|
-
|
253
|
-
|
254
|
-
|
253
|
+
if not callable(use):
|
254
|
+
use = _name_to_str(use)
|
255
|
+
_check_pattern_count(use)
|
256
|
+
_check_wildcard(use)
|
255
257
|
self.uses.append(use)
|
256
258
|
|
257
259
|
self.builder = builder
|
@@ -365,9 +367,25 @@ class Rules:
|
|
365
367
|
if m:
|
366
368
|
stem = m.groupdict().get("stem", None)
|
367
369
|
|
370
|
+
depends = []
|
371
|
+
for d in dep.depends:
|
372
|
+
if callable(d):
|
373
|
+
ret = flatten([d(name, stem)], ignore_none=True)
|
374
|
+
depends.extend(ret)
|
375
|
+
else:
|
376
|
+
depends.append(d)
|
377
|
+
|
378
|
+
uses = []
|
379
|
+
for u in dep.uses:
|
380
|
+
if callable(u):
|
381
|
+
ret = flatten([u(name, stem)], ignore_none=True)
|
382
|
+
uses.extend(ret)
|
383
|
+
else:
|
384
|
+
uses.append(u)
|
385
|
+
|
368
386
|
if stem is not None:
|
369
|
-
depends = [replace_pattern(r, stem) for r in
|
370
|
-
uses = [replace_pattern(r, stem) for r in
|
387
|
+
depends = [replace_pattern(r, stem) for r in depends]
|
388
|
+
uses = [replace_pattern(r, stem) for r in uses]
|
371
389
|
else:
|
372
390
|
depends = dep.depends[:]
|
373
391
|
uses = dep.uses[:]
|
@@ -557,6 +575,8 @@ class Prod:
|
|
557
575
|
self.module = self.load_pyprodfile(self.modulefile)
|
558
576
|
self.built = 0 # number of build execused
|
559
577
|
|
578
|
+
self.deps = []
|
579
|
+
|
560
580
|
def get_module_globals(self):
|
561
581
|
globals = {
|
562
582
|
"build": self.build,
|
@@ -646,11 +666,8 @@ class Prod:
|
|
646
666
|
return Exists(name, True, ret)
|
647
667
|
|
648
668
|
def build(self, *deps):
|
649
|
-
|
650
|
-
|
651
|
-
child = [_name_to_str(name) for name in flatten(elem)]
|
652
|
-
children.append(child)
|
653
|
-
self.deps[0:0] = children
|
669
|
+
if deps:
|
670
|
+
self.deps[0:0] = deps
|
654
671
|
|
655
672
|
def use_git(self, use):
|
656
673
|
self.use_git_timestamp = use
|
@@ -661,10 +678,12 @@ class Prod:
|
|
661
678
|
async def start(self, deps):
|
662
679
|
self.loop = asyncio.get_running_loop()
|
663
680
|
self.built = 0
|
664
|
-
self.deps
|
681
|
+
self.deps.append(deps)
|
665
682
|
while self.deps:
|
683
|
+
tasks = []
|
666
684
|
dep = self.deps.pop(0)
|
667
|
-
|
685
|
+
tasks.append(self.schedule([dep]))
|
686
|
+
await asyncio.gather(*tasks)
|
668
687
|
|
669
688
|
return self.built
|
670
689
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
pyprod/__init__.py,sha256=H9NWRZb7NbeRRPLP_V1fARmLNXranorVM-OOY-8_2ug,22
|
2
|
+
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
+
pyprod/main.py,sha256=_JuQCgGAGIx_hRc4U2BtsXRfUNKaqhnM3TndsqNcOac,3115
|
4
|
+
pyprod/prod.py,sha256=H6Ssxbh4p0Q7azB_st3qr1d3RwgIiqMekk_WSDt-xeg,21226
|
5
|
+
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
+
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
+
pyprod-0.9.0.dist-info/METADATA,sha256=KUZ8WDr88krTBUUwXbFRiRnrV-FhsG7uYk7on-_lRJo,2683
|
8
|
+
pyprod-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
pyprod-0.9.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
+
pyprod-0.9.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
+
pyprod-0.9.0.dist-info/RECORD,,
|
pyprod-0.7.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
pyprod/__init__.py,sha256=RaANGbRu5e-vehwXI1-Qe2ggPPfs1TQaZj072JdbLk4,22
|
2
|
-
pyprod/__main__.py,sha256=Vdhw8YA1K3wPMlbJQYL5WqvRzAKVeZ16mZQFO9VRmCo,62
|
3
|
-
pyprod/main.py,sha256=SWMmGVnVALwgENHmFfrTnYJcNyjWjw_qSO3o4aGre4E,3169
|
4
|
-
pyprod/prod.py,sha256=RY1-DPE_W5BhAXDURDeJViddCDxyZ0JVSFd40vSJOFI,20555
|
5
|
-
pyprod/utils.py,sha256=6bA06MtxvzcEArAozeJVMgCvoTT185OPEGypM1jjoG0,481
|
6
|
-
pyprod/venv.py,sha256=ZNMtHDBdC-eNFJE0-GxDlh6tlGy5Y-2m1r86SqxJJR0,1229
|
7
|
-
pyprod-0.7.0.dist-info/METADATA,sha256=mOcpnvRLrSdqN-p6U0U3EgXjX6L4dNg-w5H1XNAlPPg,2683
|
8
|
-
pyprod-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
pyprod-0.7.0.dist-info/entry_points.txt,sha256=zFycf8BYSMRDTiI0jftmcvtkf9XM4MZ4BL3JaIer_ZM,44
|
10
|
-
pyprod-0.7.0.dist-info/licenses/LICENSE,sha256=OtPgwnlLrsVEYPnTraun5AqftAT5vUv4rIan-qYj7nE,1071
|
11
|
-
pyprod-0.7.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|