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

rapid-crayon-8232

01/14/2020, 4:49 PM
There is a little bug with
local_store_dir
is
v1.24.0.dev2
. when setting the local_store in pants.ini, it should be set without the ' ', because otherwise, it creates a folder with ' in the name, example:
Copy code
[GLOBAL]
pants_version: 1.24.0.dev2
print_exception_stacktrace: True
pants_bootstrapdir: '.cache/pants'
pants_configdir: '.cache/pants/config'
local_store_dir: '.cache/pants/config/lmdb_store'
will create a folder named
'.cache
with subsequent subfolders
Copy code
local_store_dir: .cache/pants/config/lmdb_store
fixes the issue
h

hundreds-father-404

01/14/2020, 5:06 PM
That’s a quirk of ini files :/ generally, you don’t escape string values in quotes if it’s just one entry like these are But, if you have a list of strings, then you do use quotes
Hm, maybe we should revisit which file format we use for pants config. In 2013, ini was the clear answer. Now, maybe we use Toml and even support pyproject.toml to align with the greater python ecosystem?
r

rapid-crayon-8232

01/14/2020, 5:08 PM
ah that would be really cool
h

hundreds-father-404

01/14/2020, 5:09 PM
Would you find value in pyproject.toml in particular, as opposed to a dedicated pants.toml? (Although presumably we could keep supporting multiple config files - this is for what the default would be)
r

rapid-crayon-8232

01/14/2020, 5:16 PM
what would be the difference between
pants.toml
and
pyproject.toml
?
pants.toml
can't be used with other tools that support toml config files for example ?
h

hundreds-father-404

01/14/2020, 5:19 PM
Mainly that
pyproject.toml
requires prefixing everything with
tool.pants
. So you would have
tool.pants.python-setup
and
tool.pants.flake8
sections, rather than
python-setup
and
flake8
sections That doesn’t seem ideal to me, but it also allows devs to have only one config file for everything in the python ecosystem, which many people want
r

rapid-crayon-8232

01/14/2020, 5:22 PM
I guess as pants is language-agnostic having pants.toml as default is better, But still if just for the python ecosystem I prefer keeping the pyproject.toml (it's long overdue for the python ecosystem to converge 😅). mypy, flake8, black, isort and coverage already support/use pyproject.toml so maybe instead of having
tool.pants.flake8
, pants can use directly the config in
tool.flake8
?
👍 1
h

hundreds-father-404

01/14/2020, 5:25 PM
Huh, that’s an interesting thought to have Pants try to parse
pyproject.toml
to derive Pants values like
--flake8-config
. Likely out of scope for now and not enough of the ecosystem supports
pyproject.toml
yet (Flake8 and MyPy don’t), but interesting thought. I think I agree on
pants.toml
. Notably, Pants can be used without ever once having Python in your monorepo. It’s only an implementation detail that we use Python to run it all
r

rapid-crayon-8232

01/14/2020, 5:36 PM
h

hundreds-father-404

01/14/2020, 5:39 PM
Yes but those PRs are pretty old 😕 I think MyPy recently agreed to land it after some rebases and cleanup, at least! FYI see PEP 518 for why they chose TOML rather than YAML, JSON, or sticking with INI: https://www.python.org/dev/peps/pep-0518/#specification
👍 1
4 Views