gentle-flower-25372
02/22/2024, 6:16 PMpyproject.toml
and poetry.lock
files? I've looked at the example-python repo and read most of the getting starting docs with some additional docs on python and I don't understand if I need anything more than poetry_requirements(name="poetry")
in my BUILD
files, i.e. do I need to add python_sources? ๐งตgentle-flower-25372
02/22/2024, 6:16 PM[GLOBAL]
pants_version = "2.19.0"
backend_packages = [
"pants.backend.docker",
"pants.backend.experimental.python.lint.ruff",
"pants.backend.experimental.terraform",
"pants.backend.experimental.terraform.lint.tfsec",
"pants.backend.experimental.tools.yamllint",
"pants.backend.python",
"pants.backend.python.lint.black",
"pants.backend.python.typecheck.mypy",
"pants.backend.shell.lint.shellcheck",
"pants.backend.shell.lint.shfmt",
]
[source]
root_patterns = ["/"]
[ruff]
config = ".ruff.toml"
[black]
config = ".black"
[python]
interpreter_constraints = ['>=3.9,<3.11']
refined-addition-53644
02/22/2024, 6:18 PMgentle-flower-25372
02/22/2024, 6:19 PMrefined-addition-53644
02/22/2024, 6:19 PMgentle-flower-25372
02/22/2024, 6:19 PMgentle-flower-25372
02/22/2024, 6:20 PMrefined-addition-53644
02/22/2024, 6:20 PMgentle-flower-25372
02/22/2024, 6:21 PMgentle-flower-25372
02/22/2024, 6:23 PMrefined-addition-53644
02/22/2024, 6:25 PMrefined-addition-53644
02/22/2024, 6:26 PMTransitive dependencies must use the same resolve
All transitive dependencies of a source target must use the same resolve. Pants's dependency inference already handles this for you by only inferring dependencies between targets that share the same resolve. If you manually add a dependency across different resolves, Pants will error with a helpful message when you try to use that dependency.
refined-addition-53644
02/22/2024, 6:28 PMpoetry_requirements(name="<custom_name>", resolve="<custom_name>")
gentle-flower-25372
02/22/2024, 6:28 PMpants tailor ::
be generating python_sources
and python_tests
in BUILD
files or am I expected to add all of those by hand?refined-addition-53644
02/22/2024, 6:29 PMgentle-flower-25372
02/22/2024, 6:29 PM[source]
root_patterns = ["/"]
refined-addition-53644
02/22/2024, 6:30 PMgentle-flower-25372
02/22/2024, 6:32 PMrefined-addition-53644
02/22/2024, 6:32 PMI have about 150 individual pyproject.toml at varying depths within a monorepo. I set:
[source]
root_patterns = ["/"]
It depends on what your import statements look like. Read the docs please about source root and their purpose.
gentle-flower-25372
02/22/2024, 6:33 PMgentle-flower-25372
02/22/2024, 6:33 PM[source]
marker_filenames = ["pyproject.toml"]
gentle-flower-25372
02/22/2024, 6:33 PM[source]
root_patterns = ["/"]
I went with that instead.refined-addition-53644
02/22/2024, 6:34 PMcurved-television-6568
02/23/2024, 10:10 AMpyproject.toml
in the root of your repo.curved-television-6568
02/23/2024, 10:11 AMpants tailor
adds those targets for you. if it does not, something is off.