everysk-lib 1.10.0__cp312-cp312-musllinux_1_2_x86_64.whl → 1.10.1__cp312-cp312-musllinux_1_2_x86_64.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.
- everysk/core/undefined.py +25 -29
- everysk/sdk/entities/worker_execution/settings.py +2 -1
- everysk/sql/connection.py +19 -0
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/METADATA +3 -3
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/RECORD +9 -9
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/WHEEL +1 -1
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/.gitignore +0 -0
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/licenses/LICENSE.txt +0 -0
- {everysk_lib-1.10.0.dist-info → everysk_lib-1.10.1.dist-info}/top_level.txt +0 -0
everysk/core/undefined.py
CHANGED
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
from typing import Any, Self
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
# UndefinedType Class Implementation
|
|
15
|
-
###############################################################################
|
|
16
|
-
# Do not use this class, use the constant Undefined.
|
|
17
|
-
###############################################################################
|
|
13
|
+
## Do not use this class, use the constant Undefined that is already defined in the python builtins. ##
|
|
18
14
|
class UndefinedType:
|
|
19
|
-
"""
|
|
15
|
+
"""
|
|
16
|
+
The UndefinedType class is used to represent an undefined value in the Everysk framework.
|
|
17
|
+
This class is designed to be immutable and to always represent the same undefined value.
|
|
18
|
+
We use it as default values for function parameters and class attributes to indicate that
|
|
19
|
+
the value is not set and to differentiate it from None or other possible values.
|
|
20
|
+
"""
|
|
21
|
+
|
|
20
22
|
default_error_message = 'This object is immutable.'
|
|
21
23
|
default_parse_string = '__UNDEFINED_VALUE__'
|
|
22
24
|
default_repr_string = '<Undefined value>'
|
|
@@ -26,49 +28,43 @@ class UndefinedType:
|
|
|
26
28
|
if self.block:
|
|
27
29
|
raise NotImplementedError('Do not use this class, use the constant Undefined.')
|
|
28
30
|
|
|
29
|
-
def __bool__(self):
|
|
30
|
-
"""
|
|
31
|
+
def __bool__(self) -> bool:
|
|
32
|
+
"""Undefined object is always False"""
|
|
31
33
|
return False
|
|
32
34
|
|
|
33
35
|
def __copy__(self) -> Self:
|
|
34
|
-
"""
|
|
35
|
-
To keep consistence, this object will always be the same.
|
|
36
|
-
"""
|
|
36
|
+
"""To keep consistence, this object will always be the same."""
|
|
37
37
|
return self
|
|
38
38
|
|
|
39
|
-
def __delattr__(self,
|
|
40
|
-
"""
|
|
39
|
+
def __delattr__(self, name: str) -> None:
|
|
40
|
+
"""We could not delete attributes from this object."""
|
|
41
41
|
raise AttributeError(self.default_error_message)
|
|
42
42
|
|
|
43
|
-
def __deepcopy__(self, memo: dict = None) -> Self:
|
|
44
|
-
"""
|
|
45
|
-
To keep consistence, this object will always be the same.
|
|
46
|
-
"""
|
|
43
|
+
def __deepcopy__(self, memo: dict | None = None) -> Self:
|
|
44
|
+
"""To keep consistence, this object will always be the same."""
|
|
47
45
|
return self
|
|
48
46
|
|
|
49
|
-
def __eq__(self,
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
"""
|
|
53
|
-
return isinstance(__value, type(self))
|
|
47
|
+
def __eq__(self, value: object) -> bool:
|
|
48
|
+
"""For an object created from the UndefinedType class to be equal to another, the classes must be equal."""
|
|
49
|
+
return isinstance(value, type(self))
|
|
54
50
|
|
|
55
|
-
def __getattr__(self,
|
|
56
|
-
"""
|
|
51
|
+
def __getattr__(self, name: str) -> Any:
|
|
52
|
+
"""Undefined object don't have attributes."""
|
|
57
53
|
raise AttributeError(self.default_error_message)
|
|
58
54
|
|
|
59
55
|
def __hash__(self) -> int:
|
|
60
|
-
"""
|
|
56
|
+
"""Must return an int that is used as hash for this object."""
|
|
61
57
|
return id(self)
|
|
62
58
|
|
|
63
59
|
def __repr__(self) -> str:
|
|
64
|
-
"""
|
|
60
|
+
"""Fixed to be the same every time."""
|
|
65
61
|
return self.default_repr_string
|
|
66
62
|
|
|
67
|
-
def __setattr__(self,
|
|
68
|
-
"""
|
|
63
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
64
|
+
"""We can't set any attribute to this object."""
|
|
69
65
|
if self.block:
|
|
70
66
|
raise AttributeError(self.default_error_message)
|
|
71
67
|
|
|
72
68
|
def __str__(self) -> str:
|
|
73
|
-
"""
|
|
69
|
+
"""Fixed to be the same every time."""
|
|
74
70
|
return self.default_repr_string
|
|
@@ -24,7 +24,8 @@ WORKER_EXECUTION_STATUS_COMPLETED = StrField(default='COMPLETED', readonly=True)
|
|
|
24
24
|
WORKER_EXECUTION_STATUS_FAILED = StrField(default='FAILED', readonly=True)
|
|
25
25
|
WORKER_EXECUTION_STATUS_PREPARING = StrField(default='PREPARING', readonly=True)
|
|
26
26
|
WORKER_EXECUTION_STATUS_RUNNING = StrField(default='RUNNING', readonly=True)
|
|
27
|
-
|
|
27
|
+
WORKER_EXECUTION_STATUS_TIMEOUT = StrField(default='TIMEOUT', readonly=True)
|
|
28
|
+
WORKER_EXECUTION_STATUS_LIST = ListField(default=['COMPLETED', 'FAILED', 'PREPARING', 'RUNNING', 'TIMEOUT'], readonly=True)
|
|
28
29
|
|
|
29
30
|
WORKER_EXECUTION_INTEGRATION_EVENT_TYPE = StrField(default='INTEGRATION_EVENT', readonly=True)
|
|
30
31
|
WORKER_EXECUTION_SCHEDULER_EVENT_TYPE = StrField(default='SCHEDULER_EVENT', readonly=True)
|
everysk/sql/connection.py
CHANGED
|
@@ -45,6 +45,18 @@ class ConnectionPool(_ConnectionPool):
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class Transaction:
|
|
48
|
+
"""
|
|
49
|
+
Context manager for PostgreSQL transactions.
|
|
50
|
+
|
|
51
|
+
Usage:
|
|
52
|
+
|
|
53
|
+
>>> from everysk.sql.connection import Transaction, execute
|
|
54
|
+
>>> with Transaction():
|
|
55
|
+
... result = execute("SELECT * FROM my_table WHERE id = %s", params={"id": 1})
|
|
56
|
+
... # Perform other database operations within the transaction
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
|
|
48
60
|
## Private attributes
|
|
49
61
|
_connection: Connection
|
|
50
62
|
_pool: ConnectionPool
|
|
@@ -88,6 +100,13 @@ def make_connection_dsn(
|
|
|
88
100
|
Create a PostgreSQL connection DSN from settings.
|
|
89
101
|
Supports both TCP and Unix socket connections.
|
|
90
102
|
If parameters are provided, they override the settings.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
host (str | None): The database host. If None, uses the setting.
|
|
106
|
+
port (int | None): The database port. If None, uses the setting.
|
|
107
|
+
user (str | None): The database user. If None, uses the setting.
|
|
108
|
+
password (str | None): The database password. If None, uses the setting.
|
|
109
|
+
database (str | None): The database name. If None, uses the setting.
|
|
91
110
|
"""
|
|
92
111
|
options: dict[str, str | int] = {
|
|
93
112
|
'host': host or settings.POSTGRESQL_CONNECTION_HOST,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: everysk-lib
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.1
|
|
4
4
|
Summary: Generic lib to share python code on Everysk.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
Project-URL: Homepage, https://everysk.com/
|
|
@@ -104,9 +104,9 @@ Requires-Dist: httpx==0.28.1; extra == "httpx"
|
|
|
104
104
|
Provides-Extra: paramiko
|
|
105
105
|
Requires-Dist: bcrypt==4.2.0; extra == "paramiko"
|
|
106
106
|
Requires-Dist: pycparser==2.22; extra == "paramiko"
|
|
107
|
-
Requires-Dist: cffi==
|
|
107
|
+
Requires-Dist: cffi==2.0.0; extra == "paramiko"
|
|
108
108
|
Requires-Dist: cryptography==44.0.1; extra == "paramiko"
|
|
109
|
-
Requires-Dist: pynacl==1.
|
|
109
|
+
Requires-Dist: pynacl==1.6.2; extra == "paramiko"
|
|
110
110
|
Requires-Dist: paramiko==3.5.0; extra == "paramiko"
|
|
111
111
|
Provides-Extra: everysk-orjson
|
|
112
112
|
Requires-Dist: everysk-orjson==3.11.3; extra == "everysk-orjson"
|
|
@@ -45,7 +45,7 @@ everysk/core/slack.py,sha256=r9QH6RRe74Jz4-8XWLqbYq21msIlsVuC4fr_VUMFZPE,4394
|
|
|
45
45
|
everysk/core/string.py,sha256=K1BRlRNuhqlI7gdqOi40hjTHuxm1fF-RLqIAwm74eHc,5456
|
|
46
46
|
everysk/core/tests.py,sha256=qrfAfUDmgCvBn99X73fL5MUTo1P33gq0ftP5CTJetCc,14491
|
|
47
47
|
everysk/core/threads.py,sha256=CcL4Nv2Zzdxt1xjo0CbLSttSU29xHgSRiWF_JXr3GAA,7167
|
|
48
|
-
everysk/core/undefined.py,sha256=
|
|
48
|
+
everysk/core/undefined.py,sha256=RrL9QbUjxdDSmVIq08WG5uiY00DQE_n8yEuGaNp2tOU,2745
|
|
49
49
|
everysk/core/unittests.py,sha256=ujGqGHCUAI25P4UgwHn9GpZAMBdqZ-lxxGERrckthIM,3289
|
|
50
50
|
everysk/core/workers.py,sha256=alPhC1hEhI-I1l1Vnt0OrpxPDfi7R-xodo_qjJRVHvk,9037
|
|
51
51
|
everysk/core/_tests/serialize/test_json.py,sha256=zyTtL1pNoP_3MoHBGqkwGBOOCl9n79C34O4TytIc-tk,13279
|
|
@@ -107,7 +107,7 @@ everysk/sdk/entities/secrets/base.py,sha256=On9tvQFQN4sENArlABKktc3mqx4kynaVpxCn
|
|
|
107
107
|
everysk/sdk/entities/secrets/script.py,sha256=kg2T4ptBhy_R4tPYq50_JBCNSgsdjKQzVzvzFNLcYaI,4038
|
|
108
108
|
everysk/sdk/entities/secrets/settings.py,sha256=rN6QUdRO86e_5_Gg_nByKGRSrrNfKfv-PjjAPGh6OGg,910
|
|
109
109
|
everysk/sdk/entities/worker_execution/base.py,sha256=j8xVyDe3ncHRxXcsCnTJeJPZBPtYtH7Jg-W0sF4Cm3w,11059
|
|
110
|
-
everysk/sdk/entities/worker_execution/settings.py,sha256=
|
|
110
|
+
everysk/sdk/entities/worker_execution/settings.py,sha256=c0FoAcWes4ZuNE16RutKeMQ4GgaTKA-mapL9zDwMx_M,3021
|
|
111
111
|
everysk/sdk/entities/workflow_execution/base.py,sha256=aY0Vzv2KkfHCLO6GTBLnj-iM2wlVwawYAQpvMD59xDw,4065
|
|
112
112
|
everysk/sdk/entities/workflow_execution/settings.py,sha256=Acefis-m7TJmDKxP2OL7B_oZ5qVH-ij2T_XKmfaAwhk,1807
|
|
113
113
|
everysk/sdk/entities/workspace/base.py,sha256=yzAUXcowINxi2Kiavzh_7YOq70HOkHaqqPqUh_PGBi4,3180
|
|
@@ -123,15 +123,15 @@ everysk/server/routing.py,sha256=tHmmokv8msPY37T9F9_lovLZ9NP8bC8G_kxV92aM-tg,242
|
|
|
123
123
|
everysk/server/settings.py,sha256=C9nM3PYZQOKjq9KB2DB4ojGkkTJtj5pslWrUdMGYEwk,1309
|
|
124
124
|
everysk/server/tests.py,sha256=caw6jaXM0xjdi7Y10JpqUTCyUrUmKpG3uxigLcVRdew,1885
|
|
125
125
|
everysk/sql/__init__.py,sha256=lXZAWXrI2tlzw9uvJyThaWnksZqdbemQ2tqe-e7wUiU,413
|
|
126
|
-
everysk/sql/connection.py,sha256=
|
|
126
|
+
everysk/sql/connection.py,sha256=l_ksPciTBcj_SOpv4CAxbLDQOJ0CZqqrljWNKOGUj_U,8662
|
|
127
127
|
everysk/sql/model.py,sha256=syHHTTS4JRTj_2Mu9ugmMu4b6qUY12t3VgfE3hSxYIc,14559
|
|
128
128
|
everysk/sql/query.py,sha256=yO2EoGoUoGace_9BNKN8jeyFV30yCrAhefAvGHqIFE4,14174
|
|
129
129
|
everysk/sql/row_factory.py,sha256=FEtB4d12ACT3Bp6g2k_Ty2p2HpTkPoVqODUS1_kSXys,1936
|
|
130
130
|
everysk/sql/settings.py,sha256=g5ZVm4Y3fhWGeXgTW6D309waGRBx2S6Ima4nY6ByTZw,2103
|
|
131
131
|
everysk/sql/utils.py,sha256=Hbk9INEcz12FoBeDvHh9qh0dTSmTCWAn_S1anJOJb1o,4327
|
|
132
|
-
everysk_lib-1.10.
|
|
133
|
-
everysk_lib-1.10.
|
|
134
|
-
everysk_lib-1.10.
|
|
135
|
-
everysk_lib-1.10.
|
|
136
|
-
everysk_lib-1.10.
|
|
137
|
-
everysk_lib-1.10.
|
|
132
|
+
everysk_lib-1.10.1.dist-info/.gitignore,sha256=0A1r9HzLhR7IQ1rGPjbaW5HC6oIQ7xzVYZ1z1ZaVfmw,183
|
|
133
|
+
everysk_lib-1.10.1.dist-info/METADATA,sha256=zVK_B7vyzT6MjtepROMORkd84Fb7v-VnSwSttB_fVmQ,13080
|
|
134
|
+
everysk_lib-1.10.1.dist-info/WHEEL,sha256=XmKKV2d7_ONXLZZDzWKgL3gkWQUDu5rcp37-MLFQihs,113
|
|
135
|
+
everysk_lib-1.10.1.dist-info/top_level.txt,sha256=1s1Lfhd4gXolqzkh-ay3yy-EZKPiKnJfbZwx2fybxyk,14
|
|
136
|
+
everysk_lib-1.10.1.dist-info/RECORD,,
|
|
137
|
+
everysk_lib-1.10.1.dist-info/licenses/LICENSE.txt,sha256=Q5YxWA62m0TsmpEmHeoRHg4oPu_8ektkZ3FWWm1pQWo,311
|
|
File without changes
|
|
File without changes
|
|
File without changes
|