Skip to content

Commit

Permalink
Enable explicit namespaces (apache#42951)
Browse files Browse the repository at this point in the history
* 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 <ash_github@firemirror.com>

* Remove duplicate line

* Rephrase relevant comments

* Add providers tests init file to autoapi_ignore

* typo

Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>

---------

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
  • Loading branch information
3 people authored and harjeevanmaan committed Oct 23, 2024
1 parent 4dbfe07 commit ddaca88
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
11 changes: 5 additions & 6 deletions airflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,12 +64,6 @@
"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
Expand Down
26 changes: 26 additions & 0 deletions providers/src/airflow/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ddaca88

Please sign in to comment.