Hi all, I’m new to Pants and I want to set my own ...
# general
b
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
Hi! What pants version is this?
You can check with
./pants --version
. Also, welcome!
b
1.25.0
h
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
Oh, it works ; ) thanks so much
h
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
that’s really nice, I was looking at the old doc, this one seems to be much better
💯 1
h
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