Skip to content

Issue with the "Run a FastAPI app" doc: poetry shell is no longer available #2008

@noamraph

Description

@noamraph

I found an issue with this document.

Title: Run a FastAPI app
Location: https://fly.io/docs/python/frameworks/fastapi/
Source: https://github.com/superfly/docs/blob/main/python/frameworks/fastapi.html.markerb

Describe the issue

I install poetry using pipx install poetry. The page instructs to use poetry shell. However, when I run poetry shell, I get:

Looks like you're trying to use a Poetry command that is not available.

Since Poetry (2.0.0), the shell command is not installed by default. You can use,

  - the new env activate command (recommended); or
  - the shell plugin to install the shell command

Documentation: https://python-poetry.org/docs/managing-environments/#activating-the-environment

Note that the env activate command is not a direct replacement for shell command.

Addtional info

I followed https://github.com/python-poetry/poetry-plugin-shell to install the poetry shell plugin. But now, when running fly launch (In https://fly.io/docs/python/frameworks/fastapi/#deploy-a-fastapi-app-from-scratch), I get:

❯ fly launch
Scanning source code
INFO Detected Poetry project
Error: No dependencies found in pyproject.toml

Even though the pyproject.toml file contains the fastapi dependency:

❯ cat pyproject.toml
[project]
name = "fastapi-app"
version = "0.1.0"
description = ""
authors = [
    {name = "Noam Raphael",email = "noamraph@gmail.com"}
]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "fastapi[standard] (>=0.115.12,<0.116.0)"
]

[tool.poetry]
packages = [{include = "fastapi_app", from = "src"}]


[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions