From bef2dc88097b9b661b5123dc18ba09bb7b677700 Mon Sep 17 00:00:00 2001 From: Maxime de Pachtere Date: Thu, 15 Feb 2024 14:50:28 +0100 Subject: [PATCH] fix documentation for instalation --- README.md | 4 ++-- blitz/cli/app.py | 4 ++-- blitz/ui/blitz_ui.py | 19 +++++++++++-------- docs/cli/create.md | 2 +- docs/cli/index.md | 4 ++-- docs/installation.md | 4 ++-- requirements.txt | 29 ----------------------------- 7 files changed, 20 insertions(+), 46 deletions(-) delete mode 100644 requirements.txt diff --git a/README.md b/README.md index ec48c37..cf5da40 100644 --- a/README.md +++ b/README.md @@ -42,12 +42,12 @@ Here is an example of how simple a Blitz file is: ### Using [pipx](https://pipx.pypa.io/stable/installation/) (recommanded) ```bash -pipx install git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pipx install git+ssh://git@github.com/Paperz-org/blitz.git ``` ### Using pip ```bash -pip install --user git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pip install --user git+ssh://git@github.com/Paperz-org/blitz.git ``` ## Create a blitz app diff --git a/blitz/cli/app.py b/blitz/cli/app.py index 88e66fd..f37bc63 100644 --- a/blitz/cli/app.py +++ b/blitz/cli/app.py @@ -1,5 +1,5 @@ # from .commands.swagger import list_routes -from blitz.cli.commands.swagger import list_routes +from .commands.swagger import list_routes from .commands.start import start_blitz from .commands.clean import clean_blitz from .commands.list import list_blitz_app @@ -16,4 +16,4 @@ app.command(name="release")(release_blitz) app.command(name="swagger")(list_routes) # dev only -# app.command(name="clean")(clean_blitz) +# app.command(name="clean")(clean_blitz) \ No newline at end of file diff --git a/blitz/ui/blitz_ui.py b/blitz/ui/blitz_ui.py index 75bf0e0..e96ff04 100644 --- a/blitz/ui/blitz_ui.py +++ b/blitz/ui/blitz_ui.py @@ -1,4 +1,6 @@ from functools import lru_cache +from pathlib import Path +from typing import Any from blitz.app import BlitzApp from blitz.core import BlitzCore from blitz.settings import Settings, get_settings @@ -23,15 +25,15 @@ def __init__(self, settings: Settings = get_settings()) -> None: self._current_app = None @property - def current_project(self): + def current_project(self) -> str | None: return self._current_project @property - def current_app(self): + def current_app(self) -> BlitzApp | None: return self._current_app @current_app.setter - def current_app(self, app: BlitzApp): + def current_app(self, app: BlitzApp) -> None: if not self.current_app: self._current_app = app self._current_project = app.name @@ -43,7 +45,7 @@ def current_app(self, app: BlitzApp): # self._current_project = project # self._current_app = self.get_current_app() - def get_ressources(self): + def get_ressources(self) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]: columns = [ { "name": "name", @@ -71,18 +73,19 @@ def get_ressources(self): return columns, rows - def get_current_app(self): + def get_current_app(self) -> BlitzApp | None: if self.current_project: return self.blitz_app.get_app(self.current_project) + return None def add(self, blitz_app: BlitzCore) -> None: self.blitz_app = blitz_app - def _get_preprompt(self): - with open("blitz/ui/preprompt.txt", "r") as f: + def _get_preprompt(self) -> str: + with open(Path(__file__).parent / "./preprompt.txt", "r") as f: return f.read() - def reset_preprompt(self): + def reset_preprompt(self) -> None: self.preprompt = self._get_preprompt() print(self.preprompt) diff --git a/docs/cli/create.md b/docs/cli/create.md index a663341..9038a7a 100644 --- a/docs/cli/create.md +++ b/docs/cli/create.md @@ -16,7 +16,7 @@ Choose the format of the blitz file [json/yaml] (yaml): your-blitz-app created successfully ! To start your app, you can use: - blitz start tutu + blitz start your-blitz-app ``` diff --git a/docs/cli/index.md b/docs/cli/index.md index 22690b6..628d574 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -2,10 +2,10 @@ ## Using [pipx](https://pipx.pypa.io/stable/installation/) (recommanded) ```bash -pipx install git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pipx install git+ssh://git@github.com/Paperz-org/blitz.git ``` ## Using pip ```bash -pip install --user git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pip install --user git+ssh://git@github.com/Paperz-org/blitz.git ``` \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 08a3d3d..af6b526 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,10 +2,10 @@ ## Using [pipx](https://pipx.pypa.io/stable/installation/) (recommanded) ```bash -pipx install git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pipx install git+ssh://git@github.com/Paperz-org/blitz.git ``` ## Using pip ```bash -pip install --user git+ssh://git@github.com/Paperz-org/blitz.git@feature/add-doc +pip install --user git+ssh://git@github.com/Paperz-org/blitz.git ``` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d39bdb6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,29 +0,0 @@ -annotated-types==0.6.0 -anyio==3.7.1 -asttokens==2.4.1 -click==8.1.7 -decorator==5.1.1 -executing==2.0.1 -fastapi==0.106.0 -fastapi-crudrouter==0.8.6 -h11==0.14.0 -idna==3.6 -ipython==8.19.0 -jedi==0.19.1 -matplotlib-inline==0.1.6 -parso==0.8.3 -pexpect==4.9.0 -prompt-toolkit==3.0.43 -ptyprocess==0.7.0 -pure-eval==0.2.2 -pydantic==2.5.3 -pydantic_core==2.14.6 -Pygments==2.17.2 -six==1.16.0 -sniffio==1.3.0 -stack-data==0.6.3 -starlette==0.27.0 -traitlets==5.14.0 -typing_extensions==4.9.0 -uvicorn==0.25.0 -wcwidth==0.2.12