enough-analyst-54434
02/26/2022, 5:19 PM$ touch src/python/pants/__init__.py
$ echo "/src/python/pants/__init__.py" >> .gitignore
$ ./pants package src/python/pants:pants-packaged
09:12:27.18 [INFO] Initializing scheduler...
09:12:27.40 [INFO] Scheduler initialized.
09:12:35.15 [INFO] Wrote dist/pantsbuild.pants-2.11.0.dev1-cp37-cp37m-linux_x86_64.whl
$ zipinfo dist/pantsbuild.pants-2.11.0.dev1-cp37-cp37m-linux_x86_64.whl | grep "pants/__init__.py"
-rw-r--r-- 2.0 unx 0 b- defN 22-Feb-26 17:12 pants/__init__.py
And, if not, this is surely broken:
$ git diff src/python/pants/BUILD
diff --git a/src/python/pants/BUILD b/src/python/pants/BUILD
index baa028ffb..d2d6339ca 100644
--- a/src/python/pants/BUILD
+++ b/src/python/pants/BUILD
@@ -2,6 +2,11 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).
python_sources(
+ sources=[
+ "*.py",
+ # We never want to include __init__.py if it happens to be laying around ... more words.'
+ "!__init__.py"
+ ],
overrides={
# Enable `python -m pants ...` style execution ala `json.tool` or `venv`.
"__main__.py": {"dependencies": ["src/python/pants/bin:pants_loader"]},
$ $ ./pants filedeps src/python/pants
09:18:44.54 [INFO] Initializing scheduler...
09:18:44.74 [INFO] Scheduler initialized.
src/python/pants/BUILD
src/python/pants/__main__.py
src/python/pants/conftest.py
src/python/pants/version.py
$ ./pants package src/python/pants:pants-packaged
09:19:02.82 [INFO] Wrote dist/pantsbuild.pants-2.11.0.dev1-cp37-cp37m-linux_x86_64.whl
$ zipinfo dist/pantsbuild.pants-2.11.0.dev1-cp37-cp37m-linux_x86_64.whl | grep "pants/__init__.py"
-rw-r--r-- 2.0 unx 0 b- defN 22-Feb-26 17:18 pants/__init__.py