Fine by me if it doesn’t break anything. I’m always on the side of less code :).
via Newton Mail [https://cloudmagic.com/k/d/mailapp?ct=dx&cv=10.0.32&pv=10.14.5&source=email_footer_2] On Fri, Nov 22, 2019 at 8:12 AM, Ash Berlin-Taylor <[email protected]> wrote: Probably worth it, but things to check: - if nose or pytest needs them under tests/ to find all the tests - if not having the init files slows down pythons package importer as it searches more paths? -a > On 22 Nov 2019, at 12:06, Jarek Potiuk <[email protected]> wrote: > > There is one implementation detail in AIP-21 that I continue to have > questions about, and I wanted to ask community about it. > > Since we moved to Python 3, we have the option of using implicit namespace > packages. > https://www.python.org/dev/peps/pep-0420/ . We have now grouping per folder > for services, so it would require a lot more __init__.py files if we > continue using them. > > The implicit naming boils down to not requiring __init__.py files if no > initialisation of package is needed. We could do it consistently for all > code which is "internal" to airflow. This means that most packages will not > have __init__.py there will be few exceptions like 'airflow', > 'airflow.modules' and likely few others with the __init__.py. > > I did a quick check and we have only 25 _init_.py with some logic - > remaining ~ 140 could be removed as they only contain comments. > > find . -name '__init__.py' | xargs grep -le '^[^#].*' | wc -l > 25 > find . -name '__init__.py' |wc -l > 164 > > Those are the files that will be left: > ./tests/__init__.py > ./tests/utils/log/elasticmock/__init__.py > ./tests/utils/log/elasticmock/utilities/__init__.py > ./tests/models/__init__.py > ./tests/task/__init__.py > ./airflow/sensors/__init__.py > ./airflow/operators/__init__.py > ./airflow/_vendor/nvd3/__init__.py > ./airflow/_vendor/slugify/__init__.py > ./airflow/serialization/__init__.py > ./airflow/__init__.py > ./airflow/models/__init__.py > ./airflow/www/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py > ./airflow/ti_deps/deps/__init__.py > ./airflow/macros/__init__.py > ./airflow/executors/__init__.py > ./airflow/lineage/__init__.py > ./airflow/lineage/backend/__init__.py > ./airflow/lineage/backend/atlas/__init__.py > ./airflow/hooks/__init__.py > ./airflow/task/task_runner/__init__.py > ./airflow/api/__init__.py > ./airflow/api/common/experimental/__init__.py > ./airflow/api/client/__init__.py > ./airflow/jobs/__init__.py > > WDYT? > > J > > -- > > Jarek Potiuk > Polidea <https://www.polidea.com/> | Principal Software Engineer > > M: +48 660 796 129 <+48660796129> > [image: Polidea] <https://www.polidea.com/>
