Using v2.0.0.rc1, I was trying to build a package ...
# general
j
Using v2.0.0.rc1, I was trying to build a package for the first time and received the below source roots error. Is this a bug or an issue with my config?
I ran
./pants package acme/src/python/jupyter_stubber:jupyter-stubber-py3-dist
to get this output.
Our
pants.toml
has the following in `[source]`:
Copy code
root_patterns = [
  "src/python",
  "test/python",
  "tests/python",
...
]
h
I wouldn’t expect you to have an init there. Your first init should be at acme/src/python, and nothing above it
That is, you want
acme/src/python/__init__.py
and
acme/src/python/jupyter_stubber/__init__.py
, but not
acme/src/__init__.py
or anything above it The reason this is breaking with 2.0 is that Pants now always includes all ancestor
__init__.py
files, which is really important for how Python modules work. Before, Pants would only include what you explicitly included with
dependencies
, and then it would automagically create missing ones. The end result is that
acme/__init__.py
was ignored before, but now it’s being used
e
What Eric said, but you actually only want
acme/src/python/jupyter_stubber/__init__.py
👍 1
j
Oh boy. I think we have a few of these. Thank you.