hey folks, I'm having trouble pulling in the pypro...
# plugins
c
hey folks, I'm having trouble pulling in the pyproject.toml in a ConfigFilesRequest. I can't seem to get check_existence or check_content to work, although I can get manually specified values to work. pants is at 2.13.0rc0
Copy code
def config_request(self) -> ConfigFilesRequest:
        return ConfigFilesRequest(
            specified=self.config,
            specified_option_name=f"[{self.options_scope}].config",
            check_existence=["pyproject.toml"],
            check_content={"pyproject.toml": b"[tool.vulture]"},
        )
1
h
Hm, what's going on with it? Also I think you only want one of
check_existence
or
check_content
for the same file at a time
And you may want to use the string
[tool.vulture
without the final
]
, so that people can use
[tool.venture.some_option]
c
pyproject.toml just never shows up in the ConfigFiles.snapshot with the check_*.
h
Is that
pyproject.toml
in the repo root?
👍 1
c
how does config_discovery interact with this? is it necessary to set it too?
yep, it's at the repo root. I also tried just having one of {check_existence|check_content} active, and that didn't seem to change
h
Ah, yes it is! That is how we know whether to exercise the code path or not. Good catch
In pantsbuild/pants, we always have an option
--config-discovery
so that users can turn it off if they don't like it
(general project philosophy is to have useful magic/defaults like dependency inference, but give users a way out if they don't like it)
c
```else look for candidate config files if
discovery is enabled```
hey it even says so in the docs. thanks folks!
❤️ 1