Hi Joshua and everyone! I am a machine learning en...
# welcome
h
Hi Joshua and everyone! I am a machine learning engineer and my org is creating different actual engineering solutions. We are currently moving a project to a monorepo for future proofing and we are checking out pants! Found pants after lots of reading. It is not the only option, but is the option we wanted to give a try as we see lots of progress and support is available ☺️
👋 6
h
Cool! What languages/backends are you planning to use?
h
we are using python with black, isort, pylint, bandit, mypy. We might also start using
docformatter
as its available, but we want to make it work with
pydocstyle
as we were using it already. Still very new to monorepos, and trying to understand where my linting settings should stay. Inside each library folder? in the root? Currently
pants lint ::
doesnt really pick it up automatically from the
pyproject.toml
inside the library folder and I have to link to a new config at root.
❤️ 1
h
Cool!
and trying to understand where my linting settings should stay. Inside each library folder? in the root?
Generally, a benefit of monorepos is that you can consolidate your config rather than having to copy around the same file multiple times. It can be useful to use the same style across every project But many tools have hierarchical config that lets you override things by putting config files in subdirectories. It depends on the tool
Currently pants lint :: doesnt really pick it up automatically from the pyproject.toml inside the library folder and I have to link to a new config at root.
Hm, were these config files being used before Pants? Pants "auto-discovers" your config files for linters and makes sure they are in the execution sandbox. But that logic depends on what the tool is: we mirror what how the underlying tool behaves It's plausible we got a tool's semantics wrong, so I'm wondering if it was working before
h
Everything was working before, and now I am trying to move an existing project/repo into the monorepo format to all for future development of multiple libraries. As of right now the repo (old code) is structured as: repo: | - library_name | - packages -> modules -> etc | - test | - pyproject.toml | - setup.py | - etc For pants I just moved
library_name
inside a structure of
libraries
->
library_name
->
library_name
,
pyproject.toml
With this I expected linting to just use the pyprojet.toml inside the library but it doesnt really. I still have default
BUILD
files and very few things inside the
pants.toml
. I will spend more time this week to explore and read all the docs.
h
Ah, that is almost certainly then an issue with the monorepo migration, not with Pants in particular. That tool probably expects pyproject.toml at the repo root, independent of Pants