masterpiece 0.1.50__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 (74) hide show
  1. masterpiece-0.1.50/.gitlab-ci.yml +15 -0
  2. masterpiece-0.1.50/CHANGELOG.rst +543 -0
  3. masterpiece-0.1.50/CONTRIBUTING.rst +45 -0
  4. masterpiece-0.1.50/LICENSE.rst +22 -0
  5. masterpiece-0.1.50/MANIFEST.in +21 -0
  6. masterpiece-0.1.50/Makefile +3 -0
  7. masterpiece-0.1.50/PKG-INFO +285 -0
  8. masterpiece-0.1.50/README.rst +251 -0
  9. masterpiece-0.1.50/TODO.rst +18 -0
  10. masterpiece-0.1.50/ci-templates/common-ci.yml +49 -0
  11. masterpiece-0.1.50/ci-templates/master-ci.yml +138 -0
  12. masterpiece-0.1.50/ci-templates/master-plugin-ci.yml +139 -0
  13. masterpiece-0.1.50/config/project.mak +37 -0
  14. masterpiece-0.1.50/config/sphinx.mak +42 -0
  15. masterpiece-0.1.50/config/sphinxconf.py +79 -0
  16. masterpiece-0.1.50/docs/Makefile +4 -0
  17. masterpiece-0.1.50/docs/__init__.py +0 -0
  18. masterpiece-0.1.50/docs/source/CHANGELOG.rst +541 -0
  19. masterpiece-0.1.50/docs/source/CONTRIBUTING.rst +45 -0
  20. masterpiece-0.1.50/docs/source/LICENSE.rst +22 -0
  21. masterpiece-0.1.50/docs/source/README.rst +251 -0
  22. masterpiece-0.1.50/docs/source/TODO.rst +18 -0
  23. masterpiece-0.1.50/docs/source/__init__.py +1 -0
  24. masterpiece-0.1.50/docs/source/_static/masterpiece.css +64 -0
  25. masterpiece-0.1.50/docs/source/_static/masterpiece.png +0 -0
  26. masterpiece-0.1.50/docs/source/_templates/layout.html +5 -0
  27. masterpiece-0.1.50/docs/source/conf.py +18 -0
  28. masterpiece-0.1.50/docs/source/index.rst +53 -0
  29. masterpiece-0.1.50/docs/source/masterpiece/index.rst +8 -0
  30. masterpiece-0.1.50/docs/source/plugintutorial.rst +62 -0
  31. masterpiece-0.1.50/docs/source/tutorial.rst +290 -0
  32. masterpiece-0.1.50/examples/__init__.py +0 -0
  33. masterpiece-0.1.50/examples/myapp.log +62 -0
  34. masterpiece-0.1.50/examples/myapp.py +128 -0
  35. masterpiece-0.1.50/masterpiece/__init__.py +54 -0
  36. masterpiece-0.1.50/masterpiece/application.py +357 -0
  37. masterpiece-0.1.50/masterpiece/argmaestro.py +98 -0
  38. masterpiece-0.1.50/masterpiece/composite.py +199 -0
  39. masterpiece-0.1.50/masterpiece/format.py +63 -0
  40. masterpiece-0.1.50/masterpiece/jsonformat.py +102 -0
  41. masterpiece-0.1.50/masterpiece/log.py +100 -0
  42. masterpiece-0.1.50/masterpiece/masterpiece.py +525 -0
  43. masterpiece-0.1.50/masterpiece/masterpiecethread.py +222 -0
  44. masterpiece-0.1.50/masterpiece/mqtt.py +272 -0
  45. masterpiece-0.1.50/masterpiece/plugin.py +28 -0
  46. masterpiece-0.1.50/masterpiece/plugmaster.py +151 -0
  47. masterpiece-0.1.50/masterpiece/py.typed +0 -0
  48. masterpiece-0.1.50/masterpiece/supervisor.py +91 -0
  49. masterpiece-0.1.50/masterpiece/timeseries.py +210 -0
  50. masterpiece-0.1.50/masterpiece/treevisualizer.py +110 -0
  51. masterpiece-0.1.50/masterpiece/url.py +172 -0
  52. masterpiece-0.1.50/masterpiece.egg-info/PKG-INFO +285 -0
  53. masterpiece-0.1.50/masterpiece.egg-info/SOURCES.txt +72 -0
  54. masterpiece-0.1.50/masterpiece.egg-info/dependency_links.txt +1 -0
  55. masterpiece-0.1.50/masterpiece.egg-info/requires.txt +14 -0
  56. masterpiece-0.1.50/masterpiece.egg-info/top_level.txt +1 -0
  57. masterpiece-0.1.50/mypy.ini +6 -0
  58. masterpiece-0.1.50/pyproject.toml +60 -0
  59. masterpiece-0.1.50/setup.cfg +4 -0
  60. masterpiece-0.1.50/tests/__init__.py +0 -0
  61. masterpiece-0.1.50/tests/test_application.py +296 -0
  62. masterpiece-0.1.50/tests/test_argmaestro.py +67 -0
  63. masterpiece-0.1.50/tests/test_composite.py +238 -0
  64. masterpiece-0.1.50/tests/test_format.py +26 -0
  65. masterpiece-0.1.50/tests/test_jsonformat.py +67 -0
  66. masterpiece-0.1.50/tests/test_log.py +88 -0
  67. masterpiece-0.1.50/tests/test_masterpiece.py +316 -0
  68. masterpiece-0.1.50/tests/test_masterpiecethread.py +105 -0
  69. masterpiece-0.1.50/tests/test_mqtt.py +103 -0
  70. masterpiece-0.1.50/tests/test_plugmaster.py +129 -0
  71. masterpiece-0.1.50/tests/test_supervisor.py +99 -0
  72. masterpiece-0.1.50/tests/test_timeseries.py +156 -0
  73. masterpiece-0.1.50/tests/test_treevisualizer.py +53 -0
  74. masterpiece-0.1.50/tests/test_url.py +97 -0
@@ -0,0 +1,15 @@
1
+ variables:
2
+ PACKAGE_NAME: "masterpiece"
3
+
4
+ variables:
5
+ MPHOME: ".."
6
+
7
+ include:
8
+ - project: 'juham/masterpieces/masterpiece'
9
+ ref: 'master'
10
+ file: 'ci-templates/master-ci.yml'
11
+
12
+ upload-pypi-job:
13
+ extends: .upload-pypi-job
14
+ script:
15
+ - python -m twine upload dist/* -u __token__ -p "$PYPI_TOKEN"
@@ -0,0 +1,543 @@
1
+ CHANGELOG
2
+ =========
3
+
4
+ [0.1.50] November 29 2025
5
+ --------------------------
6
+
7
+ - Obsolete clean.py removed
8
+
9
+ - Added a prerequisites directory for personal, developer-specific
10
+ files, e.g. .gitignore. These come in handy when creating new
11
+ masterpiece modules.
12
+
13
+ - Introduced the **SupervisorThread**, a fault-tolerant supervisory system
14
+ that monitors worker thread crashes, logs them, and automatically
15
+ restarts failed threads.
16
+
17
+ - Added an **error queue** to the Application and MasterPieceThread
18
+ classes, enabling structured crash reporting for supervised workers.
19
+
20
+ - Updated MasterPieceThread:
21
+
22
+ * Added support for storing constructor arguments for thread recreation.
23
+ * Implemented the ``recreate()`` method for safe thread replacement.
24
+ * Improved crash handling and error propagation to the supervisor.
25
+
26
+ - Application now initializes and starts the SupervisorThread automatically
27
+ in ``run()`` and ``run_forever()``.
28
+
29
+ - README.rst significantly improved:
30
+
31
+ * Added clearer explanations of key features.
32
+ * Highlighted Supervisor, MQTT, hierarchical structures, and plugin system.
33
+ * Improved formatting and corrected terminology (e.g. **Grafana**).
34
+
35
+ - Fixed incorrect export of ``ArgsMaestro`` and replaced it with
36
+ ``ArgMaestro`` in ``__all__``.
37
+
38
+ - Exposed ``SupervisorThread`` for public API use.
39
+
40
+ - Minor documentation fixes and enhancements across multiple modules.
41
+
42
+ - New and extended unit tests for SupervisorThread and crash handling.
43
+
44
+
45
+
46
+
47
+ [0.1.46] November 15 2025
48
+ --------------------------
49
+
50
+ - Fixed wrong default topic name in MasterPieceThread class.
51
+ - Unit tests for MasterPieceThread class updated.
52
+
53
+
54
+ [0.1.36] March 15 2025
55
+ -----------------------
56
+
57
+ - CI pipeline builds and publishes developer documentation to the `public/` directory for GitLab Pages.
58
+ - CI document building stage failed due to a bug in ci-templates, fixed.
59
+ - Workaround to sphinx path maddness (relative paths relative to sphinx conf.py file)
60
+ - MPHOME yaml variable, for inter package references
61
+
62
+
63
+ [0.1.34] March 15 2025
64
+ -----------------------
65
+
66
+ Updated to comply with the new SPDX expression for packaging standards
67
+
68
+ Bug fixes:
69
+ - pages CI branch fixed
70
+ - config/sphinx.mak generates HTML documentation in the project's public folder.
71
+ - Sphinx fails to build HTML documentation unless the public/.doctrees subfolder already exists
72
+
73
+
74
+
75
+ [0.1.29] March 09 2025
76
+ -----------------------
77
+
78
+ * ``ci-templates`` unified a bit
79
+
80
+
81
+ [0.1.28] March 09 2025
82
+ -----------------------
83
+
84
+ * Build and install developer documentation.
85
+
86
+
87
+
88
+ [0.1.26] March 06 2025
89
+ -----------------------
90
+
91
+ * Fixed incorrect key in to_dict() output: "_version:" (with a colon) is now correctly "_version" without a colon.
92
+
93
+
94
+ [0.1.25] March 02 2025
95
+ -----------------------
96
+
97
+ This release attempts to fix some troublesome issues related to "Sphinx":
98
+
99
+ * Added a ``masterpiece/config`` folder for files common to all Masterpiece plugins and applications.
100
+
101
+ * The Sphinx ``docs/Makefile`` moved into ``config/sphinx.mak`` to avoid duplicating the same file across multiple
102
+ projects. The makefile copies the standard .rst files (e.g., README.rst) to the ``docs/source/`` folder.
103
+ The issue was that Sphinx requires all image paths to be relative to its conf.py file, which breaks the concept
104
+ of reusable documents.
105
+
106
+ * The configuration file ``config/sphinxconf.py`` contains definitions common to all projects built on the
107
+ masterpiece framework. This file can be imported into the project-specific conf.py files, which now only need
108
+ to define the project name, again avoiding brain dead copying of the same file across multiple projects.
109
+
110
+ * CI ``ci-master/*yaml`` scripts define the MPHOME environment variable, allowing projects built on top of the
111
+ Masterpiece framework to refer to the config files.
112
+
113
+
114
+
115
+ [0.1.22] February 2 2025
116
+ --------------------------
117
+
118
+ * ``ci-templates/master-ci.yml`` checks whether ``examples/myapp.py`` exists before trying to build it.
119
+
120
+
121
+
122
+ [0.1.21] February 18 2025
123
+ --------------------------
124
+
125
+ * Fixed an issue where startup arguments and configuration files were loaded twice.
126
+
127
+ * Added a missing install_plugins() call to the examples/myhome.app example application.
128
+
129
+ * Resolved several mypy warnings in unit tests.
130
+
131
+
132
+
133
+
134
+
135
+ [0.1.20] February 16 2025
136
+ --------------------------
137
+
138
+ * ``--init --config [dir]`` failed if the directory did not already exist, and execution was terminated with
139
+ cannot write config file errors. Now, the application class checks if the directory exists and creates it if it doesn't.
140
+
141
+
142
+ [0.1.19] February 14 2025
143
+ --------------------------
144
+
145
+ * Timezone bug in ``timeutils.timestamptostr()`` fixed.
146
+
147
+
148
+
149
+ [0.1.18] February 08 2025
150
+ --------------------------
151
+
152
+ * A few log messages have been removed, the code works and the logs provide no additional value.
153
+
154
+
155
+ [0.1.17] January 26 2025
156
+ -------------------------
157
+
158
+ * **Makefile:** Projects now have ``Makefile`` at their fingertips. There is a new file ``scripts/project.mak`` containing
159
+ commonly needed project level targets, e.g. mypy, package, install and upload.
160
+
161
+
162
+ [0.1.16] January 19 2025
163
+ -------------------------
164
+
165
+ * **ci-templates:** Two template pipelines defined: master-ci.yml and master-plugin-ci.yml, to define common
166
+ CI pipelines for all the projects built on the framework, and to eliminate copy & pasting the same code through
167
+ numerous packages.
168
+ * **UML Diagram:** The UML diagram defined in ``docs/source/index.rst`` updated. It now contains all the relevant
169
+ masterpiece classes.
170
+ * **Namespace-packaging:**. All the classes are now exposed via ``__init__.py``. This makes it easier for users
171
+ to import directly from the package itself, rather than having to navigate through submodules.
172
+
173
+
174
+ [0.1.12] 12.1.2025
175
+ -------------------
176
+
177
+ * Useless "Loading plugin ..." logging message fixed, it shows now the actual name of the loaded plugin class.
178
+ * Redundant "pyyaml" dependency removed from 'pyproject.toml'.
179
+
180
+
181
+
182
+ [0.1.11] 11.1.2025
183
+ -------------------
184
+
185
+ * New method `read_last_value()` added. Retrieves the most recent data point from a specified
186
+ time series measurement. The method allows the software to easily query its last known state
187
+ from the time series database, simplifying state recovery and continuity
188
+ across application restarts.
189
+
190
+
191
+
192
+ [0.1.10] 5.1.2025
193
+ ------------------
194
+
195
+ Nothing spectacular in this release—just a few minor bug fixes and improvements. The code appears to run
196
+ fine as part of my home automation project, with no issues detected. However, there's still a lot to be done
197
+ with type hinting and documentation.
198
+
199
+ * Fixed intermittent issues with VSCode and Sphinx integration. Added a sphinx target to the root 'Makefile'
200
+ as a workaround for when VSCode reports incorrect errors. Also removed some docstrings that appeared
201
+ perfectly fine to me but not to Sphinx (find myself wasting too much time searching for Sphinx/rst format-related bugs)
202
+ * Corrected syntax errors in .rst files. Linked the orphan tutorial.rst and plugintutorial.rst to the root document.
203
+ * Refactored the MasterPieceThread class for better modularity and code clarity.
204
+ * Fixed a few mypy warnings in unit tests.
205
+
206
+
207
+
208
+
209
+ [0.1.9] 3.1.2025
210
+ -----------------
211
+
212
+ * A couple of Pypi warnings sorted out.
213
+ * `MasterPieceThread` class supports Built-in tests (system-status).
214
+
215
+
216
+ [0.1.8] 30.12.2024
217
+ -------------------
218
+
219
+ **First 'Alpha' release:**
220
+
221
+ - Version elevated to 0.1.8 and Python Development Status elevated to 3 - Alpha.
222
+ - Obsolete Yaml dependencies removed from 'pyproject.toml'
223
+
224
+
225
+ [0.1.7] 30.12.2024
226
+ -------------------
227
+
228
+ **MasterPieceThread:** class added with. This class is both a `Thread` and `MasterPiece`, with
229
+ optional MQTT client for communication.
230
+
231
+
232
+
233
+ [0.1.6] 29.12.2024
234
+ -------------------
235
+
236
+ **Logging Level control :**
237
+
238
+ - Configuration files were read twice, fixed.
239
+
240
+ - Logging level can be controlled through -l (--log-level) startup arguments. accepts the
241
+ standard log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
242
+
243
+
244
+
245
+ **Interface to MQTT:**
246
+
247
+ - Added an interface to MQTT. The module `mqtt.py` implements two abstract base classes: `Mqtt` and `MqttMsg`.
248
+ These abstractions allow integration with any Mqtt pub-sub implementation, such as Paho Mosquitto.
249
+
250
+ Example of the API:
251
+
252
+ To publish:
253
+
254
+ .. code-block:: python
255
+
256
+ m = {
257
+ "tmp": {"value": 22.5}, # Room temperature value
258
+ "sensor": {
259
+ "vibration": True, # Vibration status
260
+ "motion": False, # Motion status
261
+ },
262
+ "unixtime": int(time.time()),
263
+ }
264
+
265
+ self.publish("mytopic", json.dumps(m), 1, True)
266
+
267
+ To subscribe:
268
+
269
+ .. code-block:: python
270
+
271
+ mqtt.subscribe("mytopic")
272
+
273
+
274
+ **Interface to Time Series:**
275
+
276
+ - Added an interface to time series databases. The module `timeseries.py` implements two abstract base classes:
277
+ `TimeSeries` and `Measurement`. These abstractions allow integration with any time series implementation, such as InfluxDB.
278
+
279
+ Example of the API:
280
+
281
+ .. code-block:: python
282
+
283
+ point = (
284
+ self.measurement("motion")
285
+ .tag("sensor", "livingroom")
286
+ .field("motion", motion)
287
+ .field("vibration", vibration)
288
+ .field("roomtemp", roomtemperature)
289
+ .time(epoc2utc(timestamp)) # Converts epoch to UTC timestamp
290
+ )
291
+ self.write(point)
292
+
293
+ Alternatively, you can use the `dict` data structure to record measurements:
294
+
295
+ .. code-block:: python
296
+
297
+ measurement: dict[str, Any] = {
298
+ "measurement": "motion",
299
+ "tag": {"sensor": "livingroom"},
300
+ "field": {
301
+ "motion": motion,
302
+ "vibration": vibration,
303
+ "roomtemp": roomtemperature
304
+ },
305
+ "time" : epoc2utc(timestamp),
306
+ }
307
+ self.write(measurement)
308
+
309
+
310
+
311
+ [0.1.4] 17.12.2024
312
+ -------------------
313
+
314
+ **stable-0.1.4:** New stable release with minor improvements and bug fixes:
315
+
316
+ - **Type-hinting:** completed and `py.typed` file added to indicate
317
+ that the package supports PEP 561 type hints.
318
+
319
+ - **PluginManager:** The `add()` method of the `Composite` class now accepts `None` as
320
+ a parameter. In such cases, it raises a `ValueException`.
321
+ For example, calling `self.add(self.instantiate_plugin_by_name("SomePlugin"))` will
322
+ now properly terminate the application if the plugin is not installed.
323
+
324
+ - **@override:** decorator imported from `typing_extensions` rather than from `typing`,
325
+ for Python 3.9 backward compatibility.
326
+
327
+ - **YamlFormat:** The YAML serialization format functionality has been removed from the core framework
328
+ and implemented as a separate plugin project, `masterpiece_yaml`.
329
+
330
+ - **Traversing the hierarchy:**
331
+
332
+ `URL` class: A new class for instance name-based identification of objects within hierarchical
333
+ tree structures.
334
+
335
+ `make_url()` Method: Generates hierarchical paths for any object in the instance hierarchy.
336
+
337
+ `resolve_url()` Method: Locates objects by their URL.
338
+
339
+ - **print():**
340
+
341
+ Method visualizing the instance hierarchy moved from the `example/myapp.py` to `application.py` base class. Originally initiated as a demonstrative piece of code, but turned out to be a valueble feature for any MasterPiece application.
342
+
343
+
344
+
345
+ [0.1.3] - 4.11.2024
346
+ -------------------
347
+
348
+ - **stable-0.1.3:** First release tagged with `stable` prefix. When a Git tag is prefixed
349
+ with stable, the masterpiece CD/CI pipeline deploys the package to the PyPI repository.
350
+
351
+ - **Development Status :: 2 - Pre-Alpha:** PyPi classifier elevated from Planning to Pre-Alpha
352
+
353
+
354
+ [0.1.0] - 3.11.2024
355
+ -------------------
356
+
357
+ - **Version elevated to 0.1.0:** The plugin API has been successfully tested with two separate plugins
358
+ and confirmed to work. Hooray!
359
+
360
+ - **classattrs_to_dict():** Who knew iterating over class attributes in Python could be so tricky?
361
+ Fixed—yes, really!
362
+
363
+
364
+ [0.0.9] - 2.11.2024
365
+ -------------------
366
+ - **Tutorial:** - Exceptionally well written world-class `tutorial <docs/source/tutorial.rst>`_
367
+ covering the basics and essential features, I hope.
368
+
369
+ - **Bug Fixes:**
370
+ - PlugMaster class attempted to instantiate classes not subclassed from the Plugin class.
371
+ - Exception when issubclass() was called with class that was not registered.
372
+ - several bugs fixed in both load_configuration() and save_configuration().
373
+ - save_configuration() failed to save because it opened the file for reading, fixed.
374
+ - is_abstract() class method removed, use inspect.isabstract() instead.
375
+
376
+
377
+ [0.0.7] - 1st 11.2024
378
+ ---------------------
379
+
380
+ - **Milestone Achieved**: Despite the modest version increment, this release
381
+ brings substantial structural, architectural, and functional improvements.
382
+ With the release of version 0.0.7, I’ve completed my first two major milestones
383
+ for the project — definitely a cause for celebration!
384
+
385
+ - **Directory Structure Finalized**: Removed the ``core`` directory; all
386
+ classes are now organized under ``masterpiece/masterpiece/*.py``.
387
+ (Feeling like I’m evolving from a C++ boomer to a proper Pythonista!)
388
+
389
+ - **@classproperty**: A decorator class implemented as a replacement
390
+ for Python's decision to deprecate the combination of ``@classmethod`` and
391
+ ``@property``. This decorator addresses the fundamental principle of object-oriented
392
+ programming: any software is essentially composed of code and data (attributes
393
+ and methods), which can be either class-specific or instance-specific. Given this,
394
+ it is logical to have `@property` for instance-specific attributes and
395
+ `@classproperty` for class-specific attributes.
396
+
397
+ - **Serialization API Finalized**: Decoupled hard-coded JSON serialization,
398
+ implementing it as a separate ``JsonFormat`` class. This is the default
399
+ serialization format for the ``Application`` class decoupling also the format
400
+ from the stream: any data can be formatted to any stream.
401
+
402
+ - **YamlFormat Added**: Implemented YAML serialization format, which can be selected
403
+ with the startup option ``--application_serialization_form YamlFormat``.
404
+
405
+ - **Logging Improved**: Supports both class and instance methods, enabling
406
+ both ``Foo.log_error(...)`` and ``foo.error(...)`` syntax.
407
+
408
+ - **Unit Tests Enhanced**: Coverage significantly improved, now reaching
409
+ approximately 90%.
410
+
411
+
412
+
413
+ [0.0.6] - 26.10.2024
414
+ --------------------
415
+
416
+ - **Code and Data Decoupling**: Hardcoded `print()` methods have been removed
417
+ from core classes and re-implemented using the new `do()` method.
418
+
419
+ - **ArgMaestro**: A class for fully automated class attribute initialization
420
+ through startup arguments. Allows any public class attribute to be
421
+ initialized using the `--classname_attributename [value]` convention.
422
+ The class name is admittedly ridiculous, consider changing it.
423
+
424
+ - **Unit Test Coverage Improved**: Unit tests have been enhanced to a level
425
+ where they provide meaningful test coverage.
426
+
427
+ - **Logging Typos Fixed**: All strings have been proofread and typos corrected.
428
+
429
+
430
+ [0.0.5] - 20.10.2024
431
+ --------------------
432
+
433
+ - **New startup argument --init**: If given, all classes in the application
434
+ will create configuration files for their class attributes, if those files
435
+ don't already exist. These configuration files allow users to define custom
436
+ values for all public class attributes.
437
+
438
+ - **Rotating Logs**: The FileHandler has been replaced with
439
+ TimedRotatingFileHandler, initialized with parameters `when='midnight'`,
440
+ `interval=1`, and `backupCount=7` to rotate the log file daily and keep 7
441
+ backup files. This change resolves the issue of log files growing
442
+ indefinitely, which could eventually lead to the system running out of
443
+ disk space.
444
+
445
+ - **Documentation Refactored**: All .rst files have been moved from Sphinx's
446
+ docs/source directory to the project root folder for GitLab compatibility.
447
+
448
+ - **Time Functions**: The methods `epoc2utc()`, `timestamp()`, `epoc2utc()`
449
+ and a few others removed. These were not actually methods of the Masterpiece
450
+ class since they did not require any instance attributes. More importantly,
451
+ this change aims to keep the Masterpiece framework focused on its core
452
+ functionality.
453
+
454
+
455
+ [0.0.4] - October 18, 2024
456
+ --------------------------
457
+
458
+ - **MasterPiece**: Undefined class attribute `_class_id`, added.
459
+ - **MetaMasterPiece Refactored**: Replaced with a more lightweight
460
+ `__init_subclass__()` solution, with special thanks to Mahi for his
461
+ contribution.
462
+ - **Plugin Class Abstracted**: The plugin class is now subclassed from `ABC`
463
+ to formally implement an abstract base class.
464
+ - **Pylint Warnings Resolved**: Fixed issues such as long lines, which have
465
+ been split for better readability.
466
+ - **Docstrings Improved**: Added more comprehensive documentation with a
467
+ professional tone for several methods.
468
+
469
+
470
+ [0.0.3] - October 12, 2024
471
+ --------------------------
472
+
473
+ - **From C++ boomer to Python professional**: Directory structure simplified:
474
+
475
+ - `src` folder removed
476
+ - `masterpiece/base` folder renamed to `masterpiece/core`
477
+ - `plugins` folder moved outside the project, will be implemented as a
478
+ separate project (one project - one repository principle)
479
+ - Minor additions and improvements to Docstrings.
480
+
481
+
482
+ [0.0.2] - October 10, 2024
483
+ --------------------------
484
+
485
+ - **GitLab Ready**: Revised documentation tone slightly to reflect a more
486
+ professional and serious nature. Removed excessive humor that may have
487
+ detracted from the perceived professionalism of the toolkit.
488
+
489
+
490
+ [0.0.1] - August 4, 2024
491
+ ------------------------
492
+
493
+ Pip release with Python pip package uploaded.
494
+
495
+ New Features and Improvements:
496
+
497
+ - **Trademark**: Cool (not?) slogan: Masterpiece - Quite a piece of work
498
+ - **Plugin API**: Enhanced the plugin API with two classes: `Plugin` and
499
+ `PlugMaster` with compatibility with Python versions 3.8 and later.
500
+ The most recent version tested is 3.12.
501
+ - **Meta-Class Automation**: Per-class bureaucracy automated using Python's
502
+ meta-class concept.
503
+ - **Folder Structure**: Redesigned for future expansion. There is now separate
504
+ root folders for core and plugin modules.
505
+ - **Base Class**: Added new base class for MasterPiece applications in
506
+ `base/application.py`.
507
+ - **Example Application**: Added `examples/myhome.py` to demonstrate the
508
+ general structure of MasterPiece applications.
509
+ - **Startup Argument Parsing**: Added API for parsing startup arguments.
510
+ - **Serialization API**: Fully featured serialization with backward
511
+ compatibility support implemented.
512
+ - **Documentation**: Added comprehensive docstrings to numerous classes,
513
+ aiming for fully documented professional Python code.
514
+ - **Type Annotations**: Added type annotations to numerous previously
515
+ non-typed method arguments, moving towards a fully typed Python code.
516
+ - **Sphinx conf.py**: Created default Sphinx `conf.py` file in the
517
+ `masterpiece/sphinx` folder.
518
+ - **Bug Fixes and Improvements**:
519
+
520
+ - Added `encoding="utf-8"` to `open()` calls
521
+ - Added `exclude __pycache__` to MANIFEST.in, to avoid including the folders
522
+ with the setup.
523
+
524
+
525
+ [0.0.0] - May 31, 2024
526
+ ----------------------
527
+
528
+ Initial, private release (minimal set of classes unified from the RTE and
529
+ JUHAM Python applications).
530
+
531
+ - **Base Class Draft**: Initial version of the `MasterPiece` and `Composite`
532
+ classes.
533
+ - **Python Packaging**: Python package infrastructure setup using
534
+ `pyproject.toml`, installable via pip.
535
+ - **Documentation**:
536
+
537
+ - Added LICENSE, README, and other standard files in .rst format.
538
+ - Developer documentation autogenerated with Sphinx toolset. Support for
539
+ Doxygen dropped.
540
+ - **Project Name**: Named the project 'MasterPieceā„¢', with a note that 'M'
541
+ currently stands for mission rather than masterpiece.
542
+ - **Miscellaneous**: Some unconventional use of the Python programming
543
+ language.
@@ -0,0 +1,45 @@
1
+ Contributing
2
+ ============
3
+
4
+
5
+ Thank You!
6
+ ----------
7
+
8
+ Thank you in advance for your forthcoming contributions, whether they are bug fixes,
9
+ documentation improvements, entirely new features, or simply feedback. Your efforts
10
+ will be highly appreciated and will help turn this project from its current mission
11
+ state into an actual masterpiece.
12
+
13
+
14
+ Design Patterns
15
+ ---------------
16
+
17
+ Please read the developer documentation and understand the few design patterns before contributing.
18
+ This will help ensure that your contributions align with the project's design and goals.
19
+ .. todo:: (okay, the documentation is currently lacking many essential chapters, add.)
20
+
21
+
22
+ Code Formatting
23
+ ---------------
24
+
25
+ To help maintain consistent code formatting across different developers, we use 'black' python formatter, by Microsoft.
26
+
27
+ Strange, the formatter doesn't seem to do that much, it doesn't organize imports,
28
+ doesn't adjust docstring lenghts
29
+ .. todo:: most likely I don't know how to use it properly, read the docs.
30
+
31
+
32
+ Using Emacs and Makefile
33
+ ------------------------
34
+
35
+ Despite my attempts to fall in love with Eclipse, VSCode and other IDEs, I still find Emacs and Makefile the best
36
+ tools for many of my workflows.
37
+ So there is a Makefile in the root folder. For those old dogs who are like me
38
+ ::
39
+
40
+ make help
41
+
42
+ Unit tests
43
+ ----------
44
+ .. todo:: write unit tests
45
+
@@ -0,0 +1,22 @@
1
+ MIT License
2
+ ===========
3
+
4
+ Copyright (c) 2024, Juha Meskanen
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+
@@ -0,0 +1,21 @@
1
+ include *.py
2
+ include *.rst
3
+ include *.yml
4
+ include Makefile
5
+ include mypy.ini
6
+ include LICENSE.rst
7
+ include README.rst
8
+ recursive-include docs Makefile
9
+ recursive-include examples *
10
+ recursive-include config *
11
+ recursive-include ci-templates *
12
+ recursive-include tests *
13
+ recursive-include docs *.html *.conf *.rst *.py *.css *.png
14
+ recursive-include docs/build *.html *.conf *.rst *.py *.css *.png
15
+
16
+ # Exclude
17
+ global-exclude __pycache__/*
18
+ global-exclude *.pyc
19
+ global-exclude *.pyo
20
+ global-exclude *~
21
+ global-exclude \#*
@@ -0,0 +1,3 @@
1
+ PROJECT=masterpiece
2
+
3
+ include config/project.mak