diff --git a/.github/workflows/python-checks.yml b/.github/workflows/python-checks.yml index 4915cfba5..86b6576b2 100644 --- a/.github/workflows/python-checks.yml +++ b/.github/workflows/python-checks.yml @@ -25,15 +25,30 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: cache poetry install + uses: actions/cache@v2 + with: + path: ~/.local + key: poetry-1.1.14-0 + - uses: snok/install-poetry@v1 with: version: 1.1.14 virtualenvs-create: true virtualenvs-in-project: true + - name: cache deps + id: cache-deps + uses: actions/cache@v2 + with: + path: .venv + key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }} + - run: poetry install --no-interaction --no-root + if: steps.cache-deps.outputs.cache-hit != 'true' - run: poetry install --no-interaction - run: poetry run pytest tests - run: poetry run pyright pynecone tests - run: poetry run pydocstyle pynecone tests - run: poetry run darglint pynecone tests + - run: poetry run black --check pynecone tests diff --git a/pynecone/.templates/web/package.json b/pynecone/.templates/web/package.json index 7e23c9d32..f6424a9da 100644 --- a/pynecone/.templates/web/package.json +++ b/pynecone/.templates/web/package.json @@ -19,8 +19,6 @@ "plotly.js": "2.6.4", "prettier": "^2.7.1", "react": "^17.0.2", - "react-confetti": "^6.1.0", - "react-copy-to-clipboard": "^5.1.0", "react-dom": "^17.0.2", "react-markdown": "^8.0.3", "react-plotly.js": "^2.6.0", diff --git a/pynecone/compiler/templates.py b/pynecone/compiler/templates.py index d785ca4aa..050234e3c 100644 --- a/pynecone/compiler/templates.py +++ b/pynecone/compiler/templates.py @@ -11,6 +11,9 @@ PCCONFIG = f"""import pynecone as pc config = pc.Config( app_name="{{app_name}}", + bun_path="{constants.BUN_PATH}", + db_url="{constants.DB_URL}", + env=pc.Env.DEV, ) """ diff --git a/pynecone/components/media/avatar.py b/pynecone/components/media/avatar.py index 725ba85fb..6fc1a8833 100644 --- a/pynecone/components/media/avatar.py +++ b/pynecone/components/media/avatar.py @@ -11,9 +11,6 @@ class Avatar(ChakraComponent): tag = "Avatar" - # Function to get the initials to display. - get_initials: Var[str] - # The default avatar used as fallback when name, and src is not specified. icon: Var[str] @@ -23,9 +20,6 @@ class Avatar(ChakraComponent): # If true, opt out of the avatar's fallback logic and renders the img at all times. ignore_fallback: Var[bool] - # Defines loading strategy ("eager" | "lazy"). - loading: Var[str] - # The name of the person in the avatar. name: Var[str] diff --git a/pynecone/config.py b/pynecone/config.py index 922d6bc15..a6f45e54c 100644 --- a/pynecone/config.py +++ b/pynecone/config.py @@ -16,10 +16,10 @@ class Config(Base): username: Optional[str] = None # The backend API url. - api_url: str = "http://localhost:8000" + api_url: str = constants.API_URL # The database url. - db_url: str = f"sqlite:///{constants.DB_NAME}" + db_url: str = constants.DB_URL # The redis url. redis_url: Optional[str] = None @@ -31,4 +31,4 @@ class Config(Base): env: constants.Env = constants.Env.DEV # The path to the bun executable. - bun_path: str = "$HOME/.bun/bin/bun" + bun_path: str = constants.BUN_PATH diff --git a/pynecone/constants.py b/pynecone/constants.py index 4c3d04211..c74a28484 100644 --- a/pynecone/constants.py +++ b/pynecone/constants.py @@ -48,6 +48,10 @@ NODE_MODULES = "node_modules" PACKAGE_LOCK = "package-lock.json" # Commands to run the app. +# The backend api url. +API_URL = "http://localhost:8000" +# The default path where bun is installed. +BUN_PATH = "$HOME/.bun/bin/bun" # Command to install bun. INSTALL_BUN = "curl https://bun.sh/install | bash" # Command to run the backend in dev mode. @@ -94,6 +98,8 @@ FRONTEND_ZIP = "frontend.zip" BACKEND_ZIP = "backend.zip" # The name of the sqlite database. DB_NAME = "pynecone.db" +# The sqlite url. +DB_URL = f"sqlite:///{DB_NAME}" # The default title to show for Pynecone apps. DEFAULT_TITLE = "Pynecone App" # The name of the pynecone config module. diff --git a/pyproject.toml b/pyproject.toml index ee59f1f4a..f49072afa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ sqlmodel = "^0.0.6" typer = "^0.4.1" uvicorn = "^0.17.6" rich = "^12.6.0" +redis = "^4.3.5" [tool.poetry.dev-dependencies] pytest = "^7.1.2" @@ -31,6 +32,7 @@ toml = "^0.10.2" isort = "^5.10.1" pylint = "^2.14.5" pytest-asyncio = "^0.20.1" +black = "^22.10.0" [tool.poetry.scripts] pc = "pynecone.pc:main"