interloper-api 0.48.0__tar.gz → 0.49.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of interloper-api might be problematic. Click here for more details.

Files changed (21) hide show
  1. {interloper_api-0.48.0 → interloper_api-0.49.1}/PKG-INFO +1 -1
  2. interloper_api-0.49.1/pyproject.toml +59 -0
  3. interloper_api-0.48.0/pyproject.toml → interloper_api-0.49.1/pyproject.toml.orig +1 -1
  4. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/catalog.py +2 -2
  5. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/components.py +10 -2
  6. {interloper_api-0.48.0 → interloper_api-0.49.1}/README.md +0 -0
  7. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/__init__.py +0 -0
  8. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/app.py +0 -0
  9. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/components.py +0 -0
  10. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/dependencies.py +0 -0
  11. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/email.py +0 -0
  12. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/__init__.py +0 -0
  13. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/admin.py +0 -0
  14. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/agent.py +0 -0
  15. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/auth.py +0 -0
  16. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/backfills.py +0 -0
  17. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/oauth.py +0 -0
  18. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/organisations.py +0 -0
  19. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/runs.py +0 -0
  20. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/tokens.py +0 -0
  21. {interloper_api-0.48.0 → interloper_api-0.49.1}/src/interloper_api/routes/ws.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: interloper-api
3
- Version: 0.48.0
3
+ Version: 0.49.1
4
4
  Summary: Interloper FastAPI routes
5
5
  Author: Guillaume Onfroy
6
6
  Author-email: Guillaume Onfroy <guillaume@digitlcloud.com>
@@ -0,0 +1,59 @@
1
+ [project]
2
+ name = "interloper-api"
3
+ version = "0.49.1"
4
+ description = "Interloper FastAPI routes"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "interloper-core",
9
+ "interloper-db",
10
+ "fastapi>=0.115.0",
11
+ "google-auth>=2.0.0",
12
+ "httpx>=0.28.0",
13
+ "psycopg2-binary>=2.9.0",
14
+ "uvicorn[standard]>=0.41.0",
15
+ "wsproto>=1.2.0",
16
+ ]
17
+
18
+ [[project.authors]]
19
+ name = "Guillaume Onfroy"
20
+ email = "guillaume@digitlcloud.com"
21
+
22
+ [project.optional-dependencies]
23
+ agent = ["interloper-agent"]
24
+
25
+ [build-system]
26
+ requires = ["uv_build>=0.11.5,<0.12"]
27
+ build-backend = "uv_build"
28
+
29
+ [tool.uv.sources.interloper-core]
30
+ workspace = true
31
+
32
+ [tool.uv.sources.interloper-db]
33
+ workspace = true
34
+
35
+ [tool.uv.sources.interloper-agent]
36
+ workspace = true
37
+
38
+ [tool.ruff]
39
+ line-length = 120
40
+
41
+ [tool.ruff.lint]
42
+ extend-select = [
43
+ "E",
44
+ "I",
45
+ "UP",
46
+ "ANN001",
47
+ "ANN201",
48
+ "ANN202",
49
+ ]
50
+
51
+ [tool.ruff.lint.per-file-ignores]
52
+ "__init__.py" = [
53
+ "F401",
54
+ "F403",
55
+ ]
56
+ "tests/**" = [
57
+ "ANN",
58
+ "F811",
59
+ ]
@@ -3,7 +3,7 @@
3
3
  # ###############
4
4
  [project]
5
5
  name = "interloper-api"
6
- version = "0.48.0"
6
+ version = "0.49.1"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -7,9 +7,9 @@ from typing import Any
7
7
  from fastapi import APIRouter, Depends, HTTPException
8
8
  from interloper.catalog.base import Catalog
9
9
 
10
- from interloper_api.dependencies import get_catalog
10
+ from interloper_api.dependencies import get_catalog, require_viewer
11
11
 
12
- router = APIRouter(prefix="/catalog", tags=["catalog"])
12
+ router = APIRouter(prefix="/catalog", tags=["catalog"], dependencies=[Depends(require_viewer)])
13
13
 
14
14
 
15
15
  @router.get("/")
@@ -299,6 +299,8 @@ def update_component(
299
299
  raise HTTPException(status_code=400, detail=str(e))
300
300
  except NotFoundError as e:
301
301
  raise HTTPException(status_code=404, detail=str(e))
302
+ except InUseError as e:
303
+ raise HTTPException(status_code=409, detail={"message": str(e), "used_by": e.referrers})
302
304
  return _to_response(row, store, include_config=True)
303
305
 
304
306
 
@@ -353,9 +355,15 @@ def remove_relation(
353
355
  user: Profile = Depends(get_current_user),
354
356
  store: Store = Depends(get_store),
355
357
  ) -> None:
356
- """Remove a component's relations of one type toward one destination."""
358
+ """Remove a component's relations of one type toward one destination.
359
+
360
+ Refused (400) for required dependency slots — repoint them instead.
361
+ """
357
362
  load_authorized(store.get_component, component_id, user, store, label="Component", minimum="editor")
358
- store.remove_relation(component_id, type=type, dst_id=dst_id)
363
+ try:
364
+ store.remove_relation(component_id, type=type, dst_id=dst_id)
365
+ except ConfigError as e:
366
+ raise HTTPException(status_code=400, detail=str(e))
359
367
 
360
368
 
361
369
  # -- Partition endpoint ---------------------------------------------------------