Fixed alembic errors in CI (maybe)
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -71,15 +71,21 @@ jobs:
|
||||
key: pip-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
pip-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Create .env for tests
|
||||
run: |
|
||||
printf "KEYWARDEN_POSTGRES_DSN=%s\nKEYWARDEN_SECRET_KEY=%s\nKEYWARDEN_ACCESS_TOKEN_EXPIRE_MINUTES=60\n" \
|
||||
"${{ env.TEST_POSTGRES_DSN }}" "testsecret" > .env
|
||||
echo "Wrote .env with DSN=${{ env.TEST_POSTGRES_DSN }}"
|
||||
|
||||
- name: Set PYTHONPATH
|
||||
run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run Alembic migrations
|
||||
env:
|
||||
KEYWARDEN_POSTGRES_DSN: ${{ env.TEST_POSTGRES_DSN }}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import asyncio
|
||||
import sys, pathlib
|
||||
|
||||
# Add project root (parent of the "alembic" dir) to sys.path
|
||||
PROJECT_ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
if str(PROJECT_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(PROJECT_ROOT))
|
||||
|
||||
from logging.config import fileConfig
|
||||
|
||||
from sqlalchemy import pool
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
|
||||
|
||||
from alembic import context
|
||||
|
||||
# Import your app's config & models
|
||||
|
@@ -0,0 +1,60 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=61.0", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "keywarden"
|
||||
version = "0.1.0"
|
||||
description = "A lightweight, self-hosted SSH key management and access auditing platform."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
{ name="George Wilkinson", email="admin@ntbx.io" }
|
||||
]
|
||||
dependencies = [
|
||||
"fastapi>=0.114",
|
||||
"uvicorn[standard]>=0.30",
|
||||
"SQLAlchemy[asyncio]>=2.0",
|
||||
"asyncpg>=0.29",
|
||||
"alembic>=1.13",
|
||||
"python-jose[cryptography]>=3.3",
|
||||
"passlib[argon2]>=1.7",
|
||||
"pydantic-settings>=2.4",
|
||||
"cryptography>=43",
|
||||
"structlog>=24",
|
||||
"prometheus-fastapi-instrumentator>=6.1"
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.3",
|
||||
"httpx>=0.27",
|
||||
"ruff>=0.6",
|
||||
"black>=24.8",
|
||||
"mypy>=1.11"
|
||||
]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
include = ["app*"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 88
|
||||
target-version = ["py311"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
target-version = "py311"
|
||||
select = ["E", "F", "I"]
|
||||
ignore = ["E501"] # handled by black
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
minversion = "8.0"
|
||||
addopts = "-q"
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.11"
|
||||
strict = true
|
||||
ignore_missing_imports = true
|
Reference in New Issue
Block a user