marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
8k stars 284 forks source link

[Poetry] Add ability for the `Manage Packages` feature to work when a `pyproject.toml` file is located in a parent directory #2923

Closed meliz19 closed 3 days ago

meliz19 commented 4 days ago

Documentation is

Explain in Detail

I love the Manage Packages feature, however, it only works when a marimo notebook is located in the same directory as a pyproject.toml file. It would be helpful to have a way to use the Manage Packages feature when a pyproject.toml file is located in a parent directory.

Your Suggestion for Changes

Add the ability for users to use the Manage Packages feature when a pyproject.toml file is located in a parent directory. If this capability already exists, then clear documentation for how to change the default setting would be very helpful.

akshayka commented 4 days ago

Thanks for the issue. What package manager are you using? What went wrong?

meliz19 commented 4 days ago

Thanks for the quick response! I'm using poetry as the package manager. I get the No packages are installed in this environment. message in the Manage Packages section when the pyproject.toml file is in the parent directory.

akshayka commented 4 days ago

Oh interesting. This seems like a bug with our Poetry backend. We can look into, thanks for reporting.

akshayka commented 3 days ago

Is marimo in your environment too? That is are you starting marimo with poetry run marimo ... ?

meliz19 commented 3 days ago

Is marimo in your environment too? That is are you starting marimo with poetry run marimo ... ?

Yes, marimo is in the environment and I'm opening the notebook environment via poetry run marimo ...

akshayka commented 3 days ago

Thanks. I'm looking into it. In my case when the package manager is set to Poetry, I can't see the dependencies in the environment even when running a notebook in the root directory of the Poetry project.

meliz19 commented 3 days ago

My bad, you're right. I'm sorry about that. That's what I get work working on different machines.

I was originally using uv as the dependency manager and the functionality works as expected: packages show up in the "Manage Packages" panel when the pyproject.toml is located in this same directory as the notebooks or in a parent directory. Packages can also be added to the project environment/pyproject.toml via the "Manage Packages" panel. However, when I switch to poetry, I am still able to add packages via the "Manage Packages" panel and it shows up in the terminal as being added and it's added to the pyproject.toml; however, none of the installed packages are listed in the "Manage Packages" panel.

akshayka commented 2 days ago

@meliz19 -- this issue should be fixed in version 0.9.22, which will be on PyPI within 20 or so minutes. Thanks again for reporting!

meliz19 commented 2 days ago

Awesome!! Thank y’all so much. I love what you’re doing with marimo. I really appreciate the quick turnaround.Best regards,Margaret BlackCell: 770 597 5083On Nov 22, 2024, at 18:37, Akshay Agrawal @.***> wrote: @meliz19 -- this issue should be fixed in version 0.9.22, which will be on PyPI within 20 or so minutes. Thanks again for reporting!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>