How do I run poetry install in a subprocess without reference to the current virtualenv?

I am writing some auto setup code in a command line tool that we have. This command line tool is installed with poetry, so when someone is invoking the command line tool, it is from within a virtual environment setup by poetry. The command I am trying to invoke is poetry install for another directory.… Read More How do I run poetry install in a subprocess without reference to the current virtualenv?

Can I get Poetry to reinstall ipykernel after installing ipywidgets?

I’m developing a Python package. I used Poetry to set up my development environment; I intend to distribute my code through PyPI. One of my dependencies requires ipywidgets<7.7.2, as documented here. Due to a bug (mentioned here), ipykernel must be reinstalled after ipywidgets is installed. This SO answer says that developers can’t specify the order… Read More Can I get Poetry to reinstall ipykernel after installing ipywidgets?

Why can't I install a Python package with the Python requirement ">=3.8,<3.11" into a Poetry project with the Python version "^3.9"?

I’m having an issue installing dependencies into my Poetry project. If I run poetry new (as described in https://python-poetry.org/docs/basic-usage/), I can create a new project: $ poetry new scipy-test Created package scipy_test in scipy-test My project structure looks like this after I delete a few files not needed for this reproduction: $ tree . .… Read More Why can't I install a Python package with the Python requirement ">=3.8,<3.11" into a Poetry project with the Python version "^3.9"?

Python Poetry specify dependency on `sentry-sdk[flask]`

I’m trying to add support for Sentry to an existing Python Flask application that uses Python Poetry for dependency management. The Sentry docs say to run this: pip install –upgrade ‘sentry-sdk[flask] That works. But I want to convert that into a pyproject.toml dependency entry for Python Poetry. If I try just this: [tool.poetry.dependencies] # <snip>… Read More Python Poetry specify dependency on `sentry-sdk[flask]`