Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for cli_main (0.08 sec)

  1. fastapi/cli.py

    try:
        from fastapi_cli.cli import main as cli_main
    
    except ImportError:  # pragma: no cover
        cli_main = None  # type: ignore
    
    
    def main() -> None:
        if not cli_main:  # type: ignore[truthy-function]
            message = 'To use the fastapi command, please install "fastapi[standard]":\n\n\tpip install "fastapi[standard]"\n'
            print(message)
            raise RuntimeError(message)  # noqa: B904
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 02 06:03:05 UTC 2024
    - 418 bytes
    - Viewed (0)
  2. tests/test_fastapi_cli.py

        )
        assert result.returncode == 1, result.stdout
        assert "Using path non_existent_file.py" in result.stdout
    
    
    def test_fastapi_cli_not_installed():
        with patch.object(fastapi.cli, "cli_main", None):
            with pytest.raises(RuntimeError) as exc_info:
                fastapi.cli.main()
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 02 06:03:05 UTC 2024
    - 790 bytes
    - Viewed (0)
  3. pyproject.toml

        "uvicorn[standard] >=0.12.0",
        # Settings management
        "pydantic-settings >=2.0.0",
        # Extra Pydantic data types
        "pydantic-extra-types >=2.0.0",
    ]
    
    [project.scripts]
    fastapi = "fastapi.cli:main"
    
    [tool.pdm]
    version = { source = "file", path = "fastapi/__init__.py" }
    distribution = true
    
    [tool.pdm.build]
    source-includes = [
        "tests/",
        "docs_src/",
        "requirements*.txt",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 22 14:19:56 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/sql-databases.md

    //// tab | 🐍 3️⃣.6️⃣ & 🔛
    
    ```Python hl_lines="14-22"
    {!> ../../docs_src/sql_databases/sql_app/alt_main.py!}
    ```
    
    ////
    
    //// tab | 🐍 3️⃣.9️⃣ & 🔛
    
    ```Python hl_lines="12-20"
    {!> ../../docs_src/sql_databases/sql_app_py39/alt_main.py!}
    ```
    
    ////
    
    /// info
    
    👥 🚮 🏗 `SessionLocal()` & 🚚 📨 `try` 🍫.
    
     & ⤴️ 👥 🔐 ⚫️ `finally` 🍫.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 25K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/sql-databases.md

    //// tab | Python 3.9+
    
    ```Python hl_lines="12-20"
    {!> ../../docs_src/sql_databases/sql_app_py39/alt_main.py!}
    ```
    
    ////
    
    //// tab | Python 3.8+
    
    ```Python hl_lines="14-22"
    {!> ../../docs_src/sql_databases/sql_app/alt_main.py!}
    ```
    
    ////
    
    /// info
    
    我们将`SessionLocal()`请求的创建和处理放在一个`try`块中。
    
    然后我们在finally块中关闭它。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 27.1K bytes
    - Viewed (0)
Back to top