potiuk commented on a change in pull request #17757:
URL: https://github.com/apache/airflow/pull/17757#discussion_r694741298
##########
File path: docs/apache-airflow/modules_management.rst
##########
@@ -68,99 +81,192 @@ In the next section, you will learn how to create your own
simple
installable package and how to specify additional directories to be added
to ``sys.path`` using the environment variable :envvar:`PYTHONPATH`.
+If you want to import some packages from a directory that is added to
``PYTHONPATH`` you should import
+it following the full Python path of the files. All directories where you put
your files have to also
+have an empty ``__init__.py`` file which turns it into Python package. Take as
an example such structure
Review comment:
Summarising then what this PR is all about in one paragraph (and you can
quote me on that and I can add this paragraph to the "modules management"):
> Both relative imports and implicit namespaces while somewhat useful
features of Python 3, have potential of being misused, misunderstood and break
the installation in implicit ways which are difficult to debug and understand.
Rather than trying to make them works with Airflow DAG parsing we strongly
discourage people from using them. DAGs should be written using absolute
imports and regular "classic" packages with `__init__.py` - for performance
reasons, but most of all for the sanity of both the users and committers trying
to help them.
😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]