holado 0.2.1__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.

Potentially problematic release.


This version of holado might be problematic. Click here for more details.

@@ -0,0 +1,19 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ #################################################
4
+ # HolAdo (Holistic Automation do)
5
+ #
6
+ # (C) Copyright 2021-2025 by Eric Klumpp
7
+ #
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ # The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
13
+ #################################################
14
+
15
+
16
+ def initialize_loggers():
17
+ import holado.common.tools.gc_manager
18
+ holado.common.tools.gc_manager.initialize_logger()
19
+
@@ -0,0 +1,155 @@
1
+
2
+ #################################################
3
+ # HolAdo (Holistic Automation do)
4
+ #
5
+ # (C) Copyright 2021-2025 by Eric Klumpp
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ #
9
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ # The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
12
+ #################################################
13
+
14
+ import logging
15
+ from builtins import object
16
+ import threading
17
+ import gc
18
+ from holado.common.handlers.undefined import default_value
19
+
20
+ logger = None
21
+ default_collect_periodicity = 10
22
+
23
+ def initialize_logger():
24
+ global logger
25
+ logger = logging.getLogger(__name__)
26
+
27
+
28
+ class GcManager(object):
29
+ """
30
+ Manage Garbage Collector
31
+
32
+ Note: When working with HolAdo, it is highly recommended to call collect_periodically method at process start in order to avoid deadlocks.
33
+ This is done by default in holado.initialize method.
34
+ Explanation:
35
+ HolAdo is using object finalizers (define __del__ methods) to properly release objects resources.
36
+ But in current garbage collector default mecanism, objects are technically finalized (call of __del__) in any yielded thread.
37
+ Thus, depending on what thread is doing when an object is finalized, a deadlock can occur.
38
+ Example: current thread is logging a message, garbage collector is finalizing an object in this thread when logger flushes its stream,
39
+ and object finalizer tries to log an other message => it results to a deadlock in logging library in its lock mecanism.
40
+ """
41
+
42
+ # Manage running and pended collect
43
+ __collect_run_lock = threading.Lock()
44
+ __is_collect_running = False
45
+ __is_collect_pending = False
46
+ __duration_until_pended_collect = default_collect_periodicity
47
+
48
+ # Manage scheduled collect as timer
49
+ __collect_timer_lock = threading.RLock()
50
+ __collect_periodicity = None
51
+ __collect_timer = None
52
+ __collect_timer_at = None
53
+
54
+ @classmethod
55
+ def is_collect_threaded(cls):
56
+ return cls.__collect_periodicity is not None
57
+
58
+ @classmethod
59
+ def get_collect_periodicity(cls):
60
+ return cls.__collect_periodicity
61
+
62
+ @classmethod
63
+ def collect_periodically(cls, collect_periodicity=default_value):
64
+ """
65
+ Call this method to periodically process gargage collector collect.
66
+ By calling this method, default behaviour of garbage collector is disabled.
67
+ """
68
+ gc.disable()
69
+ with cls.__collect_timer_lock:
70
+ cls.__collect_periodicity = default_collect_periodicity if collect_periodicity is default_value else collect_periodicity
71
+ cls.__schedule_next_timer(cls.__collect_periodicity)
72
+
73
+ @classmethod
74
+ def collect(cls, max_duration_until_next_collect_in_seconds=default_value):
75
+ max_duration = default_collect_periodicity if max_duration_until_next_collect_in_seconds is default_value else max_duration_until_next_collect_in_seconds
76
+
77
+ with cls.__collect_run_lock:
78
+ # If a collect is already pended, update duration until pended collect
79
+ if cls.__is_collect_pending:
80
+ if max_duration < cls.__duration_until_pended_collect:
81
+ cls.__duration_until_pended_collect = max_duration
82
+ return
83
+ # If a collect is already running, pend a collect
84
+ if cls.__is_collect_running:
85
+ cls.__is_collect_pending = True
86
+ cls.__duration_until_pended_collect = max_duration
87
+ return
88
+
89
+ # Else schedule next collect
90
+ with cls.__collect_timer_lock:
91
+ if cls.__collect_timer is not None:
92
+ cls.__schedule_next_timer(max_duration_until_next_collect_in_seconds)
93
+ else:
94
+ cls.__schedule_next_timer(0)
95
+
96
+ @classmethod
97
+ def __collect(cls):
98
+ # Start running
99
+ with cls.__collect_run_lock:
100
+ cls.__is_collect_running = True
101
+
102
+ # Process collect
103
+ gc.collect()
104
+
105
+ # Schedule next timer
106
+ duration_until_next_collect = None
107
+ with cls.__collect_run_lock:
108
+ if cls.__is_collect_pending:
109
+ duration_until_next_collect = cls.__duration_until_pended_collect
110
+ with cls.__collect_timer_lock:
111
+ if cls.__collect_periodicity is not None:
112
+ if duration_until_next_collect is None:
113
+ duration_until_next_collect = cls.__collect_periodicity
114
+ else:
115
+ duration_until_next_collect = min(duration_until_next_collect, cls.__collect_periodicity)
116
+
117
+ cls.__schedule_next_timer(duration_until_next_collect)
118
+
119
+ # Stop running
120
+ with cls.__collect_run_lock:
121
+ cls.__is_collect_running = False
122
+ # Reinitialize pending variables
123
+ cls.__is_collect_pending = False
124
+ cls.__duration_until_pended_collect = default_collect_periodicity
125
+
126
+ @classmethod
127
+ def __schedule_next_timer(cls, duration_until_next_collect_seconds):
128
+ import holado_multitask.multithreading.timer as mmt
129
+ from holado_multitask.multitasking.multitask_manager import MultitaskManager
130
+ from holado_python.common.tools.datetime import DateTime, DurationUnit
131
+ from holado_python.common.enums import ArithmeticOperator
132
+
133
+ if duration_until_next_collect_seconds is default_value:
134
+ duration_until_next_collect_seconds = default_collect_periodicity
135
+
136
+ with cls.__collect_timer_lock:
137
+ if duration_until_next_collect_seconds is not None:
138
+ now = DateTime.now()
139
+ next_timer_at = DateTime.apply_delta_on_datetime(now, ArithmeticOperator.Addition, duration_until_next_collect_seconds, DurationUnit.Second)
140
+
141
+ if cls.__collect_timer_at is not None and cls.__collect_timer_at > now and next_timer_at > cls.__collect_timer_at:
142
+ # Current scheduled collect is not running and will occur before newly schedule, it is preserved
143
+ return
144
+ elif cls.__collect_timer_at is not None:
145
+ # Current scheduled collect is canceled and replaced
146
+ cls.__collect_timer.cancel()
147
+
148
+ # Schedule timer with given duration
149
+ cls.__collect_timer = mmt.Timer("GcManager-collect", duration_until_next_collect_seconds, cls.__collect, register_scope=MultitaskManager.SESSION_SCOPE_NAME)
150
+ cls.__collect_timer.start()
151
+ cls.__collect_timer_at = next_timer_at
152
+ else:
153
+ cls.__collect_timer = None
154
+ cls.__collect_timer_at = None
155
+
@@ -0,0 +1,41 @@
1
+
2
+ #################################################
3
+ # HolAdo (Holistic Automation do)
4
+ #
5
+ # (C) Copyright 2021-2025 by Eric Klumpp
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ #
9
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ # The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
12
+ #################################################
13
+
14
+
15
+ class Config(object):
16
+ """HolAdo project configuration"""
17
+
18
+ # Timeouts
19
+ timeout_seconds = 240 # Default timeout
20
+ join_timeout_seconds = 1800 # Long timeout used when a join should stop without deadlock. When this timeout is reached, a TimeoutTechnicalException is raised
21
+
22
+ # Message
23
+ message_truncate_length = 500 # Length used to truncate a message when it is too long. When a message is truncated, it is suffixed by '...'
24
+
25
+ # Time analysis
26
+ threshold_warn_time_spent_s = 10 # Duration in seconds that triggers a warning on spent time
27
+
28
+ # Redo
29
+ redo_wait_process_min_interval_s = 0.001 # In redo, minimal duration to sleep between two verification of process thread end
30
+ redo_wait_process_max_interval_s = 0.1 # In redo, maximal duration to sleep between two verification of process thread end
31
+
32
+ # Unique values
33
+ unique_string_padding_length = 6 # Number of characters used to generate a unique text suffix
34
+
35
+ # Symbols
36
+ DYNAMIC_SYMBOL = u"%"
37
+ THREAD_DYNAMIC_SYMBOL = u"@"
38
+ UNIQUE_SYMBOL = u"#"
39
+ NOT_APPLICABLE_SYMBOL = u"N/A"
40
+ NONE_SYMBOL = u"None"
41
+
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: holado
3
+ Version: 0.2.1
4
+ Summary: HolAdo framework
5
+ Project-URL: Homepage, https://gitlab.com/holado_framework/python
6
+ Project-URL: Issues, https://gitlab.com/holado_framework/python/-/issues
7
+ Author-email: Eric Klumpp <eric.klumpp@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: AIS,BDD,Behavior Driver Development,Behaviour Driven Development,DB,Protobuf,REST,RabbitMQ,Redis,S3,Specification By Example,Web Services,YAML,automation,docker,functional test,gRPC,logging,multitask,script,test,test automation
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: behave==1.2.7.dev6
19
+ Requires-Dist: python-dateutil
20
+ Provides-Extra: ais
21
+ Requires-Dist: pyais; extra == 'ais'
22
+ Provides-Extra: db
23
+ Requires-Dist: pypika; extra == 'db'
24
+ Provides-Extra: db-postgresql
25
+ Requires-Dist: psycopg; extra == 'db-postgresql'
26
+ Provides-Extra: docker
27
+ Requires-Dist: docker; extra == 'docker'
28
+ Provides-Extra: helper-debug
29
+ Requires-Dist: pympler; extra == 'helper-debug'
30
+ Provides-Extra: protobuf-grpc
31
+ Requires-Dist: google; extra == 'protobuf-grpc'
32
+ Requires-Dist: google-api-core; extra == 'protobuf-grpc'
33
+ Requires-Dist: grpc-requests; extra == 'protobuf-grpc'
34
+ Requires-Dist: grpcio; extra == 'protobuf-grpc'
35
+ Requires-Dist: grpcio-reflection; extra == 'protobuf-grpc'
36
+ Requires-Dist: grpcio-tools; extra == 'protobuf-grpc'
37
+ Requires-Dist: protobuf; extra == 'protobuf-grpc'
38
+ Provides-Extra: rabbitmq
39
+ Requires-Dist: pika; extra == 'rabbitmq'
40
+ Provides-Extra: redis
41
+ Requires-Dist: redis; extra == 'redis'
42
+ Requires-Dist: redis-om; extra == 'redis'
43
+ Provides-Extra: s3
44
+ Requires-Dist: boto3; extra == 's3'
45
+ Requires-Dist: flask; extra == 's3'
46
+ Requires-Dist: flask-cors; extra == 's3'
47
+ Requires-Dist: minio; extra == 's3'
48
+ Requires-Dist: moto; extra == 's3'
49
+ Provides-Extra: sftp
50
+ Requires-Dist: pysftp; extra == 'sftp'
51
+ Requires-Dist: sftpserver; extra == 'sftp'
52
+ Provides-Extra: ws-suds
53
+ Requires-Dist: suds; extra == 'ws-suds'
54
+ Provides-Extra: ws-zeep
55
+ Requires-Dist: zeep; extra == 'ws-zeep'
56
+ Provides-Extra: yaml
57
+ Requires-Dist: pyyaml; extra == 'yaml'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # HolAdo (Holistic Automation do)
61
+
62
+ # HolAdo
63
+
64
+ HolAdo, or Holistic Automation do, gives a road to holistic automation in software development.
65
+ It's aim is to facilitate many actions by unifying in one framework all needed modules.
66
+ Each module delivers a specific need, and it is generally internally using another framework focussed on this need.
67
+
68
+ HolAdo framework makes it easy to build a solution with many capabilities.
69
+ Historically, it was created to easily build powerful functional testing solutions.
70
+ But it's conception allows to use it in any context, by integrating only needed HolAdo modules.
71
+
72
+ In order to improve transparency and maintainability of built solution,
73
+ the Gherkin language is used as a meta-language humanly readable.
74
+ Each module includes dedicated steps to easily write scenarios (for testing) or processes (for configuration, deployment,...).
75
+
76
+
77
+ # Status
78
+
79
+ HolAdo can be used as is, it is stable and maintained.
80
+
81
+ Until v1.0.0, it is still considered under construction, it is regularly refactored with breaking changes.
82
+
83
+ To facilitate it's use, each breaking change will result to a new middle version 0.X.0, so that you can update minor versions without problem.
84
+
85
+
86
+ # Python
87
+
88
+ HolAdo project for Python development.
89
+ Python is currently the only one supported language.
90
+
91
+ Currently, main available modules are:
92
+ * ais: manage AIS data
93
+ * binary: manipulate binary data, like bit series
94
+ * db: manage DB actions (clients, query)
95
+ * docker: manage Docker actions
96
+ * grpc: manage gRPC clients
97
+ * helper: many helpers to easily use HolAdo possibilities (ex: build script/executable using Gherkin language outside of testing context, like to write automatic processes with pseudo code)
98
+ * json: manipulate JSON data
99
+ * keycloak: a Keycloak client
100
+ * logging: add logging capabilities
101
+ * multitask: manage multithreading and multiprocessing
102
+ * protobuf: manage Protobuf
103
+ * python: some tools over python libraries
104
+ * rabbitmq: manage RabbitMQ
105
+ * redis: manage Redis clients
106
+ * report: manage reporting
107
+ * rest: manage REST clients
108
+ * s3: manage S3 clients
109
+ * scripting: add scripting capabilities in other modules
110
+ * sftp: manage sFTP clients
111
+ * system: manage system actions
112
+ * test: core module for testing capability (currently, only BDD tool "behave" is supported)
113
+ * value: manage values (like tables with scripting capabilities)
114
+ * ws: manage Web Service clients
115
+
116
+ Major upcomming capabilities:
117
+ * WebUI interactions (with playright or selenium)
118
+
119
+
120
+ # Community
121
+
122
+ A community around HolAdo is under construction.
123
+
124
+ For the moment you can contact me by email (eric.klumpp@gmail.com).
125
+
126
+ For any support, please write scenarios (executable with 'behave') illustating your problem:
127
+ * If you encounter a bug, scenarios reproducing the bug.
128
+ * If you need an evolution, scenarios illustrating the expected behavior.
129
+
130
+ If you have implemented a new module, please send it to me, and I will include it in HolAdo framework.
131
+
132
+ <!--
133
+
134
+ # Howto run HolAdo non-regression tests from docker image got from registry.gitlab.com
135
+
136
+ Note: Read HolAdo non-regression tests is a good way to discover its capabilities.
137
+
138
+ * docker login -u XXX registry.gitlab.com
139
+ * docker pull registry.gitlab.com/holado_framework/python:main
140
+ * docker run --rm -it registry.gitlab.com/holado_framework/python:main /bin/sh -c "cd /code/holado/python; ./run_test_nonreg.sh"
141
+
142
+ -->
143
+
@@ -0,0 +1,17 @@
1
+ holado/__init__.py,sha256=-MWoSieByPmA6IB29KbUhp_nIhu1SzksgRrGfZmvP0w,12497
2
+ holado/holado_config.py,sha256=v6qmTYcO50Gjtq7jwpcVp79HMeWuf2wZCGLlKDaDFc8,2369
3
+ holado/common/__init__.py,sha256=ZjXM-FRQgnfzRNXqcvJOGewDHVRR-U5-ugStSs8U2Xs,1525
4
+ holado/common/context/__init__.py,sha256=3jJBLm8myrYF9jbdV1EhIA6BtnlmjX33eeoDpTzwmLA,1604
5
+ holado/common/context/context.py,sha256=XPrdZw_9j096AI9EZwMT4xVd58c1ZH6VGxT5Yb-qYYU,6660
6
+ holado/common/context/service_manager.py,sha256=HBmeyzeerkQX-IUvctcXJQEOtPWZ8lsPZhTy9EZjPXo,13652
7
+ holado/common/context/session_context.py,sha256=ejCxO-q_tD2RwI0AExpd9wzVbE8Q9K_ztZ5_BGPrLL8,21280
8
+ holado/common/handlers/__init__.py,sha256=d0KDUpaAAw1eBXyX08gaRh4RECnJlXjYQ0TcU-Ndicc,1372
9
+ holado/common/handlers/enums.py,sha256=ieqKVoukEiNyfE3KrKmMOImdbFS1ocUMud8JHe2xNLs,1662
10
+ holado/common/handlers/object.py,sha256=SACbrBveQUebE4DQO0VaCMFNGgAKOfFnLy2RGQF4IFg,5745
11
+ holado/common/handlers/undefined.py,sha256=a1Jq2yrRd0UjJqZndj8ZTLpg5e6FlFn3Cc5uMfkbnBM,1859
12
+ holado/common/tools/__init__.py,sha256=z-T6zX_tOVkJjniTDA0KSKmdtosjfEhjaNa1-3g8wTs,1374
13
+ holado/common/tools/gc_manager.py,sha256=TjQg7MisGRhxuiQ22hB3IuqNhnWCVEWpU253-rOjR0w,7611
14
+ holado-0.2.1.dist-info/METADATA,sha256=fmRHxpTw_mZGxnoY4TTYXZr5QZZ91tY17SMAAk2DYeA,5703
15
+ holado-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ holado-0.2.1.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
17
+ holado-0.2.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 by Eric Klumpp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.