https://pantsbuild.org/ logo
#general
Title
# general
b

bulky-evening-62934

04/08/2020, 8:37 AM
Hi all, I’m new to Pants and I want to set my own source root patterns, it works with something like
./pants --source-source-root-patterns='["srctest/*"]' binary srctest/python/app/hello
But I cannot set this options in
pants.toml
,
Copy code
[source]
source_root_patterns = [
    "srctest/*"
]
the code above doesn’t work, does anyone know how to set it correctly ?
h

hundreds-father-404

04/08/2020, 9:07 AM
Hi! What pants version is this?
You can check with
./pants --version
. Also, welcome!
b

bulky-evening-62934

04/08/2020, 10:25 AM
1.25.0
h

hundreds-father-404

04/08/2020, 5:09 PM
Ah, you hit a weird transition time that Pants used to use the INI file format instead of TOML. In Pants 1.26, we changed the preferred format to TOML. The weird point you hit is that
pip install pantsbuild.pants
will use 1.25.0 because it’s the last stable release, but the docs talk about TOML. (We’re rewriting our docs and one of the improvements is having different versions of the docs so that we never encounter this: see https://pants.readme.io/docs, which you might want to use either way if you’re using Python) The fix here is to change your
version
to
1.26.0rc1
in `pants.toml`:
Copy code
[GLOBAL]
version = "1.26.0rc1"
Sorry about this all!
Let us know if that fixes it and if you have any other questions! We’d love to help.
b

bulky-evening-62934

04/08/2020, 5:14 PM
Oh, it works ; ) thanks so much
h

hundreds-father-404

04/08/2020, 5:17 PM
Great! But yeah, I recommend using the docs at https://pants.readme.io/docs. They are still a WIP, but an improvement from the original docs and they show you how to use what we call the V2 engine, which is a better implementation of Pants with much better caching, generally less overhead, better output/UX, and better parallelism.
👍 1
b

bulky-evening-62934

04/08/2020, 5:19 PM
that’s really nice, I was looking at the old doc, this one seems to be much better
💯 1
h

hundreds-father-404

04/08/2020, 5:28 PM
Btw, I recommend using 1.27.0.dev2 if you do end up following these new docs. They make several improvements to V2 Python support. While it’s technically a dev release, it should be stable for what you’re doing and we’ve been using it internally in Pants and the company I work for
👍 1