compair-core 0.3.2__tar.gz → 0.3.4__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 compair-core might be problematic. Click here for more details.

Files changed (41) hide show
  1. {compair_core-0.3.2/compair_core.egg-info → compair_core-0.3.4}/PKG-INFO +2 -2
  2. {compair_core-0.3.2 → compair_core-0.3.4}/README.md +1 -1
  3. {compair_core-0.3.2 → compair_core-0.3.4}/compair/__init__.py +6 -1
  4. {compair_core-0.3.2 → compair_core-0.3.4}/compair/tasks.py +11 -7
  5. {compair_core-0.3.2 → compair_core-0.3.4/compair_core.egg-info}/PKG-INFO +2 -2
  6. {compair_core-0.3.2 → compair_core-0.3.4}/pyproject.toml +1 -1
  7. {compair_core-0.3.2 → compair_core-0.3.4}/LICENSE +0 -0
  8. {compair_core-0.3.2 → compair_core-0.3.4}/compair/celery_app.py +0 -0
  9. {compair_core-0.3.2 → compair_core-0.3.4}/compair/default_groups.py +0 -0
  10. {compair_core-0.3.2 → compair_core-0.3.4}/compair/embeddings.py +0 -0
  11. {compair_core-0.3.2 → compair_core-0.3.4}/compair/feedback.py +0 -0
  12. {compair_core-0.3.2 → compair_core-0.3.4}/compair/logger.py +0 -0
  13. {compair_core-0.3.2 → compair_core-0.3.4}/compair/main.py +0 -0
  14. {compair_core-0.3.2 → compair_core-0.3.4}/compair/models.py +0 -0
  15. {compair_core-0.3.2 → compair_core-0.3.4}/compair/schema.py +0 -0
  16. {compair_core-0.3.2 → compair_core-0.3.4}/compair/utils.py +0 -0
  17. {compair_core-0.3.2 → compair_core-0.3.4}/compair_core.egg-info/SOURCES.txt +0 -0
  18. {compair_core-0.3.2 → compair_core-0.3.4}/compair_core.egg-info/dependency_links.txt +0 -0
  19. {compair_core-0.3.2 → compair_core-0.3.4}/compair_core.egg-info/requires.txt +0 -0
  20. {compair_core-0.3.2 → compair_core-0.3.4}/compair_core.egg-info/top_level.txt +0 -0
  21. {compair_core-0.3.2 → compair_core-0.3.4}/compair_email/__init__.py +0 -0
  22. {compair_core-0.3.2 → compair_core-0.3.4}/compair_email/email.py +0 -0
  23. {compair_core-0.3.2 → compair_core-0.3.4}/compair_email/email_core.py +0 -0
  24. {compair_core-0.3.2 → compair_core-0.3.4}/compair_email/templates.py +0 -0
  25. {compair_core-0.3.2 → compair_core-0.3.4}/compair_email/templates_core.py +0 -0
  26. {compair_core-0.3.2 → compair_core-0.3.4}/server/__init__.py +0 -0
  27. {compair_core-0.3.2 → compair_core-0.3.4}/server/app.py +0 -0
  28. {compair_core-0.3.2 → compair_core-0.3.4}/server/deps.py +0 -0
  29. {compair_core-0.3.2 → compair_core-0.3.4}/server/local_model/__init__.py +0 -0
  30. {compair_core-0.3.2 → compair_core-0.3.4}/server/local_model/app.py +0 -0
  31. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/__init__.py +0 -0
  32. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/console_mailer.py +0 -0
  33. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/contracts.py +0 -0
  34. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/local_storage.py +0 -0
  35. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/noop_analytics.py +0 -0
  36. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/noop_billing.py +0 -0
  37. {compair_core-0.3.2 → compair_core-0.3.4}/server/providers/noop_ocr.py +0 -0
  38. {compair_core-0.3.2 → compair_core-0.3.4}/server/routers/__init__.py +0 -0
  39. {compair_core-0.3.2 → compair_core-0.3.4}/server/routers/capabilities.py +0 -0
  40. {compair_core-0.3.2 → compair_core-0.3.4}/server/settings.py +0 -0
  41. {compair_core-0.3.2 → compair_core-0.3.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compair-core
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Open-source foundation of the Compair collaboration platform.
5
5
  Author: RocketResearch, Inc.
6
6
  License: MIT
@@ -85,7 +85,7 @@ Container definitions and build pipelines live outside this public package:
85
85
  Key environment variables for the core edition:
86
86
 
87
87
  - `COMPAIR_EDITION` (`core`) – corresponds to this core local implementation.
88
- - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path.
88
+ - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path (falls back to `./compair_data` if `/data` is not writable).
89
89
  - `COMPAIR_LOCAL_MODEL_URL` – endpoint for your local embeddings/feedback service (defaults to `http://local-model:9000`).
90
90
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
91
91
 
@@ -51,7 +51,7 @@ Container definitions and build pipelines live outside this public package:
51
51
  Key environment variables for the core edition:
52
52
 
53
53
  - `COMPAIR_EDITION` (`core`) – corresponds to this core local implementation.
54
- - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path.
54
+ - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path (falls back to `./compair_data` if `/data` is not writable).
55
55
  - `COMPAIR_LOCAL_MODEL_URL` – endpoint for your local embeddings/feedback service (defaults to `http://local-model:9000`).
56
56
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
57
57
 
@@ -61,7 +61,12 @@ def _handle_engine() -> Engine:
61
61
  )
62
62
 
63
63
  sqlite_dir = os.getenv("COMPAIR_SQLITE_DIR", "/data")
64
- os.makedirs(sqlite_dir, exist_ok=True)
64
+ try:
65
+ os.makedirs(sqlite_dir, exist_ok=True)
66
+ except OSError:
67
+ fallback_dir = os.path.join(os.getcwd(), "compair_data")
68
+ os.makedirs(fallback_dir, exist_ok=True)
69
+ sqlite_dir = fallback_dir
65
70
  sqlite_path = os.path.join(sqlite_dir, os.getenv("COMPAIR_SQLITE_NAME", "compair.db"))
66
71
  return create_engine(f"sqlite:///{sqlite_path}", connect_args={"check_same_thread": False})
67
72
 
@@ -18,12 +18,15 @@ try:
18
18
  except (ImportError, ModuleNotFoundError):
19
19
  from sqlalchemy.orm import joinedload
20
20
 
21
- from . import Session
22
- from .embeddings import Embedder
23
- from .feedback import Reviewer
24
- from .logger import log_event
25
- from .main import process_document
26
- from .models import Document, User
21
+ def _lazy_components():
22
+ from . import Session as SessionMaker
23
+ from .embeddings import Embedder
24
+ from .feedback import Reviewer
25
+ from .logger import log_event
26
+ from .main import process_document
27
+ from .models import Document, User
28
+
29
+ return SessionMaker, Embedder, Reviewer, log_event, process_document, Document, User
27
30
 
28
31
  logger = logging.getLogger(__name__)
29
32
 
@@ -33,7 +36,8 @@ except (ImportError, ModuleNotFoundError):
33
36
  doc_text: str,
34
37
  generate_feedback: bool = True,
35
38
  ) -> Mapping[str, list[str]]:
36
- with Session() as session:
39
+ SessionMaker, Embedder, Reviewer, log_event, process_document, Document, User = _lazy_components()
40
+ with SessionMaker() as session:
37
41
  user = session.query(User).filter(User.user_id == user_id).first()
38
42
  if not user:
39
43
  logger.warning("User not found for document processing", extra={"user_id": user_id})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compair-core
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Open-source foundation of the Compair collaboration platform.
5
5
  Author: RocketResearch, Inc.
6
6
  License: MIT
@@ -85,7 +85,7 @@ Container definitions and build pipelines live outside this public package:
85
85
  Key environment variables for the core edition:
86
86
 
87
87
  - `COMPAIR_EDITION` (`core`) – corresponds to this core local implementation.
88
- - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path.
88
+ - `COMPAIR_SQLITE_DIR` / `COMPAIR_SQLITE_NAME` – override the default local SQLite path (falls back to `./compair_data` if `/data` is not writable).
89
89
  - `COMPAIR_LOCAL_MODEL_URL` – endpoint for your local embeddings/feedback service (defaults to `http://local-model:9000`).
90
90
  - `COMPAIR_EMAIL_BACKEND` – the core mailer logs emails to stdout; cloud overrides this with transactional delivery.
91
91
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "compair-core"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "Open-source foundation of the Compair collaboration platform."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
File without changes
File without changes
File without changes