I'm working on adding Pants to another repo now an...
# general
l
I'm working on adding Pants to another repo now and hitting a snag. If I run the dependencies goal then I'm not seeing the files get included properly, nor any third party dependencies.
Copy code
./pants dependencies --type=source-and-3rdparty src/mitol-django-mail:mail                                                                                                       
src/mitol-django-mail/manage.py:mail
The repository and branch is at https://github.com/mitodl/ol-django/tree/putting_on_pants
h
If that’s up to date, looks like you’re missing a couple BUILD files. * Root level, with the macro
python_requirements()
to get 3rd party reqs working * Some subdirectories, like
ol-django/src/mitol-django-common/mitol/common/
. You have
python_library()
in the parent, but it’s using the default
sources=['*.py', '!*_test.py', '!test_*.py']
, so it doesn’t recurse. You can either explicitly set sources and use
**
, or use that same pattern from the other repo of 1 build file per directory, with usually nothing more than this in it:
Copy code
python_library()
python_tests(name="tests")
By the way, we’re considering redesigning the idea of targets to make this more intuitive. Now that we have dependency inference, there are a lot of things we couldn’t do before to do another round of boilerplate reduction Pardon the cognitive load of dealing with targets in the meantime
l
Right, thanks 👍
h
At the very least, an
init
script to create these for you is a no-brainer. 🙂
💯 1