out of curiousity, if we’re only doing python dev ...
# general
d
out of curiousity, if we’re only doing python dev with pants, can the pants requirement for java installed be configured out?
e
Yes, but it's a bit titchy. Here's an example: https://github.com/apache/aurora/blob/master/pants.ini#-L14-L27 The key bit is the
backend_packages
GLOBAL
option and the key packages to turn on there are
'pants.backend.graph_info', 'pants.backend.project_info', 'pants.backend.python'
. You may not use thrift like Aurora does.
d
what does “titchy” mean in this context?
1) i don’t need thrift, and 2)
```“exception message: Rules with errors: 1 (SetupInvocationEnvironemnt, (Select(NativeToolchain),), get_setup_py_env):
e
Well, titchy in that the minimal list of backends is non-obvious. of the 3 I mentioned, only
'pants.backend.python''
is potentially guessable if you don't have a phd in Pants.
aha, so on 1.6.0 like Aurora, advice is solid. In newer Pants apparently not == titchy
d
```no matcehs for Select(NativeToolchain) with subject types: BuildFileAddress, BuildFileAddresses, Specs, Address, PathGlobs
e
what version are you using?
d
lol
stand by
1.7.0rc0 right now
e
k
gimme a bit here
d
sure no sweat
e
obviously this needs to be easier long term
d
it’s working as is, but anything i can do to simplify the toolchain, ya know
e
yup
d
Would be nice if there was just a lang-support: [...] section that turned the right backends on and off; but as I’m drowning in work I won’t be putting my hand up to do that right now :-)
e
We have that for contrib plugins
It's really just a question of re-aligning the "builtins" to all be plugins.
The missing backend in the list is
pants.backend.native
.
👍 1
Add that and you're good to go.
d
does order matter?
Copy code
backend_packages: [
    # Pants built-ins:
    'pants.backend.graph_info',
    'pants.backend.project_info',
    'pants.backend.native',
    'pants.backend.python',
  ]
yields:
Exception message: Could not satisfy data dependencies for goal 'sources' with action GatherSources_pyprep_sources: u"No producers registered for 'python'"
e
hrm
k, I have https://github.com/jsirois/pants_pure_python_repo to keep a handle on this
👍 1
I'll add a minimal python_library to repro that error
d
cool. thanks for taking some time to look into it.
like i said - I’m not blocked by this, so no pressure.
e
Unfortunately, you have to add 1 python code generating backend even if you don't use it. I added thrift here: https://github.com/jsirois/pants_pure_python_repo/commit/ae6b6870b9c9348357cef66d64f69c92878e63fc
👍 1
This will have no impact on your toolchain, the python thrift gen step will always early-noop.
d
i was just reviewing your changes there, and made the same change locally
Copy code
blackglass:omnirepo sivy$ ./pants test --changed-since=HEAD^

09:40:27 00:00 [main]
               See a report at: <http://localhost:52404/run/pants_run_2018_06_15_09_40_28_58_7f06113862454778a1581fa344304733>
09:40:28 00:01   [setup]
09:40:28 00:01     [parse]
               Executing tasks in goals: gen -> pyprep -> resolve -> test
09:40:28 00:01   [gen]
09:40:28 00:01     [thrift-py]
09:40:28 00:01   [pyprep]
09:40:28 00:01     [interpreter]
09:40:28 00:01     [build-local-dists]
09:40:28 00:01     [requirements]
09:40:28 00:01     [sources]
09:40:28 00:01   [resolve]
09:40:28 00:01     [node]
09:40:28 00:01   [test]
09:40:28 00:01     [test-prep-command]
09:40:28 00:01     [test]
09:40:28 00:01     [pytest-prep]
09:40:29 00:02     [pytest]
09:40:29 00:02     [node]
               Waiting for background workers to finish.
09:40:29 00:02   [complete]
               SUCCESS
blackglass:omnirepo sivy$
just python
thanks