everysk-lib 1.10.0__cp312-cp312-macosx_11_0_arm64.whl → 1.10.1__cp312-cp312-macosx_11_0_arm64.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 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
- """ The undefined type, to be used as value for attributes and params and be different from None."""
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
- """ This object is always False """
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, __name: str) -> None:
40
- """ We could not delete attributes from this object. """
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, __value: object) -> bool:
50
- """
51
- For an object created from the UndefinedType class to be equal to another, the classes must be equal.
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, __name: str) -> Any:
56
- """ This object don't have attributes. """
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
- """ This must return an int that is used as hash for this object. """
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
- """ Fixed to be the same every time. """
60
+ """Fixed to be the same every time."""
65
61
  return self.default_repr_string
66
62
 
67
- def __setattr__(self, __name: str, __value: Any) -> None:
68
- """ We can't set any attribute to this object. """
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
- """ Fixed to be the same every time. """
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
- WORKER_EXECUTION_STATUS_LIST = ListField(default=['COMPLETED', 'FAILED', 'PREPARING', 'RUNNING'], readonly=True)
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.0
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==1.17.1; extra == "paramiko"
107
+ Requires-Dist: cffi==2.0.0; extra == "paramiko"
108
108
  Requires-Dist: cryptography==44.0.1; extra == "paramiko"
109
- Requires-Dist: pynacl==1.5.0; extra == "paramiko"
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"
@@ -18,7 +18,7 @@ everysk/core/threads.py,sha256=CcL4Nv2Zzdxt1xjo0CbLSttSU29xHgSRiWF_JXr3GAA,7167
18
18
  everysk/core/redis.py,sha256=HrG58dc_3EHnti2sBaijcyN8Hq4u3p1zst6-CSK9ySQ,36664
19
19
  everysk/core/compress.py,sha256=TRk-ME_UYfD5OQyhISYvwAZLT7IYfjbqWHYEgOuyaFU,10858
20
20
  everysk/core/http.py,sha256=9aKkh-M3Sfsg0tZLK_BWnmyZ7AuBdACq4pgy_qZSrXI,27171
21
- everysk/core/undefined.py,sha256=sNvP9qJJi3TINPSJiIWjqKz4o5DNBBYparoTRrDtJ_0,2757
21
+ everysk/core/undefined.py,sha256=RrL9QbUjxdDSmVIq08WG5uiY00DQE_n8yEuGaNp2tOU,2745
22
22
  everysk/core/exceptions.py,sha256=HTMKauc7vSeP77UqgPGw6rmwhEqWAKcGS0wk4oofgEY,14275
23
23
  everysk/core/sftp.py,sha256=01_iDxqhcAO3FFKUp-8myV7qtf3I-Mi_cLZ6KrAfsGw,15600
24
24
  everysk/core/string.py,sha256=K1BRlRNuhqlI7gdqOi40hjTHuxm1fF-RLqIAwm74eHc,5456
@@ -79,7 +79,7 @@ everysk/sdk/entities/script.py,sha256=_yYsqHgSnEzcmmB9CUJDHPcnlSz8Lgur7I35laqMDI
79
79
  everysk/sdk/entities/base.py,sha256=p0oiWs2cUwzop84sE7fuQ5z-ONsuHfkKLj7uZy3LzFs,29298
80
80
  everysk/sdk/entities/workflow_execution/settings.py,sha256=Acefis-m7TJmDKxP2OL7B_oZ5qVH-ij2T_XKmfaAwhk,1807
81
81
  everysk/sdk/entities/workflow_execution/base.py,sha256=aY0Vzv2KkfHCLO6GTBLnj-iM2wlVwawYAQpvMD59xDw,4065
82
- everysk/sdk/entities/worker_execution/settings.py,sha256=qDEwWBFpmBamIA_imPZlNPTbYK87cLUoedyuGT4VheE,2933
82
+ everysk/sdk/entities/worker_execution/settings.py,sha256=c0FoAcWes4ZuNE16RutKeMQ4GgaTKA-mapL9zDwMx_M,3021
83
83
  everysk/sdk/entities/worker_execution/base.py,sha256=j8xVyDe3ncHRxXcsCnTJeJPZBPtYtH7Jg-W0sF4Cm3w,11059
84
84
  everysk/sdk/entities/file/settings.py,sha256=gDTLsbAvVoVdRLoQD1gkDYIJuKZUCdgS0AQv1pilEXM,2198
85
85
  everysk/sdk/entities/file/base.py,sha256=gInM4XUvW1qxopVf7iDek76pGeo9on4U1gEo_JpGZSw,7951
@@ -126,12 +126,12 @@ everysk/sql/row_factory.py,sha256=FEtB4d12ACT3Bp6g2k_Ty2p2HpTkPoVqODUS1_kSXys,19
126
126
  everysk/sql/query.py,sha256=yO2EoGoUoGace_9BNKN8jeyFV30yCrAhefAvGHqIFE4,14174
127
127
  everysk/sql/__init__.py,sha256=lXZAWXrI2tlzw9uvJyThaWnksZqdbemQ2tqe-e7wUiU,413
128
128
  everysk/sql/model.py,sha256=syHHTTS4JRTj_2Mu9ugmMu4b6qUY12t3VgfE3hSxYIc,14559
129
- everysk/sql/connection.py,sha256=PujKm1i5gAvxU_FVT7IDuMb38D52dII52Gk8RI0vC_0,7928
129
+ everysk/sql/connection.py,sha256=l_ksPciTBcj_SOpv4CAxbLDQOJ0CZqqrljWNKOGUj_U,8662
130
130
  everysk/sql/utils.py,sha256=Hbk9INEcz12FoBeDvHh9qh0dTSmTCWAn_S1anJOJb1o,4327
131
131
  everysk/sql/settings.py,sha256=g5ZVm4Y3fhWGeXgTW6D309waGRBx2S6Ima4nY6ByTZw,2103
132
- everysk_lib-1.10.0.dist-info/RECORD,,
133
- everysk_lib-1.10.0.dist-info/WHEEL,sha256=V1loQ6TpxABu1APUg0MoTRBOzSKT5xVc3skizX-ovCU,136
134
- everysk_lib-1.10.0.dist-info/.gitignore,sha256=0A1r9HzLhR7IQ1rGPjbaW5HC6oIQ7xzVYZ1z1ZaVfmw,183
135
- everysk_lib-1.10.0.dist-info/top_level.txt,sha256=1s1Lfhd4gXolqzkh-ay3yy-EZKPiKnJfbZwx2fybxyk,14
136
- everysk_lib-1.10.0.dist-info/METADATA,sha256=3RpbivKO8Wqlqgq4RdNPdHLCy_k-7Iv-b4clbVSWhK8,13081
137
- everysk_lib-1.10.0.dist-info/licenses/LICENSE.txt,sha256=Q5YxWA62m0TsmpEmHeoRHg4oPu_8ektkZ3FWWm1pQWo,311
132
+ everysk_lib-1.10.1.dist-info/RECORD,,
133
+ everysk_lib-1.10.1.dist-info/WHEEL,sha256=djZycr7yArlwOmjQLxViKzHM1dAcWIH-Lipj4ykTWEE,137
134
+ everysk_lib-1.10.1.dist-info/.gitignore,sha256=0A1r9HzLhR7IQ1rGPjbaW5HC6oIQ7xzVYZ1z1ZaVfmw,183
135
+ everysk_lib-1.10.1.dist-info/top_level.txt,sha256=1s1Lfhd4gXolqzkh-ay3yy-EZKPiKnJfbZwx2fybxyk,14
136
+ everysk_lib-1.10.1.dist-info/METADATA,sha256=zVK_B7vyzT6MjtepROMORkd84Fb7v-VnSwSttB_fVmQ,13080
137
+ everysk_lib-1.10.1.dist-info/licenses/LICENSE.txt,sha256=Q5YxWA62m0TsmpEmHeoRHg4oPu_8ektkZ3FWWm1pQWo,311
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp312-cp312-macosx_11_0_arm64
5
5
  Generator: delocate 0.13.0