iker-python-common 1.0.51__tar.gz → 1.0.53__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 (84) hide show
  1. iker_python_common-1.0.53/.github/workflows/pr.yml +31 -0
  2. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/PKG-INFO +1 -1
  3. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/retry.py +17 -17
  4. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/PKG-INFO +1 -1
  5. iker_python_common-1.0.51/.github/workflows/pr.yml +0 -66
  6. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/.editorconfig +0 -0
  7. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/.github/workflows/push.yml +0 -0
  8. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/.gitignore +0 -0
  9. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/MANIFEST.in +0 -0
  10. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/README.md +0 -0
  11. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/VERSION +0 -0
  12. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/pyproject.toml +0 -0
  13. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/config/config.cfg +0 -0
  14. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/csv/data.csv +0 -0
  15. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/csv/data.tsv +0 -0
  16. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.baz/file.bar.baz +0 -0
  17. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.baz/file.foo.bar +0 -0
  18. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.baz/file.foo.baz +0 -0
  19. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/dir.foo.bar/dir.foo.bar.baz/file.foo.bar.baz +0 -0
  20. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.bar.baz +0 -0
  21. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.bar +0 -0
  22. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.baz +0 -0
  23. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/file.bar +0 -0
  24. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/file.baz +0 -0
  25. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/s3utils/dir.foo/file.foo +0 -0
  26. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.baz/file.bar.baz +0 -0
  27. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.baz/file.foo.bar +0 -0
  28. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.baz/file.foo.baz +0 -0
  29. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/dir.foo.bar/dir.foo.bar.baz/file.foo.bar.baz +0 -0
  30. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/dir.foo.bar/file.bar.baz +0 -0
  31. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/dir.foo.bar/file.foo.bar +0 -0
  32. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/dir.foo.bar/file.foo.baz +0 -0
  33. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/file.bar +0 -0
  34. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/file.baz +0 -0
  35. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/resources/unittest/shutils/dir.foo/file.foo +0 -0
  36. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/setup.cfg +0 -0
  37. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/setup.py +0 -0
  38. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/__init__.py +0 -0
  39. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/__init__.py +0 -0
  40. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/argutils.py +0 -0
  41. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/config.py +0 -0
  42. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/csv.py +0 -0
  43. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/dbutils.py +0 -0
  44. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/dockerutils.py +0 -0
  45. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/dtutils.py +0 -0
  46. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/funcutils.py +0 -0
  47. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/jsonutils.py +0 -0
  48. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/logger.py +0 -0
  49. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/numutils.py +0 -0
  50. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/randutils.py +0 -0
  51. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/s3utils.py +0 -0
  52. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/sequtils.py +0 -0
  53. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/shutils.py +0 -0
  54. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/span.py +0 -0
  55. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/strutils.py +0 -0
  56. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/testutils.py +0 -0
  57. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker/common/utils/typeutils.py +0 -0
  58. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/SOURCES.txt +0 -0
  59. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/dependency_links.txt +0 -0
  60. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/not-zip-safe +0 -0
  61. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/requires.txt +0 -0
  62. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/src/iker_python_common.egg-info/top_level.txt +0 -0
  63. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_test.py +0 -0
  64. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/__init__.py +0 -0
  65. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/argutils_test.py +0 -0
  66. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/config_test.py +0 -0
  67. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/csv_test.py +0 -0
  68. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/dbutils_test.py +0 -0
  69. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/dockerutils_test.py +0 -0
  70. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/dtutils_test.py +0 -0
  71. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/funcutils_test.py +0 -0
  72. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/jsonutils_test.py +0 -0
  73. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/logger_test.py +0 -0
  74. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/numutils_test.py +0 -0
  75. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/randutils_test.py +0 -0
  76. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/retry_test.py +0 -0
  77. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/s3utils_test.py +0 -0
  78. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/sequtils_test.py +0 -0
  79. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/shutils_test.py +0 -0
  80. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/span_test.py +0 -0
  81. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/strutils_test.py +0 -0
  82. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/testutils_test.py +0 -0
  83. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/common/utils/typeutils_test.py +0 -0
  84. {iker_python_common-1.0.51 → iker_python_common-1.0.53}/test/iker_tests/docker_fixtures.py +0 -0
@@ -0,0 +1,31 @@
1
+ name: Pull Request
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ "master" ]
6
+
7
+ env:
8
+ BUILD_NUMBER: ${{ github.run_number }}
9
+
10
+ jobs:
11
+ build-python:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: [ "3.11", "3.12", "3.13" ]
16
+ steps:
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "${{ matrix.python-version }}"
21
+
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Build and Test
26
+ run: |
27
+ sudo apt-get update
28
+ sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
29
+ python -m pip install --upgrade pip
30
+ python -m pip install .[test,all]
31
+ python -m pytest . --cov --cov-report xml --cov-config pyproject.toml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iker-python-common
3
- Version: 1.0.51
3
+ Version: 1.0.53
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -1,9 +1,9 @@
1
1
  import abc
2
- import datetime
3
2
  import random
4
3
  import time
5
4
 
6
5
  from iker.common.utils import logger
6
+ from iker.common.utils.dtutils import dt_utc_now
7
7
 
8
8
  __all__ = [
9
9
  "Attempt",
@@ -21,8 +21,8 @@ class Attempt(object):
21
21
  number: int,
22
22
  prev_wait: int,
23
23
  next_wait: int,
24
- start_time: datetime.datetime,
25
- check_time: datetime.datetime,
24
+ start_ts: float,
25
+ check_ts: float,
26
26
  last_exception: Exception,
27
27
  ):
28
28
  """
@@ -31,15 +31,15 @@ class Attempt(object):
31
31
  :param number: The attempt number (1-based).
32
32
  :param prev_wait: The wait time before the previous attempt (in seconds).
33
33
  :param next_wait: The wait time before the next attempt (in seconds).
34
- :param start_time: The start time of the first attempt.
35
- :param check_time: The time at which the current attempt is checked.
34
+ :param start_ts: The start timestamp of the first attempt.
35
+ :param check_ts: The timestamp at which the current attempt is checked.
36
36
  :param last_exception: The exception raised during the last attempt, if any.
37
37
  """
38
38
  self.number = number
39
39
  self.prev_wait = prev_wait
40
40
  self.next_wait = next_wait
41
- self.start_time = start_time
42
- self.check_time = check_time
41
+ self.start_ts = start_ts
42
+ self.check_ts = check_ts
43
43
  self.last_exception = last_exception
44
44
 
45
45
 
@@ -127,17 +127,17 @@ class RetryWrapper(object):
127
127
  else:
128
128
  return 0
129
129
 
130
- def __check_timeout(self, start_time: datetime.datetime):
130
+ def __check_timeout(self, start_ts: float) -> tuple[bool, float]:
131
131
  """
132
132
  Checks if the retry operation has exceeded the configured timeout.
133
133
 
134
- :param start_time: The start time of the first attempt.
135
- :return: Tuple (``True`` if within timeout, current time as ``datetime``).
134
+ :param start_ts: The start timestamp of the first attempt.
135
+ :return: Tuple (``True`` if within timeout, current timestamp).
136
136
  """
137
- now = datetime.datetime.now()
137
+ current_ts = dt_utc_now().timestamp()
138
138
  if self.timeout is None:
139
- return True, now
140
- return (now < start_time + datetime.timedelta(seconds=self.timeout)), now
139
+ return True, current_ts
140
+ return current_ts < start_ts + self.timeout, current_ts
141
141
 
142
142
  def __run(self, *args, **kwargs):
143
143
  """
@@ -150,13 +150,13 @@ class RetryWrapper(object):
150
150
  :raises RuntimeError: If all attempts fail or timeout is reached.
151
151
  """
152
152
  attempt_number = 0
153
- start_time = datetime.datetime.now()
153
+ start_ts = dt_utc_now().timestamp()
154
154
  last_exception = None
155
155
 
156
156
  while self.retrials is None or attempt_number <= self.retrials:
157
157
  attempt_number += 1
158
158
 
159
- check_result, check_time = self.__check_timeout(start_time)
159
+ check_result, check_ts = self.__check_timeout(start_ts)
160
160
  if not check_result:
161
161
  break
162
162
 
@@ -164,8 +164,8 @@ class RetryWrapper(object):
164
164
  attempt_number,
165
165
  self.__next_wait(attempt_number - 1),
166
166
  self.__next_wait(attempt_number),
167
- start_time,
168
- check_time,
167
+ start_ts,
168
+ check_ts,
169
169
  last_exception,
170
170
  )
171
171
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iker-python-common
3
- Version: 1.0.51
3
+ Version: 1.0.53
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -1,66 +0,0 @@
1
- name: Pull Request
2
-
3
- on:
4
- pull_request:
5
- branches: [ "master" ]
6
-
7
- env:
8
- BUILD_NUMBER: ${{ github.run_number }}
9
-
10
- jobs:
11
- build-python311:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - name: Setup Python
15
- uses: actions/setup-python@v5
16
- with:
17
- python-version: "3.11"
18
-
19
- - name: Checkout
20
- uses: actions/checkout@v4
21
-
22
- - name: Build and Test
23
- run: |
24
- sudo apt-get update
25
- sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
26
- python -m pip install --upgrade pip
27
- python -m pip install .[test,all]
28
- python -m pytest . --cov --cov-report xml --cov-config pyproject.toml
29
-
30
- build-python312:
31
- runs-on: ubuntu-latest
32
- steps:
33
- - name: Setup Python
34
- uses: actions/setup-python@v5
35
- with:
36
- python-version: "3.12"
37
-
38
- - name: Checkout
39
- uses: actions/checkout@v4
40
-
41
- - name: Build and Test
42
- run: |
43
- sudo apt-get update
44
- sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
45
- python -m pip install --upgrade pip
46
- python -m pip install .[test,all]
47
- python -m pytest . --cov --cov-report xml --cov-config pyproject.toml
48
-
49
- build-python313:
50
- runs-on: ubuntu-latest
51
- steps:
52
- - name: Setup Python
53
- uses: actions/setup-python@v5
54
- with:
55
- python-version: "3.13"
56
-
57
- - name: Checkout
58
- uses: actions/checkout@v4
59
-
60
- - name: Build and Test
61
- run: |
62
- sudo apt-get update
63
- sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
64
- python -m pip install --upgrade pip
65
- python -m pip install .[test,all]
66
- python -m pytest . --cov --cov-report xml --cov-config pyproject.toml