apache-airflow-providers-git 0.0.9__py3-none-any.whl → 0.1.1rc1__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.
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "0.0.9"
32
+ __version__ = "0.1.1"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "3.0.0"
@@ -28,7 +28,7 @@ from git.exc import BadName, GitCommandError, InvalidGitRepositoryError, NoSuchP
28
28
  from tenacity import retry, retry_if_exception_type, stop_after_attempt
29
29
 
30
30
  from airflow.dag_processing.bundles.base import BaseDagBundle
31
- from airflow.exceptions import AirflowException
31
+ from airflow.providers.common.compat.sdk import AirflowException
32
32
  from airflow.providers.git.hooks.git import GitHook
33
33
 
34
34
  log = structlog.get_logger(__name__)
@@ -45,6 +45,12 @@ class GitDagBundle(BaseDagBundle):
45
45
  :param subdir: Subdirectory within the repository where the DAGs are stored (Optional)
46
46
  :param git_conn_id: Connection ID for SSH/token based connection to the repository (Optional)
47
47
  :param repo_url: Explicit Git repository URL to override the connection's host. (Optional)
48
+ :param prune_dotgit_folder: Remove .git folder from the versions after cloning.
49
+
50
+ The per-version clone is not a full "git" copy (it makes use of git's `--local` ability
51
+ to share the object directory via hard links, but if you have a lot of current versions
52
+ running, or an especially large git repo leaving this as True will save some disk space
53
+ at the expense of `git` operations not working in the bundle that Tasks run from.
48
54
  """
49
55
 
50
56
  supports_versioning = True
@@ -56,6 +62,7 @@ class GitDagBundle(BaseDagBundle):
56
62
  subdir: str | None = None,
57
63
  git_conn_id: str | None = None,
58
64
  repo_url: str | None = None,
65
+ prune_dotgit_folder: bool = True,
59
66
  **kwargs,
60
67
  ) -> None:
61
68
  super().__init__(**kwargs)
@@ -68,6 +75,7 @@ class GitDagBundle(BaseDagBundle):
68
75
  self.repo_path = self.base_dir / "tracking_repo"
69
76
  self.git_conn_id = git_conn_id
70
77
  self.repo_url = repo_url
78
+ self.prune_dotgit_folder = prune_dotgit_folder
71
79
 
72
80
  self._log = log.bind(
73
81
  bundle_name=self.name,
@@ -82,8 +90,9 @@ class GitDagBundle(BaseDagBundle):
82
90
  self.hook: GitHook | None = None
83
91
  try:
84
92
  self.hook = GitHook(git_conn_id=git_conn_id or "git_default", repo_url=self.repo_url)
85
- except Exception as e:
86
- self._log.warning("Could not create GitHook", conn_id=git_conn_id, exc=e)
93
+ except Exception:
94
+ # re raise so exception propagates immediately with clear error message
95
+ raise
87
96
 
88
97
  if self.hook and self.hook.repo_url:
89
98
  self.repo_url = self.hook.repo_url
@@ -115,6 +124,8 @@ class GitDagBundle(BaseDagBundle):
115
124
  self.repo.remotes.origin.fetch()
116
125
  self.repo.head.set_reference(str(self.repo.commit(self.version)))
117
126
  self.repo.head.reset(index=True, working_tree=True)
127
+ if self.prune_dotgit_folder:
128
+ shutil.rmtree(self.repo_path / ".git")
118
129
  else:
119
130
  self.refresh()
120
131
  self.repo.close()
@@ -175,9 +186,12 @@ class GitDagBundle(BaseDagBundle):
175
186
  env=self.hook.env if self.hook else None,
176
187
  )
177
188
  self.bare_repo = Repo(self.bare_repo_path)
189
+
190
+ # Fetch to ensure we have latest refs and validate repo integrity
191
+ self._fetch_bare_repo()
178
192
  except (InvalidGitRepositoryError, GitCommandError) as e:
179
193
  self._log.warning(
180
- "Bare repository clone/open failed, cleaning up and retrying",
194
+ "Bare repository clone/open/fetch failed, cleaning up and retrying",
181
195
  bare_repo_path=self.bare_repo_path,
182
196
  exc=e,
183
197
  )
@@ -33,8 +33,10 @@ def get_provider_info():
33
33
  "tags": ["software"],
34
34
  }
35
35
  ],
36
- "hooks": [{"integration-name": "GIT", "python-modules": ["airflow.providers.git.hooks.git"]}],
37
- "bundles": [{"integration-name": "GIT", "python-modules": ["airflow.providers.git.bundles.git"]}],
36
+ "hooks": [{"integration-name": "GIT (Git)", "python-modules": ["airflow.providers.git.hooks.git"]}],
37
+ "bundles": [
38
+ {"integration-name": "GIT (Git)", "python-modules": ["airflow.providers.git.bundles.git"]}
39
+ ],
38
40
  "connection-types": [
39
41
  {"hook-class-name": "airflow.providers.git.hooks.git.GitHook", "connection-type": "git"}
40
42
  ],
@@ -24,8 +24,7 @@ import os
24
24
  import tempfile
25
25
  from typing import Any
26
26
 
27
- from airflow.exceptions import AirflowException
28
- from airflow.providers.common.compat.sdk import BaseHook
27
+ from airflow.providers.common.compat.sdk import AirflowException, BaseHook
29
28
 
30
29
  log = logging.getLogger(__name__)
31
30
 
@@ -91,6 +90,11 @@ class GitHook(BaseHook):
91
90
  return
92
91
  if self.auth_token and self.repo_url.startswith("https://"):
93
92
  self.repo_url = self.repo_url.replace("https://", f"https://{self.user_name}:{self.auth_token}@")
93
+ elif self.auth_token and self.repo_url.startswith("http://"):
94
+ self.repo_url = self.repo_url.replace("http://", f"http://{self.user_name}:{self.auth_token}@")
95
+ elif self.repo_url.startswith("http://"):
96
+ # if no auth token, use the repo url as is
97
+ self.repo_url = self.repo_url
94
98
  elif not self.repo_url.startswith("git@") or not self.repo_url.startswith("https://"):
95
99
  self.repo_url = os.path.expanduser(self.repo_url)
96
100
 
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-git
3
- Version: 0.0.9
3
+ Version: 0.1.1rc1
4
4
  Summary: Provider package apache-airflow-providers-git for Apache Airflow
5
5
  Keywords: airflow-provider,git,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
7
7
  Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/x-rst
10
+ License-Expression: Apache-2.0
10
11
  Classifier: Development Status :: 5 - Production/Stable
11
12
  Classifier: Environment :: Console
12
13
  Classifier: Environment :: Web Environment
@@ -14,18 +15,19 @@ Classifier: Intended Audience :: Developers
14
15
  Classifier: Intended Audience :: System Administrators
15
16
  Classifier: Framework :: Apache Airflow
16
17
  Classifier: Framework :: Apache Airflow :: Provider
17
- Classifier: License :: OSI Approved :: Apache Software License
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: System :: Monitoring
23
- Requires-Dist: apache-airflow>=3.0.0
24
- Requires-Dist: apache-airflow-providers-common-compat>=1.8.0
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: apache-airflow>=3.0.0rc1
26
+ Requires-Dist: apache-airflow-providers-common-compat>=1.10.1rc1
25
27
  Requires-Dist: GitPython>=3.1.44
26
28
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
27
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.9/changelog.html
28
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.9
29
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-git/0.1.1/changelog.html
30
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-git/0.1.1
29
31
  Project-URL: Mastodon, https://fosstodon.org/@airflow
30
32
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
31
33
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -56,7 +58,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
56
58
 
57
59
  Package ``apache-airflow-providers-git``
58
60
 
59
- Release: ``0.0.9``
61
+ Release: ``0.1.1``
60
62
 
61
63
 
62
64
  `Distributed version control system (GIT) <https://git-scm.com/>`__
@@ -69,7 +71,7 @@ This is a provider package for ``git`` provider. All classes for this provider p
69
71
  are in ``airflow.providers.git`` python package.
70
72
 
71
73
  You can find package information and changelog for the provider
72
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.9/>`_.
74
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.1.1/>`_.
73
75
 
74
76
  Installation
75
77
  ------------
@@ -87,7 +89,7 @@ Requirements
87
89
  PIP package Version required
88
90
  ========================================== ==================
89
91
  ``apache-airflow`` ``>=3.0.0``
90
- ``apache-airflow-providers-common-compat`` ``>=1.8.0``
92
+ ``apache-airflow-providers-common-compat`` ``>=1.10.1``
91
93
  ``GitPython`` ``>=3.1.44``
92
94
  ========================================== ==================
93
95
 
@@ -111,5 +113,5 @@ Dependent package
111
113
  ================================================================================================================== =================
112
114
 
113
115
  The changelog for the provider package can be found in the
114
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.9/changelog.html>`_.
116
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.1.1/changelog.html>`_.
115
117
 
@@ -0,0 +1,13 @@
1
+ airflow/providers/git/__init__.py,sha256=wS6T8Jv0cqKWCkfDbK6MF23nUF3gC0bhVucBz_zXYN0,1490
2
+ airflow/providers/git/get_provider_info.py,sha256=aZCwrfre75QKA3rbLgWnbyy_TNH14lneIxUhGFHRPM0,1843
3
+ airflow/providers/git/version_compat.py,sha256=cmeoGMcTp0kiFa3GKZlQh31_kMk7UX9nOX8sYyGtuFg,1665
4
+ airflow/providers/git/bundles/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
+ airflow/providers/git/bundles/git.py,sha256=2LK7jTh65PWHIHqfPzfFOHw_LTRrAImnLg0ekK_UFLA,13065
6
+ airflow/providers/git/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
+ airflow/providers/git/hooks/git.py,sha256=fA3c9PvEq3wnx5XcB059vqsvbVkosMO-Ujv6OMr08Lw,4310
8
+ apache_airflow_providers_git-0.1.1rc1.dist-info/entry_points.txt,sha256=k9QR9MAaAm9yDsRDBIK3QOt5Fos3fBCqCngNFPaJnKs,99
9
+ apache_airflow_providers_git-0.1.1rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
10
+ apache_airflow_providers_git-0.1.1rc1.dist-info/licenses/NOTICE,sha256=E3-_E02gwwSEFzeeWPKmnIjOoos3hW28CLISV6sYrbQ,168
11
+ apache_airflow_providers_git-0.1.1rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
12
+ apache_airflow_providers_git-0.1.1rc1.dist-info/METADATA,sha256=27uScNVmmogp2BpGtE3qPFMFRYqODlQ_6QPKsfOnXlA,5203
13
+ apache_airflow_providers_git-0.1.1rc1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Apache Airflow
2
+ Copyright 2016-2025 The Apache Software Foundation
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).
@@ -1,12 +0,0 @@
1
- airflow/providers/git/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/git/__init__.py,sha256=1dwM-4yAxdIshbRngFq3J3tU-CkjzDqfjL4e4OsMy68,1490
3
- airflow/providers/git/get_provider_info.py,sha256=6xC_Jru3CMrhO7r5aX03J4HR6Jl62rp9BWVcLKFjxQQ,1809
4
- airflow/providers/git/version_compat.py,sha256=cmeoGMcTp0kiFa3GKZlQh31_kMk7UX9nOX8sYyGtuFg,1665
5
- airflow/providers/git/bundles/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
- airflow/providers/git/bundles/git.py,sha256=GbdgiHCu74sYnXN-qnloOkoVupiwYWfMPVshIymYyKs,12252
7
- airflow/providers/git/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
8
- airflow/providers/git/hooks/git.py,sha256=RNEdKVqwjHOQsA6jjXMPkogJJf9lJASj5hXTdK4idgo,4015
9
- apache_airflow_providers_git-0.0.9.dist-info/entry_points.txt,sha256=k9QR9MAaAm9yDsRDBIK3QOt5Fos3fBCqCngNFPaJnKs,99
10
- apache_airflow_providers_git-0.0.9.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
11
- apache_airflow_providers_git-0.0.9.dist-info/METADATA,sha256=xr5SnRyY3t4NWEK-enpQWgWFM3EHtbfQIoDGB6PQDSk,5167
12
- apache_airflow_providers_git-0.0.9.dist-info/RECORD,,