apache-airflow-providers-telegram 3.1.1__tar.gz → 4.0.0__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 (23) hide show
  1. {apache-airflow-providers-telegram-3.1.1/apache_airflow_providers_telegram.egg-info → apache-airflow-providers-telegram-4.0.0}/PKG-INFO +17 -5
  2. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/README.rst +15 -3
  3. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/get_provider_info.py +2 -1
  4. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/hooks/telegram.py +6 -4
  5. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0/apache_airflow_providers_telegram.egg-info}/PKG-INFO +17 -5
  6. apache-airflow-providers-telegram-4.0.0/apache_airflow_providers_telegram.egg-info/requires.txt +2 -0
  7. apache-airflow-providers-telegram-4.0.0/pyproject.toml +126 -0
  8. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/setup.cfg +2 -2
  9. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/setup.py +1 -1
  10. apache-airflow-providers-telegram-3.1.1/apache_airflow_providers_telegram.egg-info/requires.txt +0 -2
  11. apache-airflow-providers-telegram-3.1.1/pyproject.toml +0 -40
  12. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/LICENSE +0 -0
  13. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/MANIFEST.in +0 -0
  14. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/NOTICE +0 -0
  15. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/__init__.py +0 -0
  16. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/hooks/__init__.py +0 -0
  17. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/operators/__init__.py +0 -0
  18. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/airflow/providers/telegram/operators/telegram.py +0 -0
  19. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/apache_airflow_providers_telegram.egg-info/SOURCES.txt +0 -0
  20. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/apache_airflow_providers_telegram.egg-info/dependency_links.txt +0 -0
  21. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/apache_airflow_providers_telegram.egg-info/entry_points.txt +0 -0
  22. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/apache_airflow_providers_telegram.egg-info/not-zip-safe +0 -0
  23. {apache-airflow-providers-telegram-3.1.1 → apache-airflow-providers-telegram-4.0.0}/apache_airflow_providers_telegram.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-telegram
3
- Version: 3.1.1
3
+ Version: 4.0.0
4
4
  Summary: Provider for Apache Airflow. Implements apache-airflow-providers-telegram package
5
5
  Home-page: https://airflow.apache.org/
6
6
  Author: Apache Software Foundation
7
7
  Author-email: dev@airflow.apache.org
8
8
  License: Apache License 2.0
9
9
  Download-URL: https://archive.apache.org/dist/airflow/providers
10
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/
11
11
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
12
12
  Project-URL: Source Code, https://github.com/apache/airflow
13
13
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
@@ -53,7 +53,7 @@ License-File: NOTICE
53
53
 
54
54
  Package ``apache-airflow-providers-telegram``
55
55
 
56
- Release: ``3.1.1``
56
+ Release: ``4.0.0``
57
57
 
58
58
 
59
59
  `Telegram <https://telegram.org/>`__
@@ -66,7 +66,7 @@ This is a provider package for ``telegram`` provider. All classes for this provi
66
66
  are in ``airflow.providers.telegram`` python package.
67
67
 
68
68
  You can find package information and changelog for the provider
69
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/>`_.
69
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/>`_.
70
70
 
71
71
 
72
72
  Installation
@@ -85,7 +85,7 @@ Requirements
85
85
  PIP package Version required
86
86
  ======================= ==================
87
87
  ``apache-airflow`` ``>=2.3.0``
88
- ``python-telegram-bot`` ``>=13.0,<20.0.0``
88
+ ``python-telegram-bot`` ``>=20.0.0``
89
89
  ======================= ==================
90
90
 
91
91
  .. Licensed to the Apache Software Foundation (ASF) under one
@@ -114,6 +114,18 @@ PIP package Version required
114
114
  Changelog
115
115
  ---------
116
116
 
117
+ 4.0.0
118
+ .....
119
+
120
+ Breaking changes
121
+ ~~~~~~~~~~~~~~~~
122
+
123
+ In this version, we upgraded the ``python-telegram-bot`` to ``20.0.0`` and above.
124
+ All remains the same except that now the ``get_conn()`` method in ``TelegramHook`` is a coroutine function.
125
+ Refer to `python-telegram-bot transition guide <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-20.0#asyncio>`_ for more details.
126
+
127
+ * ``Updated Telegram Provider to ensure compatbility with >=20.0.0 (#28953)``
128
+
117
129
  3.1.1
118
130
  .....
119
131
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  Package ``apache-airflow-providers-telegram``
21
21
 
22
- Release: ``3.1.1``
22
+ Release: ``4.0.0``
23
23
 
24
24
 
25
25
  `Telegram <https://telegram.org/>`__
@@ -32,7 +32,7 @@ This is a provider package for ``telegram`` provider. All classes for this provi
32
32
  are in ``airflow.providers.telegram`` python package.
33
33
 
34
34
  You can find package information and changelog for the provider
35
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/>`_.
35
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/>`_.
36
36
 
37
37
 
38
38
  Installation
@@ -51,7 +51,7 @@ Requirements
51
51
  PIP package Version required
52
52
  ======================= ==================
53
53
  ``apache-airflow`` ``>=2.3.0``
54
- ``python-telegram-bot`` ``>=13.0,<20.0.0``
54
+ ``python-telegram-bot`` ``>=20.0.0``
55
55
  ======================= ==================
56
56
 
57
57
  .. Licensed to the Apache Software Foundation (ASF) under one
@@ -80,6 +80,18 @@ PIP package Version required
80
80
  Changelog
81
81
  ---------
82
82
 
83
+ 4.0.0
84
+ .....
85
+
86
+ Breaking changes
87
+ ~~~~~~~~~~~~~~~~
88
+
89
+ In this version, we upgraded the ``python-telegram-bot`` to ``20.0.0`` and above.
90
+ All remains the same except that now the ``get_conn()`` method in ``TelegramHook`` is a coroutine function.
91
+ Refer to `python-telegram-bot transition guide <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-20.0#asyncio>`_ for more details.
92
+
93
+ * ``Updated Telegram Provider to ensure compatbility with >=20.0.0 (#28953)``
94
+
83
95
  3.1.1
84
96
  .....
85
97
 
@@ -28,6 +28,7 @@ def get_provider_info():
28
28
  "name": "Telegram",
29
29
  "description": "`Telegram <https://telegram.org/>`__\n",
30
30
  "versions": [
31
+ "4.0.0",
31
32
  "3.1.1",
32
33
  "3.1.0",
33
34
  "3.0.0",
@@ -40,7 +41,7 @@ def get_provider_info():
40
41
  "1.0.1",
41
42
  "1.0.0",
42
43
  ],
43
- "dependencies": ["apache-airflow>=2.3.0", "python-telegram-bot>=13.0,<20.0.0"],
44
+ "dependencies": ["apache-airflow>=2.3.0", "python-telegram-bot>=20.0.0"],
44
45
  "integrations": [
45
46
  {
46
47
  "integration-name": "Telegram",
@@ -18,6 +18,8 @@
18
18
  """Hook for Telegram"""
19
19
  from __future__ import annotations
20
20
 
21
+ import asyncio
22
+
21
23
  import telegram
22
24
  import tenacity
23
25
 
@@ -67,13 +69,13 @@ class TelegramHook(BaseHook):
67
69
  self.chat_id = self.__get_chat_id(chat_id, telegram_conn_id)
68
70
  self.connection = self.get_conn()
69
71
 
70
- def get_conn(self) -> telegram.bot.Bot:
72
+ def get_conn(self) -> telegram.Bot:
71
73
  """
72
74
  Returns the telegram bot client
73
75
 
74
76
  :return: telegram bot client
75
77
  """
76
- return telegram.bot.Bot(token=self.token)
78
+ return telegram.Bot(self.token)
77
79
 
78
80
  def __get_token(self, token: str | None, telegram_conn_id: str | None) -> str:
79
81
  """
@@ -126,7 +128,7 @@ class TelegramHook(BaseHook):
126
128
  """
127
129
  kwargs = {
128
130
  "chat_id": self.chat_id,
129
- "parse_mode": telegram.parsemode.ParseMode.HTML,
131
+ "parse_mode": telegram.constants.ParseMode.HTML,
130
132
  "disable_web_page_preview": True,
131
133
  }
132
134
  kwargs.update(api_params)
@@ -137,5 +139,5 @@ class TelegramHook(BaseHook):
137
139
  if kwargs["chat_id"] is None:
138
140
  raise AirflowException("'chat_id' must be provided for telegram message")
139
141
 
140
- response = self.connection.send_message(**kwargs)
142
+ response = asyncio.run(self.connection.send_message(**kwargs))
141
143
  self.log.debug(response)
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-telegram
3
- Version: 3.1.1
3
+ Version: 4.0.0
4
4
  Summary: Provider for Apache Airflow. Implements apache-airflow-providers-telegram package
5
5
  Home-page: https://airflow.apache.org/
6
6
  Author: Apache Software Foundation
7
7
  Author-email: dev@airflow.apache.org
8
8
  License: Apache License 2.0
9
9
  Download-URL: https://archive.apache.org/dist/airflow/providers
10
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/
11
11
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
12
12
  Project-URL: Source Code, https://github.com/apache/airflow
13
13
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
@@ -53,7 +53,7 @@ License-File: NOTICE
53
53
 
54
54
  Package ``apache-airflow-providers-telegram``
55
55
 
56
- Release: ``3.1.1``
56
+ Release: ``4.0.0``
57
57
 
58
58
 
59
59
  `Telegram <https://telegram.org/>`__
@@ -66,7 +66,7 @@ This is a provider package for ``telegram`` provider. All classes for this provi
66
66
  are in ``airflow.providers.telegram`` python package.
67
67
 
68
68
  You can find package information and changelog for the provider
69
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/>`_.
69
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/>`_.
70
70
 
71
71
 
72
72
  Installation
@@ -85,7 +85,7 @@ Requirements
85
85
  PIP package Version required
86
86
  ======================= ==================
87
87
  ``apache-airflow`` ``>=2.3.0``
88
- ``python-telegram-bot`` ``>=13.0,<20.0.0``
88
+ ``python-telegram-bot`` ``>=20.0.0``
89
89
  ======================= ==================
90
90
 
91
91
  .. Licensed to the Apache Software Foundation (ASF) under one
@@ -114,6 +114,18 @@ PIP package Version required
114
114
  Changelog
115
115
  ---------
116
116
 
117
+ 4.0.0
118
+ .....
119
+
120
+ Breaking changes
121
+ ~~~~~~~~~~~~~~~~
122
+
123
+ In this version, we upgraded the ``python-telegram-bot`` to ``20.0.0`` and above.
124
+ All remains the same except that now the ``get_conn()`` method in ``TelegramHook`` is a coroutine function.
125
+ Refer to `python-telegram-bot transition guide <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-20.0#asyncio>`_ for more details.
126
+
127
+ * ``Updated Telegram Provider to ensure compatbility with >=20.0.0 (#28953)``
128
+
117
129
  3.1.1
118
130
  .....
119
131
 
@@ -0,0 +1,2 @@
1
+ apache-airflow>=2.3.0
2
+ python-telegram-bot>=20.0.0
@@ -0,0 +1,126 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ [tool.black]
18
+ line-length = 110
19
+ target-version = ['py37', 'py38', 'py39', 'py310']
20
+ # The build system section is needed in order to workaround the side-effect introduced by recent
21
+ # setup tools version. The recent setuptools version update (64.0.0) broke paths of editable installations
22
+ # and we have to pin it to 63.4.3 version
23
+ # The problem is tracked (and this limitation might be removed if it is solved) in:
24
+ # https://github.com/pypa/setuptools/issues/3548
25
+ [build-system]
26
+ requires = ['setuptools==67.2.0']
27
+ build-backend = "setuptools.build_meta"
28
+
29
+ [tool.ruff]
30
+ typing-modules = ["airflow.typing_compat"]
31
+ line-length = 110
32
+ extend-exclude = [
33
+ ".eggs",
34
+ "airflow/_vendor/*",
35
+
36
+ # The files generated by stubgen aren't 100% valid syntax it turns out, and we don't ship them, so we can
37
+ # ignore them in ruff
38
+ "airflow/providers/common/sql/*/*.pyi"
39
+ ]
40
+
41
+ # TODO: Bump to Python 3.8 when support for Python 3.7 is dropped in Airflow.
42
+ target-version = "py37"
43
+
44
+ extend-select = [
45
+ "I", # Missing required import (auto-fixable)
46
+ "UP", # Pyupgrade
47
+ "RUF100", # Unused noqa (auto-fixable)
48
+
49
+ # We ignore more pydocstyle than we enable, so be more selective at what we enable
50
+ "D101",
51
+ "D106",
52
+ "D2",
53
+ "D3",
54
+ # "D401", # Not enabled by ruff, but we don't want it
55
+ "D402",
56
+ "D403",
57
+ "D412",
58
+ "D419"
59
+ ]
60
+ extend-ignore = [
61
+ "D203",
62
+ "D205",
63
+ "D212",
64
+ "D213",
65
+ "D214",
66
+ "D215",
67
+ "E731",
68
+ ]
69
+
70
+ [tool.ruff.isort]
71
+ known-first-party = ["airflow", "airflow_breeze", "docker_tests", "docs", "kubernetes_tests", "tests"]
72
+ required-imports = ["from __future__ import annotations"]
73
+ combine-as-imports = true
74
+
75
+ # TODO: for now, https://github.com/charliermarsh/ruff/issues/1817
76
+ known-third-party = [
77
+ "asana",
78
+ "atlassian",
79
+ "celery",
80
+ "cloudant",
81
+ "databricks",
82
+ "datadog",
83
+ "docker",
84
+ "elasticsearch",
85
+ "github",
86
+ "google",
87
+ "grpc",
88
+ "jenkins",
89
+ "mysql",
90
+ "neo4j",
91
+ "papermill",
92
+ "redis",
93
+ "sendgrid",
94
+ "snowflake",
95
+ "telegram",
96
+ "trino",
97
+ ]
98
+
99
+ [tool.ruff.per-file-ignores]
100
+ "airflow/models/__init__.py" = ["F401"]
101
+ "airflow/models/sqla_models.py" = ["F401"]
102
+
103
+
104
+ # The test_python.py is needed because adding __future__.annotations breaks runtime checks that are
105
+ # needed for the test to work
106
+ "tests/decorators/test_python.py" = ["I002"]
107
+
108
+ # Ignore pydoc style from these
109
+ "*.pyi" = ["D"]
110
+ "tests/*" = ["D"]
111
+ "scripts/*" = ["D"]
112
+ "dev/*" = ["D"]
113
+ "docs/*" = ["D"]
114
+ "provider_packages/*" = ["D"]
115
+ "docker_tests/*" = ["D"]
116
+ "kubernetes_tests/*" = ["D"]
117
+ "*/example_dags/*" = ["D"]
118
+ "chart/*" = ["D"]
119
+
120
+ # All of the modules which have an extra license header (i.e. that we copy from another project) need to
121
+ # ignore E402 -- module level import not at top level
122
+ "airflow/api/auth/backend/kerberos_auth.py" = ["E402"]
123
+ "airflow/security/kerberos.py" = ["E402"]
124
+ "airflow/security/utils.py" = ["E402"]
125
+ "tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"]
126
+ "tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = ["E402"]
@@ -27,7 +27,7 @@ classifiers =
27
27
  Programming Language :: Python :: 3.10
28
28
  Topic :: System :: Monitoring
29
29
  project_urls =
30
- Documentation=https://airflow.apache.org/docs/apache-airflow-providers-telegram/3.1.1/
30
+ Documentation=https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/
31
31
  Bug Tracker=https://github.com/apache/airflow/issues
32
32
  Source Code=https://github.com/apache/airflow
33
33
  Slack Chat=https://s.apache.org/airflow-slack
@@ -47,7 +47,7 @@ setup_requires =
47
47
  wheel
48
48
  install_requires =
49
49
  apache-airflow>=2.3.0
50
- python-telegram-bot>=13.0,<20.0.0
50
+ python-telegram-bot>=20.0.0
51
51
 
52
52
  [options.entry_points]
53
53
  apache_airflow_provider =
@@ -26,7 +26,7 @@
26
26
 
27
27
  from setuptools import find_namespace_packages, setup
28
28
 
29
- version = "3.1.1"
29
+ version = "4.0.0"
30
30
 
31
31
 
32
32
  def do_setup():
@@ -1,2 +0,0 @@
1
- apache-airflow>=2.3.0
2
- python-telegram-bot<20.0.0,>=13.0
@@ -1,40 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
- [tool.black]
18
- line-length = 110
19
- target-version = ['py37', 'py38', 'py39', 'py310']
20
- # The build system section is needed in order to workaround the side-effect introduced by recent
21
- # setup tools version. The recent setuptools version update (64.0.0) broke paths of editable installations
22
- # and we have to pin it to 63.4.3 version
23
- # The problem is tracked (and this limitation might be removed if it is solved) in:
24
- # https://github.com/pypa/setuptools/issues/3548
25
- [build-system]
26
- requires = ['setuptools==63.4.3']
27
- build-backend = "setuptools.build_meta"
28
- [tool.isort]
29
- add_imports = ["from __future__ import annotations"]
30
- append_only = true
31
- line_length = 110
32
- combine_as_imports = true
33
- default_section = "THIRDPARTY"
34
- known_first_party = ["airflow", "airflow_breeze", "docker_tests", "docs", "kubernetes_tests", "tests"]
35
- # The test_python.py is needed because adding __future__.annotations breaks runtime checks that are
36
- # needed for the test to work
37
- skip = ["build", ".tox", "venv", "tests/decorators/test_python.py"]
38
- lines_between_types = 0
39
- skip_glob = ["*.pyi"]
40
- profile = "black"