prefect-gitlab 0.2.0__tar.gz → 0.2.2__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 (22) hide show
  1. {prefect-gitlab-0.2.0/prefect_gitlab.egg-info → prefect-gitlab-0.2.2}/PKG-INFO +32 -16
  2. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/README.md +12 -14
  3. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab/_version.py +3 -3
  4. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab/repositories.py +17 -0
  5. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2/prefect_gitlab.egg-info}/PKG-INFO +32 -16
  6. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab.egg-info/requires.txt +2 -1
  7. prefect-gitlab-0.2.2/requirements.txt +3 -0
  8. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/tests/test_repositories.py +20 -1
  9. prefect-gitlab-0.2.0/requirements.txt +0 -2
  10. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/LICENSE +0 -0
  11. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/MANIFEST.in +0 -0
  12. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab/__init__.py +0 -0
  13. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab/credentials.py +0 -0
  14. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab.egg-info/SOURCES.txt +0 -0
  15. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab.egg-info/dependency_links.txt +0 -0
  16. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab.egg-info/entry_points.txt +0 -0
  17. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/prefect_gitlab.egg-info/top_level.txt +0 -0
  18. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/requirements-dev.txt +0 -0
  19. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/setup.cfg +0 -0
  20. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/setup.py +0 -0
  21. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/tests/test_credentials.py +0 -0
  22. {prefect-gitlab-0.2.0 → prefect-gitlab-0.2.2}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-gitlab
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A Prefect collection for working with GitLab repositories.
5
5
  Home-page: https://github.com/prefecthq/prefect-gitlab
6
6
  Author: Prefect Technologies, Inc.
@@ -19,25 +19,41 @@ Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Topic :: Software Development :: Libraries
20
20
  Requires-Python: >=3.7
21
21
  Description-Content-Type: text/markdown
22
- Provides-Extra: dev
23
22
  License-File: LICENSE
23
+ Requires-Dist: prefect>=2.13.5
24
+ Requires-Dist: python-gitlab>=3.12.0
25
+ Requires-Dist: tenacity>=8.2.3
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: black; extra == "dev"
29
+ Requires-Dist: flake8; extra == "dev"
30
+ Requires-Dist: mypy; extra == "dev"
31
+ Requires-Dist: mkdocs; extra == "dev"
32
+ Requires-Dist: mkdocs-material; extra == "dev"
33
+ Requires-Dist: mkdocstrings[python]; extra == "dev"
34
+ Requires-Dist: isort; extra == "dev"
35
+ Requires-Dist: pre-commit; extra == "dev"
36
+ Requires-Dist: pytest-asyncio; extra == "dev"
37
+ Requires-Dist: mock; python_version < "3.8" and extra == "dev"
38
+ Requires-Dist: mkdocs-gen-files; extra == "dev"
39
+ Requires-Dist: interrogate; extra == "dev"
40
+ Requires-Dist: coverage; extra == "dev"
41
+ Requires-Dist: pillow; extra == "dev"
24
42
 
25
43
  # prefect-gitlab
26
44
 
27
45
  <p align="center">
28
46
  <a href="https://pypi.python.org/pypi/prefect-gitlab/" alt="PyPI version">
29
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=0052FF&labelColor=090422"></a>
47
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=26272B&labelColor=090422"></a>
30
48
  <a href="https://github.com/prefecthq/prefect-gitlab/" alt="Stars">
31
- <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
49
+ <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
32
50
  <a href="https://pepy.tech/badge/prefect-gitlab/" alt="Downloads">
33
- <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
51
+ <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=26272B&labelColor=090422" /></a>
34
52
  <a href="https://github.com/prefecthq/prefect-gitlab/pulse" alt="Activity">
35
- <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
53
+ <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
36
54
  <br>
37
55
  <a href="https://prefect-community.slack.com" alt="Slack">
38
- <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
39
- <a href="https://discourse.prefect.io/" alt="Discourse">
40
- <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
56
+ <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=26272B&labelColor=090422&logo=slack" /></a>
41
57
  </p>
42
58
 
43
59
  ## Welcome!
@@ -48,11 +64,11 @@ License-File: LICENSE
48
64
 
49
65
  ### Python setup
50
66
 
51
- Requires an installation of Python 3.7+.
67
+ Requires an installation of Python 3.8 or higher.
52
68
 
53
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
69
+ We recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.
54
70
 
55
- This collection is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).
71
+ This integration is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
56
72
 
57
73
  ### Installation
58
74
 
@@ -62,13 +78,13 @@ Install `prefect-gitlab` with `pip`:
62
78
  pip install prefect-gitlab
63
79
  ```
64
80
 
65
- Then, register to [view the storage block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:
81
+ Then, register the [block types](https://docs.prefect.io/concepts/blocks/)) in this integration to view the storage block type on Prefect Cloud:
66
82
 
67
83
  ```bash
68
84
  prefect block register -m prefect_gitlab
69
85
  ```
70
86
 
71
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).
87
+ Note, to use the `load` method on a block, you must already have a block document [saved](https://docs.prefect.io/concepts/blocks/).
72
88
 
73
89
  ## Creating a GitLab storage block
74
90
 
@@ -121,9 +137,9 @@ Finally, enter your repository information in the form and click **Create**:
121
137
 
122
138
  If you encounter any bugs while using `prefect-gitlab`, feel free to open an issue in the [prefect-gitlab](https://github.com/prefecthq/prefect-gitlab) repository.
123
139
 
124
- If you have any questions or issues while using `prefect-gitlab`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).
140
+ If you have any questions or issues while using `prefect-gitlab`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
125
141
 
126
- Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates too!
142
+ Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates!
127
143
 
128
144
  ## Development
129
145
 
@@ -2,18 +2,16 @@
2
2
 
3
3
  <p align="center">
4
4
  <a href="https://pypi.python.org/pypi/prefect-gitlab/" alt="PyPI version">
5
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=0052FF&labelColor=090422"></a>
5
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=26272B&labelColor=090422"></a>
6
6
  <a href="https://github.com/prefecthq/prefect-gitlab/" alt="Stars">
7
- <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
7
+ <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
8
8
  <a href="https://pepy.tech/badge/prefect-gitlab/" alt="Downloads">
9
- <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
9
+ <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=26272B&labelColor=090422" /></a>
10
10
  <a href="https://github.com/prefecthq/prefect-gitlab/pulse" alt="Activity">
11
- <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
11
+ <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
12
12
  <br>
13
13
  <a href="https://prefect-community.slack.com" alt="Slack">
14
- <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
15
- <a href="https://discourse.prefect.io/" alt="Discourse">
16
- <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
14
+ <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=26272B&labelColor=090422&logo=slack" /></a>
17
15
  </p>
18
16
 
19
17
  ## Welcome!
@@ -24,11 +22,11 @@
24
22
 
25
23
  ### Python setup
26
24
 
27
- Requires an installation of Python 3.7+.
25
+ Requires an installation of Python 3.8 or higher.
28
26
 
29
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
27
+ We recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.
30
28
 
31
- This collection is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).
29
+ This integration is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
32
30
 
33
31
  ### Installation
34
32
 
@@ -38,13 +36,13 @@ Install `prefect-gitlab` with `pip`:
38
36
  pip install prefect-gitlab
39
37
  ```
40
38
 
41
- Then, register to [view the storage block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:
39
+ Then, register the [block types](https://docs.prefect.io/concepts/blocks/)) in this integration to view the storage block type on Prefect Cloud:
42
40
 
43
41
  ```bash
44
42
  prefect block register -m prefect_gitlab
45
43
  ```
46
44
 
47
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).
45
+ Note, to use the `load` method on a block, you must already have a block document [saved](https://docs.prefect.io/concepts/blocks/).
48
46
 
49
47
  ## Creating a GitLab storage block
50
48
 
@@ -97,9 +95,9 @@ Finally, enter your repository information in the form and click **Create**:
97
95
 
98
96
  If you encounter any bugs while using `prefect-gitlab`, feel free to open an issue in the [prefect-gitlab](https://github.com/prefecthq/prefect-gitlab) repository.
99
97
 
100
- If you have any questions or issues while using `prefect-gitlab`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).
98
+ If you have any questions or issues while using `prefect-gitlab`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
101
99
 
102
- Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates too!
100
+ Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates!
103
101
 
104
102
  ## Development
105
103
 
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-10-04T15:50:26-0400",
11
+ "date": "2024-02-07T14:31:34-0500",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "95d9ae7c574b182d45377c28a0c06217b806062e",
15
- "version": "0.2.0"
14
+ "full-revisionid": "9cd1a3e9ec4f374db98d832ea60d0acba6a416f7",
15
+ "version": "0.2.2"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -52,6 +52,7 @@ from prefect.filesystems import ReadableDeploymentStorage
52
52
  from prefect.utilities.asyncutils import sync_compatible
53
53
  from prefect.utilities.processutils import run_process
54
54
  from pydantic import VERSION as PYDANTIC_VERSION
55
+ from tenacity import retry, stop_after_attempt, wait_fixed, wait_random
55
56
 
56
57
  if PYDANTIC_VERSION.startswith("2."):
57
58
  from pydantic.v1 import Field, HttpUrl, validator
@@ -60,6 +61,13 @@ else:
60
61
 
61
62
  from prefect_gitlab.credentials import GitLabCredentials
62
63
 
64
+ # Create get_directory retry settings
65
+
66
+ MAX_CLONE_ATTEMPTS = 3
67
+ CLONE_RETRY_MIN_DELAY_SECONDS = 1
68
+ CLONE_RETRY_MIN_DELAY_JITTER_SECONDS = 0
69
+ CLONE_RETRY_MAX_DELAY_JITTER_SECONDS = 3
70
+
63
71
 
64
72
  class GitLabRepository(ReadableDeploymentStorage):
65
73
  """
@@ -153,6 +161,15 @@ class GitLabRepository(ReadableDeploymentStorage):
153
161
  return str(content_source), str(content_destination)
154
162
 
155
163
  @sync_compatible
164
+ @retry(
165
+ stop=stop_after_attempt(MAX_CLONE_ATTEMPTS),
166
+ wait=wait_fixed(CLONE_RETRY_MIN_DELAY_SECONDS)
167
+ + wait_random(
168
+ CLONE_RETRY_MIN_DELAY_JITTER_SECONDS,
169
+ CLONE_RETRY_MAX_DELAY_JITTER_SECONDS,
170
+ ),
171
+ reraise=True,
172
+ )
156
173
  async def get_directory(
157
174
  self, from_path: Optional[str] = None, local_path: Optional[str] = None
158
175
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-gitlab
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A Prefect collection for working with GitLab repositories.
5
5
  Home-page: https://github.com/prefecthq/prefect-gitlab
6
6
  Author: Prefect Technologies, Inc.
@@ -19,25 +19,41 @@ Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Topic :: Software Development :: Libraries
20
20
  Requires-Python: >=3.7
21
21
  Description-Content-Type: text/markdown
22
- Provides-Extra: dev
23
22
  License-File: LICENSE
23
+ Requires-Dist: prefect>=2.13.5
24
+ Requires-Dist: python-gitlab>=3.12.0
25
+ Requires-Dist: tenacity>=8.2.3
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: black; extra == "dev"
29
+ Requires-Dist: flake8; extra == "dev"
30
+ Requires-Dist: mypy; extra == "dev"
31
+ Requires-Dist: mkdocs; extra == "dev"
32
+ Requires-Dist: mkdocs-material; extra == "dev"
33
+ Requires-Dist: mkdocstrings[python]; extra == "dev"
34
+ Requires-Dist: isort; extra == "dev"
35
+ Requires-Dist: pre-commit; extra == "dev"
36
+ Requires-Dist: pytest-asyncio; extra == "dev"
37
+ Requires-Dist: mock; python_version < "3.8" and extra == "dev"
38
+ Requires-Dist: mkdocs-gen-files; extra == "dev"
39
+ Requires-Dist: interrogate; extra == "dev"
40
+ Requires-Dist: coverage; extra == "dev"
41
+ Requires-Dist: pillow; extra == "dev"
24
42
 
25
43
  # prefect-gitlab
26
44
 
27
45
  <p align="center">
28
46
  <a href="https://pypi.python.org/pypi/prefect-gitlab/" alt="PyPI version">
29
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=0052FF&labelColor=090422"></a>
47
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-gitlab?color=26272B&labelColor=090422"></a>
30
48
  <a href="https://github.com/prefecthq/prefect-gitlab/" alt="Stars">
31
- <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
49
+ <img src="https://img.shields.io/github/stars/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
32
50
  <a href="https://pepy.tech/badge/prefect-gitlab/" alt="Downloads">
33
- <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
51
+ <img src="https://img.shields.io/pypi/dm/prefect-gitlab?color=26272B&labelColor=090422" /></a>
34
52
  <a href="https://github.com/prefecthq/prefect-gitlab/pulse" alt="Activity">
35
- <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=0052FF&labelColor=090422" /></a>
53
+ <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect-gitlab?color=26272B&labelColor=090422" /></a>
36
54
  <br>
37
55
  <a href="https://prefect-community.slack.com" alt="Slack">
38
- <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
39
- <a href="https://discourse.prefect.io/" alt="Discourse">
40
- <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
56
+ <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=26272B&labelColor=090422&logo=slack" /></a>
41
57
  </p>
42
58
 
43
59
  ## Welcome!
@@ -48,11 +64,11 @@ License-File: LICENSE
48
64
 
49
65
  ### Python setup
50
66
 
51
- Requires an installation of Python 3.7+.
67
+ Requires an installation of Python 3.8 or higher.
52
68
 
53
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
69
+ We recommend using a Python virtual environment manager such as pipenv, conda, or virtualenv.
54
70
 
55
- This collection is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).
71
+ This integration is designed to work with Prefect 2.3.0 or higher. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
56
72
 
57
73
  ### Installation
58
74
 
@@ -62,13 +78,13 @@ Install `prefect-gitlab` with `pip`:
62
78
  pip install prefect-gitlab
63
79
  ```
64
80
 
65
- Then, register to [view the storage block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:
81
+ Then, register the [block types](https://docs.prefect.io/concepts/blocks/)) in this integration to view the storage block type on Prefect Cloud:
66
82
 
67
83
  ```bash
68
84
  prefect block register -m prefect_gitlab
69
85
  ```
70
86
 
71
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).
87
+ Note, to use the `load` method on a block, you must already have a block document [saved](https://docs.prefect.io/concepts/blocks/).
72
88
 
73
89
  ## Creating a GitLab storage block
74
90
 
@@ -121,9 +137,9 @@ Finally, enter your repository information in the form and click **Create**:
121
137
 
122
138
  If you encounter any bugs while using `prefect-gitlab`, feel free to open an issue in the [prefect-gitlab](https://github.com/prefecthq/prefect-gitlab) repository.
123
139
 
124
- If you have any questions or issues while using `prefect-gitlab`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).
140
+ If you have any questions or issues while using `prefect-gitlab`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
125
141
 
126
- Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates too!
142
+ Feel free to ⭐️ or watch [`prefect-gitlab`](https://github.com/prefecthq/prefect-gitlab) for updates!
127
143
 
128
144
  ## Development
129
145
 
@@ -1,5 +1,6 @@
1
- prefect>=2.7.0
1
+ prefect>=2.13.5
2
2
  python-gitlab>=3.12.0
3
+ tenacity>=8.2.3
3
4
 
4
5
  [dev]
5
6
  pytest
@@ -0,0 +1,3 @@
1
+ prefect>=2.13.5
2
+ python-gitlab>=3.12.0
3
+ tenacity>=8.2.3
@@ -15,7 +15,7 @@ else:
15
15
 
16
16
  import prefect_gitlab
17
17
  from prefect_gitlab.credentials import GitLabCredentials
18
- from prefect_gitlab.repositories import GitLabRepository
18
+ from prefect_gitlab.repositories import GitLabRepository # noqa: E402
19
19
 
20
20
 
21
21
  class TestGitLab:
@@ -243,3 +243,22 @@ class TestGitLab:
243
243
 
244
244
  assert set(os.listdir(tmp_dst)) == set([sub_dir_name])
245
245
  assert set(os.listdir(Path(tmp_dst) / sub_dir_name)) == child_contents
246
+
247
+ async def test_get_directory_retries(self, monkeypatch):
248
+ # Constants for the retry decorator
249
+ MAX_CLONE_ATTEMPTS = 3
250
+
251
+ # Create an instance of GitLabRepository
252
+ g = GitLabRepository(repository="https://gitlab.com/prefectHQ/prefect.git")
253
+
254
+ # Prepare a MagicMock to simulate the process call within get_directory
255
+ mock = AsyncMock()
256
+ mock.return_value = AsyncMock(returncode=1) # Simulate failure
257
+ monkeypatch.setattr(prefect_gitlab.repositories, "run_process", mock)
258
+
259
+ # Call get_directory and expect it to raise a RetryError after maximum attempts
260
+ with pytest.raises(OSError):
261
+ await g.get_directory()
262
+ print(mock.call_count)
263
+ # Verify that the function retried the expected number of times
264
+ assert mock.call_count == MAX_CLONE_ATTEMPTS
@@ -1,2 +0,0 @@
1
- prefect>=2.7.0
2
- python-gitlab>=3.12.0
File without changes
File without changes
File without changes