Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python venv and monorepo #224

Open
laurentS opened this issue Jun 9, 2022 · 1 comment
Open

Python venv and monorepo #224

laurentS opened this issue Jun 9, 2022 · 1 comment

Comments

@laurentS
Copy link

laurentS commented Jun 9, 2022

I use a monorepo for a project such as:

/myproject
/myproject/.git
/myproject/python_pkg/
/myproject/python_pkg/pyproject.toml
/myproject/node_pkg/
/myproject/node_pkg/package.json

I am trying to configure efm to format python files (under /myproject/python_pkg) using black with { formatCommand = "poetry run black --quiet -", formatStdin = true }. This works on "normal" repos where the pyproject.toml file is at the same level as .git, but if I start nvim under /myproject then I can't seem to find a way to make this work (because efm seems to execute poetry in /myproject where it cannot find its config. Running without poetry run misses the project-level config, so it's not a solution either.

I tried wrapping the formatCommand in a bit of lua that would detect the current filename and extract the path from it, but I'm too noob with lua to figure it out.

Is there a way to handle this situation?

Also, thanks for a very nice little plugin :)

@itaranto
Copy link
Contributor

itaranto commented Oct 15, 2022

I have the same problem at work, the problem seems to be that root_markers expect certain files to be there to trigger efm's actions.

What I did was an ugly hack where I have all my linters config file in the root, for example .flake8, .style.yapf, .isort.config, etc. and then I create a symbolic link to then in each subproject's directory.

It's not ideal, I know, and I don't even know if it works in Windows actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants