apache-airflow-providers-git 0.0.5rc1__py3-none-any.whl → 0.0.6rc1__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.

Potentially problematic release.


This version of apache-airflow-providers-git might be problematic. Click here for more details.

@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "0.0.5"
32
+ __version__ = "0.0.6"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "3.0.0"
@@ -25,9 +25,7 @@ import structlog
25
25
  from git import Repo
26
26
  from git.exc import BadName, GitCommandError, NoSuchPathError
27
27
 
28
- from airflow.dag_processing.bundles.base import (
29
- BaseDagBundle,
30
- )
28
+ from airflow.dag_processing.bundles.base import BaseDagBundle
31
29
  from airflow.exceptions import AirflowException
32
30
  from airflow.providers.git.hooks.git import GitHook
33
31
 
@@ -215,32 +213,58 @@ class GitDagBundle(BaseDagBundle):
215
213
  return f"{domain}/{repo_path}"
216
214
 
217
215
  def view_url(self, version: str | None = None) -> str | None:
216
+ """
217
+ Return a URL for viewing the DAGs in the repository.
218
+
219
+ This method is deprecated and will be removed when the minimum supported Airflow version is 3.1.
220
+ Use `view_url_template` instead.
221
+ """
218
222
  if not version:
219
223
  return None
220
- url = self.repo_url
221
- if not url:
224
+ template = self.view_url_template()
225
+ if not template:
222
226
  return None
227
+ if not self.subdir:
228
+ # remove {subdir} from the template if subdir is not set
229
+ template = template.replace("/{subdir}", "")
230
+ return template.format(version=version, subdir=self.subdir)
231
+
232
+ def view_url_template(self) -> str | None:
233
+ if hasattr(self, "_view_url_template") and self._view_url_template:
234
+ # Because we use this method in the view_url method, we need to handle
235
+ # backward compatibility for Airflow versions that doesn't have the
236
+ # _view_url_template attribute. Should be removed when we drop support for Airflow 3.0
237
+ return self._view_url_template
238
+
239
+ if not self.repo_url:
240
+ return None
241
+
242
+ url = self.repo_url
223
243
  if url.startswith("git@"):
224
244
  url = self._convert_git_ssh_url_to_https(url)
225
245
  if url.endswith(".git"):
226
246
  url = url[:-4]
247
+
227
248
  parsed_url = urlparse(url)
228
249
  host = parsed_url.hostname
229
250
  if not host:
230
251
  return None
252
+
231
253
  if parsed_url.username or parsed_url.password:
232
254
  new_netloc = host
233
255
  if parsed_url.port:
234
256
  new_netloc += f":{parsed_url.port}"
235
257
  url = parsed_url._replace(netloc=new_netloc).geturl()
258
+
236
259
  host_patterns = {
237
- "github.com": f"{url}/tree/{version}",
238
- "gitlab.com": f"{url}/-/tree/{version}",
239
- "bitbucket.org": f"{url}/src/{version}",
260
+ "github.com": f"{url}/tree/{{version}}",
261
+ "gitlab.com": f"{url}/-/tree/{{version}}",
262
+ "bitbucket.org": f"{url}/src/{{version}}",
240
263
  }
241
- if self.subdir:
242
- host_patterns = {k: f"{v}/{self.subdir}" for k, v in host_patterns.items()}
264
+
243
265
  for allowed_host, template in host_patterns.items():
244
266
  if host == allowed_host or host.endswith(f".{allowed_host}"):
267
+ if self.subdir:
268
+ return f"{template}/{self.subdir}"
245
269
  return template
246
270
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-git
3
- Version: 0.0.5rc1
3
+ Version: 0.0.6rc1
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.0rc1
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.staged.apache.org/docs/apache-airflow-providers-git/0.0.5/changelog.html
27
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-git/0.0.5
26
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html
27
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-git/0.0.6
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,7 +55,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
55
55
 
56
56
  Package ``apache-airflow-providers-git``
57
57
 
58
- Release: ``0.0.5``
58
+ Release: ``0.0.6``
59
59
 
60
60
  Release Date: ``|PypiReleaseDate|``
61
61
 
@@ -69,7 +69,7 @@ This is a provider package for ``git`` provider. All classes for this provider p
69
69
  are in ``airflow.providers.git`` python package.
70
70
 
71
71
  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.5/>`_.
72
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/>`_.
73
73
 
74
74
  Installation
75
75
  ------------
@@ -91,5 +91,5 @@ PIP package Version required
91
91
  ================== ==================
92
92
 
93
93
  The changelog for the provider package can be found in the
94
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.5/changelog.html>`_.
94
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-git/0.0.6/changelog.html>`_.
95
95
 
@@ -1,12 +1,12 @@
1
1
  airflow/providers/git/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/git/__init__.py,sha256=LytQEoDGDmL4nM2KzAS1qCi7P-FwENMzaakAVXkFzgg,1490
2
+ airflow/providers/git/__init__.py,sha256=nZvpEfMdtah87ojCio8Yk-ttLb4v8DncR-tTsaUtFDM,1490
3
3
  airflow/providers/git/get_provider_info.py,sha256=6xC_Jru3CMrhO7r5aX03J4HR6Jl62rp9BWVcLKFjxQQ,1809
4
4
  airflow/providers/git/version_compat.py,sha256=wu5478Lfl32vjsmb_tx5zQBL2aVynAVK26XqF-5Wou0,1827
5
5
  airflow/providers/git/bundles/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
- airflow/providers/git/bundles/git.py,sha256=WmmfqV3AW85wAXwH_pTXqVYJiW-DZACw3qYRGdYo6N4,9436
6
+ airflow/providers/git/bundles/git.py,sha256=hy2G58YzgLVUPxYVMMssqnOGboVpaBFdzsPRGQevcU4,10400
7
7
  airflow/providers/git/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
8
8
  airflow/providers/git/hooks/git.py,sha256=UxH-hPlmX1VphZey1svhJYUhgK1zEWsryh363k_s008,4016
9
- apache_airflow_providers_git-0.0.5rc1.dist-info/entry_points.txt,sha256=k9QR9MAaAm9yDsRDBIK3QOt5Fos3fBCqCngNFPaJnKs,99
10
- apache_airflow_providers_git-0.0.5rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
11
- apache_airflow_providers_git-0.0.5rc1.dist-info/METADATA,sha256=V08QBK5WWlux_y1F9sdN5wI1FblQKda7nAbaERYnw14,3898
12
- apache_airflow_providers_git-0.0.5rc1.dist-info/RECORD,,
9
+ apache_airflow_providers_git-0.0.6rc1.dist-info/entry_points.txt,sha256=k9QR9MAaAm9yDsRDBIK3QOt5Fos3fBCqCngNFPaJnKs,99
10
+ apache_airflow_providers_git-0.0.6rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
11
+ apache_airflow_providers_git-0.0.6rc1.dist-info/METADATA,sha256=DY0kzI3gApeyGY6joSdJ43CQDfvePipKO3bI3wRP5Nw,3898
12
+ apache_airflow_providers_git-0.0.6rc1.dist-info/RECORD,,