apache-airflow-providers-git 0.0.6__tar.gz → 0.0.7__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 (30) hide show
  1. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/PKG-INFO +7 -8
  2. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/README.rst +4 -5
  3. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/changelog.rst +30 -0
  4. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/index.rst +2 -4
  5. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/provider.yaml +2 -1
  6. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/pyproject.toml +4 -4
  7. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/__init__.py +1 -1
  8. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/bundles/git.py +7 -2
  9. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/git/bundles/test_git.py +24 -3
  10. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/.latest-doc-only-change.txt +0 -0
  11. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/bundles/index.rst +0 -0
  12. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/commits.rst +0 -0
  13. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/conf.py +0 -0
  14. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/connections/git.rst +0 -0
  15. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/installing-providers-from-sources.rst +0 -0
  16. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/docs/security.rst +0 -0
  17. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/__init__.py +0 -0
  18. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/__init__.py +0 -0
  19. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/LICENSE +0 -0
  20. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/bundles/__init__.py +0 -0
  21. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/get_provider_info.py +0 -0
  22. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/hooks/__init__.py +0 -0
  23. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/hooks/git.py +0 -0
  24. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/src/airflow/providers/git/version_compat.py +0 -0
  25. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/conftest.py +0 -0
  26. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/__init__.py +0 -0
  27. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/git/__init__.py +0 -0
  28. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/git/bundles/__init__.py +0 -0
  29. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/git/hooks/__init__.py +0 -0
  30. {apache_airflow_providers_git-0.0.6 → apache_airflow_providers_git-0.0.7}/tests/unit/git/hooks/test_git.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-git
3
- Version: 0.0.6
3
+ Version: 0.0.7
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>
@@ -23,8 +23,8 @@ Classifier: Topic :: System :: Monitoring
23
23
  Requires-Dist: apache-airflow>=3.0.0
24
24
  Requires-Dist: GitPython>=3.1.44
25
25
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
26
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html
27
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6
26
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/changelog.html
27
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7
28
28
  Project-URL: Mastodon, https://fosstodon.org/@airflow
29
29
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
30
30
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -55,9 +55,8 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
55
55
 
56
56
  Package ``apache-airflow-providers-git``
57
57
 
58
- Release: ``0.0.6``
58
+ Release: ``0.0.7``
59
59
 
60
- Release Date: ``|PypiReleaseDate|``
61
60
 
62
61
  `Distributed version control system (GIT) <https://git-scm.com/>`__
63
62
 
@@ -69,12 +68,12 @@ This is a provider package for ``git`` provider. All classes for this provider p
69
68
  are in ``airflow.providers.git`` python package.
70
69
 
71
70
  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.6/>`_.
71
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/>`_.
73
72
 
74
73
  Installation
75
74
  ------------
76
75
 
77
- You can install this package on top of an existing Airflow 2 installation (see ``Requirements`` below
76
+ You can install this package on top of an existing Airflow installation (see ``Requirements`` below
78
77
  for the minimum Airflow version supported) via
79
78
  ``pip install apache-airflow-providers-git``
80
79
 
@@ -91,5 +90,5 @@ PIP package Version required
91
90
  ================== ==================
92
91
 
93
92
  The changelog for the provider package can be found in the
94
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html>`_.
93
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/changelog.html>`_.
95
94
 
@@ -23,9 +23,8 @@
23
23
 
24
24
  Package ``apache-airflow-providers-git``
25
25
 
26
- Release: ``0.0.6``
26
+ Release: ``0.0.7``
27
27
 
28
- Release Date: ``|PypiReleaseDate|``
29
28
 
30
29
  `Distributed version control system (GIT) <https://git-scm.com/>`__
31
30
 
@@ -37,12 +36,12 @@ This is a provider package for ``git`` provider. All classes for this provider p
37
36
  are in ``airflow.providers.git`` python package.
38
37
 
39
38
  You can find package information and changelog for the provider
40
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/>`_.
39
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/>`_.
41
40
 
42
41
  Installation
43
42
  ------------
44
43
 
45
- You can install this package on top of an existing Airflow 2 installation (see ``Requirements`` below
44
+ You can install this package on top of an existing Airflow installation (see ``Requirements`` below
46
45
  for the minimum Airflow version supported) via
47
46
  ``pip install apache-airflow-providers-git``
48
47
 
@@ -59,4 +58,4 @@ PIP package Version required
59
58
  ================== ==================
60
59
 
61
60
  The changelog for the provider package can be found in the
62
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html>`_.
61
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/changelog.html>`_.
@@ -15,6 +15,36 @@
15
15
  specific language governing permissions and limitations
16
16
  under the License.
17
17
 
18
+
19
+ Changelog
20
+ ---------
21
+
22
+ 0.0.7
23
+ .....
24
+
25
+
26
+ Release Date: ``|PypiReleaseDate|``
27
+
28
+ Bug Fixes
29
+ ~~~~~~~~~
30
+
31
+ * ``Catch Exception in git hook instantiation (#55079)``
32
+ * ``Fix process leaks in 'GitDagBundle' repository management (#54997)``
33
+
34
+ Doc-only
35
+ ~~~~~~~~
36
+
37
+ * ``Add missing changelog provider for Git (#54496)``
38
+
39
+ .. Below changes are excluded from the changelog. Move them to
40
+ appropriate section above if needed. Do not delete the lines(!):
41
+ * ``Fix git connection test by adding required conn_type field (#54681)``
42
+ * ``Replace API server's direct Connection access workaround in BaseHook (#54083)``
43
+ * ``Switch pre-commit to prek (#54258)``
44
+
45
+ .. Review and move the new changes to one of the sections above:
46
+ * ``Fix Airflow 2 reference in README/index of providers (#55240)``
47
+
18
48
  0.0.6
19
49
  .....
20
50
 
@@ -72,9 +72,7 @@ apache-airflow-providers-git package
72
72
  `Distributed version control system (GIT) <https://git-scm.com/>`__
73
73
 
74
74
 
75
- Release: 0.0.6
76
-
77
- Release Date: ``|PypiReleaseDate|``
75
+ Release: 0.0.7
78
76
 
79
77
  Provider package
80
78
  ----------------
@@ -85,7 +83,7 @@ All classes for this package are included in the ``airflow.providers.git`` pytho
85
83
  Installation
86
84
  ------------
87
85
 
88
- You can install this package on top of an existing Airflow 2 installation via
86
+ You can install this package on top of an existing Airflow installation via
89
87
  ``pip install apache-airflow-providers-git``.
90
88
  For the minimum Airflow version supported, see ``Requirements`` below.
91
89
 
@@ -22,12 +22,13 @@ description: |
22
22
  `Distributed version control system (GIT) <https://git-scm.com/>`__
23
23
 
24
24
  state: ready
25
- source-date-epoch: 1754503255
25
+ source-date-epoch: 1756876853
26
26
  # Note that those versions are maintained by release manager - do not update them manually
27
27
  # with the exception of case where other provider in sources has >= new provider version.
28
28
  # In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider have
29
29
  # to be done in the same PR
30
30
  versions:
31
+ - 0.0.7
31
32
  - 0.0.6
32
33
  - 0.0.5
33
34
  - 0.0.4
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
25
25
 
26
26
  [project]
27
27
  name = "apache-airflow-providers-git"
28
- version = "0.0.6"
28
+ version = "0.0.7"
29
29
  description = "Provider package apache-airflow-providers-git for Apache Airflow"
30
30
  readme = "README.rst"
31
31
  authors = [
@@ -54,7 +54,7 @@ requires-python = ">=3.10"
54
54
 
55
55
  # The dependencies should be modified in place in the generated file.
56
56
  # Any change in the dependencies is preserved when the file is regenerated
57
- # Make sure to run ``breeze static-checks --type update-providers-dependencies --all-files``
57
+ # Make sure to run ``prek update-providers-dependencies --all-files``
58
58
  # After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
59
59
  dependencies = [
60
60
  "apache-airflow>=3.0.0",
@@ -95,8 +95,8 @@ apache-airflow-providers-common-sql = {workspace = true}
95
95
  apache-airflow-providers-standard = {workspace = true}
96
96
 
97
97
  [project.urls]
98
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6"
99
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html"
98
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7"
99
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.7/changelog.html"
100
100
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
101
101
  "Source Code" = "https://github.com/apache/airflow"
102
102
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "0.0.6"
32
+ __version__ = "0.0.7"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "3.0.0"
@@ -80,7 +80,7 @@ class GitDagBundle(BaseDagBundle):
80
80
  self.hook: GitHook | None = None
81
81
  try:
82
82
  self.hook = GitHook(git_conn_id=git_conn_id or "git_default")
83
- except AirflowException as e:
83
+ except Exception as e:
84
84
  self._log.warning("Could not create GitHook", conn_id=git_conn_id, exc=e)
85
85
 
86
86
  if not repo_url and self.hook and self.hook.repo_url:
@@ -93,6 +93,7 @@ class GitDagBundle(BaseDagBundle):
93
93
  with cm:
94
94
  self._clone_bare_repo_if_required()
95
95
  self._ensure_version_in_bare_repo()
96
+ self.bare_repo.close()
96
97
 
97
98
  self._clone_repo_if_required()
98
99
  self.repo.git.checkout(self.tracking_ref)
@@ -104,6 +105,7 @@ class GitDagBundle(BaseDagBundle):
104
105
  self.repo.head.reset(index=True, working_tree=True)
105
106
  else:
106
107
  self.refresh()
108
+ self.repo.close()
107
109
 
108
110
  def initialize(self) -> None:
109
111
  if not self.repo_url:
@@ -161,7 +163,8 @@ class GitDagBundle(BaseDagBundle):
161
163
  )
162
164
 
163
165
  def get_current_version(self) -> str:
164
- return self.repo.head.commit.hexsha
166
+ with self.repo as repo:
167
+ return repo.head.commit.hexsha
165
168
 
166
169
  @property
167
170
  def path(self) -> Path:
@@ -184,6 +187,7 @@ class GitDagBundle(BaseDagBundle):
184
187
  cm = self.bare_repo.git.custom_environment(GIT_SSH_COMMAND=cmd)
185
188
  with cm:
186
189
  self.bare_repo.remotes.origin.fetch(refspecs)
190
+ self.bare_repo.close()
187
191
 
188
192
  def refresh(self) -> None:
189
193
  if self.version:
@@ -202,6 +206,7 @@ class GitDagBundle(BaseDagBundle):
202
206
  else:
203
207
  target = self.tracking_ref
204
208
  self.repo.head.reset(target, index=True, working_tree=True)
209
+ self.repo.close()
205
210
 
206
211
  @staticmethod
207
212
  def _convert_git_ssh_url_to_https(url: str) -> str:
@@ -33,6 +33,8 @@ from airflow.exceptions import AirflowException
33
33
  from airflow.models import Connection
34
34
  from airflow.providers.git.bundles.git import GitDagBundle
35
35
  from airflow.providers.git.hooks.git import GitHook
36
+ from airflow.sdk.exceptions import ErrorType
37
+ from airflow.sdk.execution_time.comms import ErrorResponse
36
38
 
37
39
  from tests_common.test_utils.config import conf_vars
38
40
  from tests_common.test_utils.version_compat import AIRFLOW_V_3_1_PLUS
@@ -66,6 +68,14 @@ def git_repo(tmp_path_factory):
66
68
  return (directory, repo)
67
69
 
68
70
 
71
+ def assert_repo_is_closed(bundle: GitDagBundle):
72
+ # cat-file processes get left around if the repo is not closed, so check it was
73
+ assert bundle.repo.git.cat_file_all is None
74
+ assert bundle.bare_repo.git.cat_file_all is None
75
+ assert bundle.repo.git.cat_file_header is None
76
+ assert bundle.bare_repo.git.cat_file_header is None
77
+
78
+
69
79
  class TestGitDagBundle:
70
80
  @classmethod
71
81
  def teardown_class(cls) -> None:
@@ -135,6 +145,8 @@ class TestGitDagBundle:
135
145
 
136
146
  assert bundle.get_current_version() == repo.head.commit.hexsha
137
147
 
148
+ assert_repo_is_closed(bundle)
149
+
138
150
  @mock.patch("airflow.providers.git.bundles.git.GitHook")
139
151
  def test_get_specific_version(self, mock_githook, git_repo):
140
152
  repo_path, repo = git_repo
@@ -161,6 +173,8 @@ class TestGitDagBundle:
161
173
  files_in_repo = {f.name for f in bundle.path.iterdir() if f.is_file()}
162
174
  assert {"test_dag.py"} == files_in_repo
163
175
 
176
+ assert_repo_is_closed(bundle)
177
+
164
178
  @mock.patch("airflow.providers.git.bundles.git.GitHook")
165
179
  def test_get_tag_version(self, mock_githook, git_repo):
166
180
  repo_path, repo = git_repo
@@ -209,6 +223,8 @@ class TestGitDagBundle:
209
223
  files_in_repo = {f.name for f in bundle.path.iterdir() if f.is_file()}
210
224
  assert {"test_dag.py", "new_test.py"} == files_in_repo
211
225
 
226
+ assert_repo_is_closed(bundle)
227
+
212
228
  @pytest.mark.parametrize(
213
229
  "amend",
214
230
  [
@@ -248,6 +264,8 @@ class TestGitDagBundle:
248
264
  files_in_repo = {f.name for f in bundle.path.iterdir() if f.is_file()}
249
265
  assert {"test_dag.py", "new_test.py"} == files_in_repo
250
266
 
267
+ assert_repo_is_closed(bundle)
268
+
251
269
  @mock.patch("airflow.providers.git.bundles.git.GitHook")
252
270
  def test_refresh_tag(self, mock_githook, git_repo):
253
271
  """Ensure that the bundle refresh works when tracking a tag"""
@@ -653,13 +671,16 @@ class TestGitDagBundle:
653
671
 
654
672
  assert "Repository path: %s not found" in str(exc_info.value)
655
673
 
656
- @pytest.mark.db_test
657
- @patch.dict(os.environ, {"AIRFLOW_CONN_MY_TEST_GIT": '{"host": "something"}'})
674
+ @patch.dict(os.environ, {"AIRFLOW_CONN_MY_TEST_GIT": '{"host": "something", "conn_type": "git"}'})
658
675
  @pytest.mark.parametrize(
659
676
  "conn_id, expected_hook_type",
660
677
  [("my_test_git", GitHook), ("something-else", type(None))],
661
678
  )
662
- def test_repo_url_access_missing_connection_doesnt_error(self, conn_id, expected_hook_type):
679
+ def test_repo_url_access_missing_connection_doesnt_error(
680
+ self, conn_id, expected_hook_type, mock_supervisor_comms
681
+ ):
682
+ if expected_hook_type is type(None):
683
+ mock_supervisor_comms.send.return_value = ErrorResponse(error=ErrorType.CONNECTION_NOT_FOUND)
663
684
  bundle = GitDagBundle(
664
685
  name="testa",
665
686
  tracking_ref="main",