billowy-motherboard-58443
10/02/2020, 6:01 PMwitty-crayon-22786
10/02/2020, 6:12 PM__init__.py
files… are there any in this directory structure?witty-crayon-22786
10/02/2020, 6:13 PMbillowy-motherboard-58443
10/02/2020, 6:25 PMbillowy-motherboard-58443
10/02/2020, 6:25 PMbillowy-motherboard-58443
10/02/2020, 6:25 PMwitty-crayon-22786
10/02/2020, 6:27 PM__init__.py
files in parent directories?billowy-motherboard-58443
10/02/2020, 6:30 PMbillowy-motherboard-58443
10/02/2020, 6:30 PMbillowy-motherboard-58443
10/02/2020, 6:30 PMbillowy-motherboard-58443
10/02/2020, 6:31 PMwitty-crayon-22786
10/02/2020, 6:33 PMwitty-crayon-22786
10/02/2020, 6:33 PM__init__.py
and no-init py though will cause trouble with or without a build tool though, afaikbillowy-motherboard-58443
10/02/2020, 6:34 PMbillowy-motherboard-58443
10/02/2020, 6:34 PMbillowy-motherboard-58443
10/02/2020, 6:34 PMwitty-crayon-22786
10/02/2020, 6:34 PM__init__.py
files, or fully not using them.witty-crayon-22786
10/02/2020, 6:35 PMbillowy-motherboard-58443
10/02/2020, 6:35 PMimpl
dir for "traditional" reasons, but it doen't really play well with the toolingbillowy-motherboard-58443
10/02/2020, 6:36 PMwitty-crayon-22786
10/02/2020, 6:36 PMbillowy-motherboard-58443
10/02/2020, 6:36 PMbillowy-motherboard-58443
10/02/2020, 6:36 PMwitty-crayon-22786
10/02/2020, 6:37 PMproject1
parent
child
one.py
project2
parent
child
two.py
witty-crayon-22786
10/02/2020, 6:37 PMwitty-crayon-22786
10/02/2020, 6:38 PMparent.child
, and the “multiple places” is project1/2)billowy-motherboard-58443
10/02/2020, 6:38 PMns
project 1
files...
ns2
project2
files...
witty-crayon-22786
10/02/2020, 6:39 PMbillowy-motherboard-58443
10/02/2020, 6:39 PMwitty-crayon-22786
10/02/2020, 6:40 PMwitty-crayon-22786
10/02/2020, 6:40 PMns.core
and ns.core.leader_election.zookeeper
billowy-motherboard-58443
10/02/2020, 6:40 PMwitty-crayon-22786
10/02/2020, 6:40 PMbillowy-motherboard-58443
10/02/2020, 6:40 PMbillowy-motherboard-58443
10/02/2020, 6:40 PMwitty-crayon-22786
10/02/2020, 6:41 PMwitty-crayon-22786
10/02/2020, 6:41 PMwitty-crayon-22786
10/02/2020, 6:41 PMbillowy-motherboard-58443
10/02/2020, 6:41 PMbillowy-motherboard-58443
10/02/2020, 6:42 PMbillowy-motherboard-58443
10/02/2020, 6:42 PMbillowy-motherboard-58443
10/02/2020, 6:42 PMwitty-crayon-22786
10/02/2020, 6:43 PMns.core
is a package)”witty-crayon-22786
10/02/2020, 6:43 PMwitty-crayon-22786
10/02/2020, 6:45 PMwitty-crayon-22786
10/02/2020, 6:45 PMwitty-crayon-22786
10/02/2020, 6:46 PMns
core
<code>
leader_election
<code>
cassandra
<code>
zookeeper
<code>
billowy-motherboard-58443
10/02/2020, 6:47 PMwitty-crayon-22786
10/02/2020, 6:47 PMbillowy-motherboard-58443
10/02/2020, 6:47 PMimpl
dir under leader_electionwitty-crayon-22786
10/02/2020, 6:47 PMbillowy-motherboard-58443
10/02/2020, 6:47 PMwitty-crayon-22786
10/02/2020, 6:48 PM__init__.py
and namespace packages. you cannot have both ime.witty-crayon-22786
10/02/2020, 6:48 PMbillowy-motherboard-58443
10/02/2020, 6:48 PMns
) just fine, but seems like "don't do that in the middle of the tree"witty-crayon-22786
10/02/2020, 6:49 PMbillowy-motherboard-58443
10/02/2020, 6:49 PMbillowy-motherboard-58443
10/02/2020, 6:49 PMwitty-crayon-22786
10/02/2020, 7:03 PMwitty-crayon-22786
10/02/2020, 7:05 PMwitty-crayon-22786
10/02/2020, 7:05 PMhundreds-father-404
10/02/2020, 9:14 PM__init__.py
file. People often end up using it without realizing they’re using it
Several tools don’t work properly with it, either. For example, we haven’t figured out how to get MyPy to play nicely with PEP 420, even independently of Pants.
Generally, I’d recommend for folks to use empty __init__.py
files in each directory. It’s boiler-platey, but simple.
And you can use the ./pants validate
goal if you want to enforce that nothing is ever included in those files. (It does regex checks for your files)enough-analyst-54434
10/03/2020, 9:40 PM