Add cache for GitHub actions (#13)
This commit is contained in:
parent
c4b1f2c669
commit
30f1bb17e1
15
.github/workflows/python-checks.yml
vendored
15
.github/workflows/python-checks.yml
vendored
@ -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
|
||||
|
@ -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",
|
||||
|
@ -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,
|
||||
)
|
||||
"""
|
||||
|
||||
|
@ -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]
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user