Skip to content

Commit 1aed72c

Browse files
committed
cocalc-api: introduce a cleanup logic, of tracked accounts, orgs and projects. (managing an ephemeral database via the API is a bit tricky)
1 parent 7390989 commit 1aed72c

File tree

5 files changed

+937
-305
lines changed

5 files changed

+937
-305
lines changed

.github/workflows/make-and-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ jobs:
106106
pip install ipykernel
107107
python -m ipykernel install --prefix=./jupyter-local --name python3-local --display-name "Python 3 (Local)"
108108
109-
110109
- name: install pnpm
111110
uses: pnpm/action-setup@v4
112111
with:
@@ -204,6 +203,10 @@ jobs:
204203
export COCALC_API_KEY=$(cat src/api_key.txt)
205204
export COCALC_HOST=http://localhost:5000
206205
cd src/python/cocalc-api && make ci
206+
env:
207+
PGDATABASE: smc
208+
PGUSER: smc
209+
PGHOST: localhost
207210

208211
- name: Stop CoCalc Hub
209212
if: always()
@@ -213,7 +216,7 @@ jobs:
213216
echo "Stopping hub with PID $HUB_PID"
214217
kill $HUB_PID || true
215218
# Wait a bit for graceful shutdown
216-
sleep 2
219+
sleep 5
217220
# Force kill if still running
218221
kill -9 $HUB_PID 2>/dev/null || true
219222
fi

src/python/cocalc-api/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
name = "cocalc-api"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
description = "Python client for the CoCalc API"
5-
authors = [{ name="William Stein", email="[email protected]" }]
5+
authors = [{ name="William Stein", email="[email protected]" }, {name="Harald Schilly", email="[email protected]"}]
66
readme = "README.md"
77
requires-python = ">=3.9"
88
dependencies = ["httpx"]
@@ -76,9 +76,11 @@ dev = [
7676
"mkdocs-material",
7777
"mkdocstrings[python]",
7878
"mypy",
79+
"psycopg2-binary",
7980
"pyright",
80-
"pytest>=8.4.1",
8181
"pytest-cov",
82-
"ruff>=0.12.11",
82+
"pytest>=8.4.2",
83+
"ruff>=0.13.2",
84+
"types-psycopg2",
8385
"yapf",
8486
]

0 commit comments

Comments
 (0)