dv-flow-mgr 0.0.1.12941329363a1__py3-none-any.whl → 0.0.1.12941908886a1__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.
@@ -25,21 +25,21 @@ class FileSet(Task):
25
25
 
26
26
  if self.params is not None:
27
27
  glob_root = os.path.join(self.srcdir, self.params.base)
28
+ glob_root = glob_root.strip()
28
29
 
29
- print("glob_root: %s" % glob_root)
30
+ if glob_root[-1] == '/' or glob_root == '\\':
31
+ glob_root = glob_root[:-1]
30
32
 
31
33
  fs = _FileSet(
32
34
  src=self.name,
33
35
  type=self.params.type,
34
36
  basedir=glob_root)
35
- print("glob_root: %s" % glob_root)
36
37
 
37
38
  if not isinstance(self.params.include, list):
38
39
  self.params.include = [self.params.include]
39
40
 
40
41
  included_files = []
41
42
  for pattern in self.params.include:
42
- print("pattern: %s" % pattern)
43
43
  included_files.extend(glob.glob(os.path.join(glob_root, pattern), recursive=False))
44
44
 
45
45
  for file in included_files:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: dv-flow-mgr
3
- Version: 0.0.1.12941329363a1
3
+ Version: 0.0.1.12941908886a1
4
4
  Summary: DV Flow Manager is a build system for silicon design
5
5
  Author-email: Matthew Ballance <matt.ballance@gmail.com>
6
6
  License: Apache License
@@ -16,14 +16,13 @@ dv_flow/mgr/task_memento.py,sha256=C7VTQpBhDEoYuDmE6YTM-6TLMLnqHp6Y0Vat1aTgtCs,1
16
16
  dv_flow/mgr/util.py,sha256=06eVyURF4ga-s8C9Sd3ZSDebwO4QS0XXaB8xADVbWRc,1437
17
17
  dv_flow/mgr/cmds/cmd_run.py,sha256=C1bd2yZxVU03hZizGLYoH1JfZgeq_G57Kajc279iZpo,2773
18
18
  dv_flow/mgr/share/flow.json,sha256=lNmZex9NXkYbyb2aZseQfUOkV9CMyfH0iLODEI7EPBw,5096
19
- dv_flow/mgr/std/fileset.py,sha256=qY4RMqTHZaFZk68Y3oXtDv2_Ezu1r4wYvaRvr0GTyIY,2352
19
+ dv_flow/mgr/std/fileset.py,sha256=0eBp0VIkxYbIYAt0YJg0m-6nUbPuzGkaVBtxpius7Cg,2354
20
20
  dv_flow/mgr/std/flow.dv,sha256=pSpzrPPEu_L8DHccGfArxsKYgUfyQidShZc0ShgGtsY,500
21
21
  dv_flow/mgr/std/message.py,sha256=BPTHnEMD4tBufQ9LvsS9Sa_0xjaJATbBpwqosWslvVA,193
22
- dv_flow/mgr/std/task_fileset.py,sha256=UzTYONvK0X9rgy3rP9LiX4giBU8SyCCJav0LSNUJ1Qg,3140
23
22
  dv_flow/mgr/std/task_null.py,sha256=UEJ3fIoIMYWVsagiQC7GHD23UES7WoH4wtq94b4tcs4,265
24
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/METADATA,sha256=xuwb28g214WYwODgXHPicVVFvDj2Ct4TczlbOeDIuG8,13276
26
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/entry_points.txt,sha256=1roy8wAFM48LabOvr6jiOw0MUs-qE8X3Vf8YykPazxk,50
28
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/top_level.txt,sha256=amfVTkggzYPtWwLqNmRukfz1Buu0pGS2SrYBBLhXm04,8
29
- dv_flow_mgr-0.0.1.12941329363a1.dist-info/RECORD,,
23
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/METADATA,sha256=oj0DrmZVD70UnBb5Eg4omJaMR9hZobOvR7Od_dNug0I,13276
25
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
26
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/entry_points.txt,sha256=1roy8wAFM48LabOvr6jiOw0MUs-qE8X3Vf8YykPazxk,50
27
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/top_level.txt,sha256=amfVTkggzYPtWwLqNmRukfz1Buu0pGS2SrYBBLhXm04,8
28
+ dv_flow_mgr-0.0.1.12941908886a1.dist-info/RECORD,,
@@ -1,90 +0,0 @@
1
- import os
2
- import glob
3
- import fnmatch
4
- import pydantic.dataclasses as dc
5
- from ..fileset import FileSet
6
- from ..package import TaskCtor
7
- from ..task import Task, TaskParams
8
- from ..task_data import TaskData
9
- from ..task_memento import TaskMemento
10
- from typing import List, Tuple
11
-
12
- class TaskFileSet(Task):
13
-
14
- async def run(self, input : TaskData) -> TaskData:
15
- print("TaskFileSet run: %s: basedir=%s, base=%s type=%s include=%s" % (
16
- self.name,
17
- self.basedir,
18
- self.params.base, self.params.type, str(self.params.include)
19
- ))
20
-
21
- glob_root = os.path.join(self.basedir, self.params.base)
22
-
23
- ex_memento = self.getMemento(TaskFileSetMemento)
24
-
25
- fs = FileSet(
26
- src=self.name,
27
- type=self.params.type,
28
- basedir=glob_root)
29
- print("glob_root: %s" % glob_root)
30
-
31
- if not isinstance(self.params.include, list):
32
- self.params.include = [self.params.include]
33
-
34
- included_files = []
35
- for pattern in self.params.include:
36
- print("pattern: %s" % pattern)
37
- included_files.extend(glob.glob(os.path.join(glob_root, pattern), recursive=False))
38
-
39
- memento = TaskFileSetMemento()
40
- for file in included_files:
41
- if not any(glob.fnmatch.fnmatch(file, os.path.join(glob_root, pattern)) for pattern in self.params.exclude):
42
- memento.files.append((file, os.path.getmtime(os.path.join(glob_root, file))))
43
- fs.files.append(file[len(glob_root):])
44
-
45
- # Check to see if the filelist or fileset have changed
46
- # Only bother doing this if the upstream task data has not changed
47
- if ex_memento is not None and not input.changed:
48
- ex_memento.files.sort(key=lambda x: x[0])
49
- memento.files.sort(key=lambda x: x[0])
50
- input.changed = ex_memento != memento
51
- else:
52
- input.changed = True
53
-
54
- self.setMemento(memento)
55
-
56
- input.addFileSet(fs)
57
- return input
58
-
59
- class TaskFileSetParams(TaskParams):
60
- base : str = ""
61
- type : str = "Unknown"
62
- include : List[str] = dc.Field(default_factory=list)
63
- exclude : List[str] = dc.Field(default_factory=list)
64
-
65
- class TaskFileSetMemento(TaskMemento):
66
- files : List[Tuple[str,float]] = dc.Field(default_factory=list)
67
-
68
- class TaskFileSetCtor(TaskCtor):
69
-
70
- def mkTaskParams(self) -> TaskParams:
71
- return TaskFileSetParams()
72
-
73
- def setTaskParams(self, params : TaskParams, pvals : dict):
74
- for p in pvals.keys():
75
- if not hasattr(params, p):
76
- raise Exception("Unsupported parameter: " + p)
77
- else:
78
- setattr(params, p, pvals[p])
79
-
80
- def mkTask(self, name : str, task_id : int, session : 'Session', params : TaskParams, depends : List['Task']) -> 'Task':
81
- task = TaskFileSet(
82
- name=name,
83
- task_id=task_id,
84
- session=session,
85
- params=params,
86
- basedir=os.path.dirname(os.path.abspath(__file__)),
87
- srcdir=os.path.dirname(os.path.abspath(__file__)))
88
- task.depends.extend(depends)
89
- return task
90
-