peakrdl-python 0.7.2__tar.gz → 0.7.3__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 (99) hide show
  1. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/PKG-INFO +1 -1
  2. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/__about__.py +1 -1
  3. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/__peakrdl__.py +12 -2
  4. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/exporter.py +137 -66
  5. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/PKG-INFO +1 -1
  6. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/.github/workflows/action.yaml +0 -0
  7. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/.gitignore +0 -0
  8. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/.readthedocs.yaml +0 -0
  9. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/LICENSE +0 -0
  10. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/MANIFEST.in +0 -0
  11. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/README.md +0 -0
  12. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/api.rst +0 -0
  13. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/api_components.rst +0 -0
  14. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/command_line.rst +0 -0
  15. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/conf.py +0 -0
  16. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/customisation.rst +0 -0
  17. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/generated_package.rst +0 -0
  18. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/genindex.rst +0 -0
  19. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/index.rst +0 -0
  20. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/docs/requirements.txt +0 -0
  21. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/array_access/array_access.rdl +0 -0
  22. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/array_access/demo_array_access.py +0 -0
  23. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/optimised_access/demo_optimised_access.py +0 -0
  24. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/optimised_access/optimised_access.rdl +0 -0
  25. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/overridden_names/over_ridden_names.py +0 -0
  26. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/overridden_names/overridden_names.rdl +0 -0
  27. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
  28. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/simulating_callbacks/flashing_the_LED.py +0 -0
  29. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
  30. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
  31. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/tranversing_address_map/reg_dump.json +0 -0
  32. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/tranversing_address_map/reseting_registers.py +0 -0
  33. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
  34. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/generate_testcases.py +0 -0
  35. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/pyproject.toml +0 -0
  36. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/setup.cfg +0 -0
  37. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/.coveragerc +0 -0
  38. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/__init__.py +0 -0
  39. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/_node_walkers.py +0 -0
  40. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/__init__.py +0 -0
  41. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/base.py +0 -0
  42. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/callbacks.py +0 -0
  43. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/fields.py +0 -0
  44. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/memory.py +0 -0
  45. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/lib/register.py +0 -0
  46. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/safe_name_utility.py +0 -0
  47. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/systemrdl_node_utility_functions.py +0 -0
  48. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/__init__.py +0 -0
  49. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
  50. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
  51. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
  52. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_register.py.jinja +0 -0
  53. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +0 -0
  54. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_simulation_tb.jinja +0 -0
  55. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/addrmap_tb.py.jinja +0 -0
  56. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/baseclass_tb.py.jinja +0 -0
  57. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/header.py.jinja +0 -0
  58. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
  59. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
  60. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/SOURCES.txt +0 -0
  61. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
  62. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
  63. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/requires.txt +0 -0
  64. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/src/peakrdl_python.egg-info/top_level.txt +0 -0
  65. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/.mypy.ini +0 -0
  66. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/alternative_template_toml/peakrdl.toml +0 -0
  67. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/alternative_templates/header.py.jinja +0 -0
  68. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/alternative_templates/header_tb.py.jinja +0 -0
  69. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/pylint.rc +0 -0
  70. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/RDLFormatCode_example.rdl +0 -0
  71. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/addr_map.rdl +0 -0
  72. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/all_register_access_types.rdl +0 -0
  73. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/basic.rdl +0 -0
  74. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/block_a.xml +0 -0
  75. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/block_b.xml +0 -0
  76. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/different_array_types.rdl +0 -0
  77. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/enum_example.rdl +0 -0
  78. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/example_issue_106.rdl +0 -0
  79. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/field_scope.rdl +0 -0
  80. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/field_with_overridden_reset.rdl +0 -0
  81. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/fields_with_HW_write.rdl +0 -0
  82. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/fields_with_reset_values.rdl +0 -0
  83. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/memories.rdl +0 -0
  84. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/memories_with_registers.rdl +0 -0
  85. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/msb0_and_lsb0.rdl +0 -0
  86. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/multi_block.rdl +0 -0
  87. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/multifile.rdl +0 -0
  88. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/name_clash.rdl +0 -0
  89. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/overridden_python_name.rdl +0 -0
  90. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
  91. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/regfile_and_arrays.rdl +0 -0
  92. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/same_but_different_enum.rdl +0 -0
  93. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
  94. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/simple.rdl +0 -0
  95. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/simple.xml +0 -0
  96. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/sizes_registers.rdl +0 -0
  97. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
  98. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/unit_tests/__init__.py +0 -0
  99. {peakrdl-python-0.7.2 → peakrdl-python-0.7.3}/tests/unit_tests/test_array_indexing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: peakrdl-python
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: Generate python wrapper for a register model compiled SystemRDL input
5
5
  Author: Keith Brady
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,4 +1,4 @@
1
1
  """
2
2
  Variables that describes the PeakRDL Python Package
3
3
  """
4
- __version__ = "0.7.2"
4
+ __version__ = "0.7.3"
@@ -43,6 +43,15 @@ class Exporter(ExporterSubcommandPlugin):
43
43
  help='define accesses to register model as asynchronous')
44
44
  arg_group.add_argument('--skip_test_case_generation', action='store_true',
45
45
  help='skip the generation of the test cases')
46
+ arg_group.add_argument('--suppress_cleanup', action='store_true', dest='suppress_cleanup',
47
+ help='by default peakrdl_python deletes all existing python .py '
48
+ 'files found in the directory where the package will be'
49
+ ' generated. This is normally useful if the user is '
50
+ 'generating over the top of an existing package and prevents '
51
+ 'problems when the strucutre of the register map changes. '
52
+ 'However, if additional python files are added by the user '
53
+ '(not recommended) this cleanup will need to be suppressed '
54
+ 'and managed by the user')
46
55
 
47
56
  def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> None:
48
57
  """
@@ -57,11 +66,12 @@ class Exporter(ExporterSubcommandPlugin):
57
66
  """
58
67
  templates = self.cfg['user_template_dir']
59
68
  peakrdl_exporter = \
60
- PythonExporter(user_template_dir=templates) # type: ignore[no-untyped-call]
69
+ PythonExporter(user_template_dir=templates) # type: ignore[no-untyped-call]
61
70
 
62
71
  peakrdl_exporter.export(
63
72
  top_node,
64
73
  options.output,
65
74
  options.is_async,
66
- skip_test_case_generation=options.skip_test_case_generation
75
+ skip_test_case_generation=options.skip_test_case_generation,
76
+ delete_existing_package_content=not options.suppress_cleanup
67
77
  )
@@ -3,9 +3,8 @@ Main Classes for the PeakRDL Python
3
3
  """
4
4
  import os
5
5
  from pathlib import Path
6
- from shutil import copyfile
6
+ from shutil import copy
7
7
  from typing import List, NoReturn, Iterable, Tuple
8
- from glob import glob
9
8
 
10
9
  import jinja2 as jj
11
10
  from systemrdl import RDLWalker # type: ignore
@@ -39,6 +38,120 @@ class PythonExportTemplateError(Exception):
39
38
  Exception for hading errors in the templating
40
39
  """
41
40
 
41
+ class _PythonPackage:
42
+ """
43
+ Class to represent a python package
44
+ """
45
+ def __init__(self, path: Path):
46
+ self._path = path
47
+
48
+ @property
49
+ def path(self) -> Path:
50
+ """
51
+ path of the package
52
+ """
53
+ return self._path
54
+
55
+ def child_package(self, name: str) -> '_PythonPackage':
56
+ """
57
+ provide a child package within the current package
58
+
59
+ Args:
60
+ name: name of child package
61
+
62
+ Returns:
63
+ None
64
+
65
+ """
66
+ return _PythonPackage(path=self.path / name)
67
+
68
+ def child_module_path(self, name: str) -> Path:
69
+ """
70
+ return a child module within the package
71
+
72
+ Args:
73
+ name: name of module
74
+
75
+ Returns:
76
+ None
77
+
78
+ """
79
+ return Path(self.path) / name
80
+
81
+ @property
82
+ def _init_path(self) -> Path:
83
+ return self.child_module_path('__init__.py')
84
+
85
+ def _make_empty_init_file(self) -> None:
86
+ with self._init_path.open('w', encoding='utf-8') as fid:
87
+ fid.write('pass\n')
88
+
89
+ def create_empty_package(self, cleanup: bool) -> None:
90
+ """
91
+ make the package folder (if it does not already exist), populate the __init__.py and
92
+ optionally remove any existing python files
93
+
94
+ Args:
95
+ cleanup (bool) : delete any existing python files in the package
96
+
97
+ Returns:
98
+ None
99
+ """
100
+ if self.path.exists():
101
+ if cleanup:
102
+ for file in self.path.glob('*.py'):
103
+ os.remove(file.resolve())
104
+ else:
105
+ self.path.mkdir(parents=True, exist_ok=False)
106
+ self._make_empty_init_file()
107
+
108
+
109
+ class _Package(_PythonPackage):
110
+ """
111
+ Class to define the package being generated
112
+
113
+ Args:
114
+ include_tests (bool): include the tests package
115
+ """
116
+ def __init__(self, path:str, package_name: str, include_tests: bool):
117
+ super().__init__(Path(path) / package_name)
118
+ self.reg_model = self.child_package('reg_model')
119
+ self._include_tests = include_tests
120
+ if include_tests:
121
+ self.tests = self.child_package('tests')
122
+ self.lib = self.child_package('lib')
123
+
124
+
125
+ def create_empty_package(self, cleanup: bool) -> None:
126
+ """
127
+ create the directories and __init__.py files associated with the exported package
128
+
129
+ Args:
130
+ package_path: directory for the package output
131
+ cleanup (bool): delete existing python files
132
+
133
+ Returns:
134
+ None
135
+
136
+ """
137
+
138
+ # make the folder for this package and populate the empty __init__.py
139
+ super().create_empty_package(cleanup=cleanup)
140
+ # make all the child packages folders and their __init__.py
141
+ self.reg_model.create_empty_package(cleanup=cleanup)
142
+ if self._include_tests:
143
+ self.tests.create_empty_package(cleanup=cleanup)
144
+ self.lib.create_empty_package(cleanup=cleanup)
145
+
146
+ # copy all the python source code that is part of the library which comes as part of the
147
+ # peakrdl-python to the lib direction of the generated package
148
+ template_package = Path(__file__).parent / 'lib'
149
+ files_in_package = template_package.glob('*.py')
150
+
151
+ for file_in_package in files_in_package:
152
+ copy(src=file_in_package, dst=self.lib.path)
153
+
154
+
42
155
  class PythonExporter:
43
156
  """
44
157
  PeakRDL Python Exporter class
@@ -96,7 +209,8 @@ class PythonExporter:
96
209
 
97
210
  def export(self, node: Node, path: str,
98
211
  asyncoutput: bool=False,
99
- skip_test_case_generation: bool=False) -> List[str]:
212
+ skip_test_case_generation: bool=False,
213
+ delete_existing_package_content: bool = True) -> List[str]:
100
214
  """
101
215
  Generated Python Code and Testbench
102
216
 
@@ -106,6 +220,9 @@ class PythonExporter:
106
220
  path (str) : Output package path.
107
221
  asyncoutput (bool) : If set this builds a register model with async callbacks
108
222
  skip_test_case_generation (bool): skip generation the generation of the test cases
223
+ delete_existing_package_content (bool): delete any python files in the package
224
+ location, normally left over from previous
225
+ operations
109
226
 
110
227
  Returns:
111
228
  List[str] : modules that have been exported:
@@ -118,9 +235,10 @@ class PythonExporter:
118
235
  else:
119
236
  top_block = node
120
237
 
121
- package_path = os.path.join(path, node.inst_name)
122
- self._create_empty_package(package_path=package_path,
123
- skip_test_case_generation=skip_test_case_generation)
238
+ package = _Package(path=path,
239
+ package_name=node.inst_name,
240
+ include_tests=not skip_test_case_generation)
241
+ package.create_empty_package(cleanup=delete_existing_package_content)
124
242
 
125
243
  self._build_node_type_table(top_block)
126
244
 
@@ -167,21 +285,19 @@ class PythonExporter:
167
285
  context.update(self.user_template_context)
168
286
 
169
287
  template = self.jj_env.get_template("addrmap.py.jinja")
170
- module_fqfn = os.path.join(package_path,
171
- 'reg_model',
172
- top_block.inst_name + '.py')
288
+ module_path = package.reg_model.child_module_path(top_block.inst_name + '.py')
173
289
 
174
- stream = template.stream(context)
175
- stream.dump(module_fqfn, encoding='utf-8')
290
+ with module_path.open('w', encoding='utf-8') as fp:
291
+ stream = template.stream(context)
292
+ stream.dump(fp)
176
293
 
177
294
  if not skip_test_case_generation:
178
295
 
179
296
  # make the top level base class for all the other test, this is what instantes
180
297
  # the register model
181
298
  template = self.jj_env.get_template("baseclass_tb.py.jinja")
182
- module_tb_fqfn = os.path.join(package_path,
183
- 'tests',
184
- '_' + top_block.inst_name + '_test_base.py')
299
+ module_tb_path = package.tests.child_module_path(
300
+ '_' + top_block.inst_name + '_test_base.py')
185
301
 
186
302
  context = {
187
303
  'top_node': top_block,
@@ -189,9 +305,9 @@ class PythonExporter:
189
305
  'version': __version__
190
306
  }
191
307
 
192
-
193
- stream = template.stream(context)
194
- stream.dump(module_tb_fqfn, encoding='utf-8')
308
+ with module_tb_path.open('w', encoding='utf-8') as fp:
309
+ stream = template.stream(context)
310
+ stream.dump(fp)
195
311
 
196
312
  # make the tests themselves
197
313
  template = self.jj_env.get_template("addrmap_tb.py.jinja")
@@ -208,10 +324,7 @@ class PythonExporter:
208
324
  RDLWalker(unroll=True).walk(block, owned_elements, skip_top=True)
209
325
 
210
326
  fq_block_name = '_'.join(block.get_path_segments(array_suffix = '_{index:d}_'))
211
-
212
- module_tb_fqfn = os.path.join(package_path,
213
- 'tests',
214
- 'test_' + fq_block_name + '.py')
327
+ module_tb_path = package.tests.child_module_path('test_' + fq_block_name + '.py')
215
328
 
216
329
  context = {
217
330
  'top_node': top_block,
@@ -244,8 +357,9 @@ class PythonExporter:
244
357
  'version': __version__
245
358
  }
246
359
 
247
- stream = template.stream(context)
248
- stream.dump(module_tb_fqfn, encoding='utf-8')
360
+ with module_tb_path.open('w', encoding='utf-8') as fp:
361
+ stream = template.stream(context)
362
+ stream.dump(fp)
249
363
 
250
364
  return top_block.inst_name
251
365
 
@@ -291,49 +405,6 @@ class PythonExporter:
291
405
  else:
292
406
  self.node_type_name[child_inst] = cand_type_name
293
407
 
294
- @staticmethod
295
- def _create_empty_package(package_path:str,
296
- skip_test_case_generation: bool) -> None:
297
- """
298
- create the directories and __init__.py files associated with the exported package
299
-
300
- Args:
301
- package_path: directory for the package output
302
- skip_test_case_generation: skip the generation of the test folders
303
-
304
- Returns:
305
- None
306
-
307
- """
308
-
309
- Path(package_path).mkdir(parents=True, exist_ok=True)
310
- Path(os.path.join(package_path, 'reg_model')).mkdir(parents=True, exist_ok=True)
311
- if not skip_test_case_generation:
312
- Path(os.path.join(package_path, 'tests')).mkdir(parents=True, exist_ok=True)
313
- Path(os.path.join(package_path, 'lib')).mkdir(parents=True, exist_ok=True)
314
-
315
- module_fqfn = os.path.join(package_path, 'reg_model', '__init__.py')
316
- with open(module_fqfn, 'w', encoding='utf-8') as fid:
317
- fid.write('pass\n')
318
- if not skip_test_case_generation:
319
- module_fqfn = os.path.join(package_path, 'tests', '__init__.py')
320
- with open(module_fqfn, 'w', encoding='utf-8') as fid:
321
- fid.write('pass\n')
322
- module_fqfn = os.path.join(package_path, '__init__.py')
323
- with open(module_fqfn, 'w', encoding='utf-8') as fid:
324
- fid.write('pass\n')
325
-
326
- template_package = os.path.join(os.path.dirname(__file__),
327
- 'lib')
328
- files_in_package = glob(os.path.join(template_package,'*.py'))
329
-
330
- for file_in_package in files_in_package:
331
- filename = os.path.basename(file_in_package)
332
- copyfile(src=os.path.join(template_package,
333
- filename),
334
- dst=os.path.join(package_path,
335
- 'lib',
336
- filename))
337
408
 
338
409
  def _raise_template_error(self, message: str) -> NoReturn:
339
410
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: peakrdl-python
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: Generate python wrapper for a register model compiled SystemRDL input
5
5
  Author: Keith Brady
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes