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

Explicitly specify project root for poetry #10

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

joshbode
Copy link

Projects with nested pyproject.toml may pick up the incorrect file relative to the .mise(.local)?.toml if the working directory is deeper than a nested file.

This can lead to a (shared) virtual-environment at the top-level not being activated.

project/         <-- VIRTUAL_ENV/POETRY_ACTIVE set as expected
  .mise.toml
  .venv/         <-- shared by sub-projects
  pyproject.toml
  sub-project/   <-- VIRTUAL_ENV/POETRY_ACTIVE not set
    pyproject.toml

This change infers the poetry project directory from the pyproject.toml file. If virtual-environments are desired for the sub-projects, then a .mise.toml can be created in those directories.

Projects with nested `pyproject.toml` may pick up the incorrect file
relative to the `.mise(.local)?.toml` if the working directory is deeper
than a nested file.

This can lead to a (shared) virtual-environment at the top-level not
being activated.

```
project/         <-- VIRTUAL_ENV/POETRY_ACTIVE set as expected
  .mise.toml
  .venv/         <-- shared by sub-projects
  pyproject.toml
  sub-project/   <-- VIRTUAL_ENV/POETRY_ACTIVE not set
    pyproject.toml
```

This change infers the poetry project directory from the
`pyproject.toml` file. If virtual-environments are desired for the
sub-projects, then a `.mise.toml` can be created in those directories.
@jdx jdx merged commit 95e67f5 into mise-plugins:main Mar 30, 2024
4 checks passed
@joshbode joshbode deleted the pyproject-root branch March 30, 2024 01:58
@joshbode
Copy link
Author

Thank you, @jdx !

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

Successfully merging this pull request may close these issues.

2 participants