This is an automated email from the ASF dual-hosted git repository.
shahar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 251fc5818c5 Enable explicit namespaces (#42951)
251fc5818c5 is described below
commit 251fc5818c519842664d40b5520c013cbb5d89b3
Author: D. Ferruzzi <[email protected]>
AuthorDate: Wed Oct 16 04:38:27 2024 -0700
Enable explicit namespaces (#42951)
* The recent PR to reorganize the package requires a change to explicit
namespaces for at least some IDEs (PyChasrm for sure, possibly others).
* static fixes
* Update providers/src/airflow/providers/__init__.py
Co-authored-by: Ash Berlin-Taylor <[email protected]>
* Remove duplicate line
* Rephrase relevant comments
* Add providers tests init file to autoapi_ignore
* typo
Co-authored-by: Shahar Epstein <[email protected]>
---------
Co-authored-by: Ash Berlin-Taylor <[email protected]>
Co-authored-by: Shahar Epstein <[email protected]>
---
airflow/__init__.py | 11 +++++------
providers/src/airflow/providers/__init__.py | 26 ++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/airflow/__init__.py b/airflow/__init__.py
index 18f4cc3e3c2..f6c40b5091b 100644
--- a/airflow/__init__.py
+++ b/airflow/__init__.py
@@ -17,6 +17,11 @@
# under the License.
from __future__ import annotations
+# Make `airflow` a namespace package, supporting installing
+# airflow.providers.* in different locations (i.e. one in site, and one in user
+# lib.) This is required by some IDEs to resolve the import paths.
+__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type:
ignore
+
__version__ = "3.0.0.dev0"
import os
@@ -59,12 +64,6 @@ __all__ = [
"XComArg",
]
-# Make `airflow` a namespace package, supporting installing
-# airflow.providers.* in different locations (i.e. one in site, and one in user
-# lib.)
-__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type:
ignore
-
-
# Perform side-effects unless someone has explicitly opted out before import
# WARNING: DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU'RE DOING.
# This environment variable prevents proper initialization, and things like
diff --git a/providers/src/airflow/providers/__init__.py
b/providers/src/airflow/providers/__init__.py
new file mode 100644
index 00000000000..66fbd04b36e
--- /dev/null
+++ b/providers/src/airflow/providers/__init__.py
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+# Make `airflow` a namespace package, supporting installing
+# airflow.providers.* in different locations (i.e. one in site, and one in user
+# lib.) This is required by some IDEs to resolve the import paths.
+#
+# Note: this file is not installed or distributed in any distribution!
+__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type:
ignore