climate-ref-celery 0.5.5__tar.gz → 0.6.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.
Files changed (23) hide show
  1. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/PKG-INFO +2 -1
  2. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/pyproject.toml +2 -1
  3. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/app.py +5 -10
  4. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/.gitignore +0 -0
  5. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/LICENCE +0 -0
  6. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/NOTICE +0 -0
  7. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/README.md +0 -0
  8. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/__init__.py +0 -0
  9. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/celeryconf/__init__.py +0 -0
  10. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/celeryconf/base.py +0 -0
  11. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/celeryconf/dev.py +0 -0
  12. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/celeryconf/prod.py +0 -0
  13. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/cli.py +0 -0
  14. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/executor.py +0 -0
  15. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/py.typed +0 -0
  16. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/tasks.py +0 -0
  17. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/src/climate_ref_celery/worker_tasks.py +0 -0
  18. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/conftest.py +0 -0
  19. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/unit/test_app.py +0 -0
  20. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/unit/test_cli.py +0 -0
  21. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/unit/test_executor.py +0 -0
  22. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/unit/test_tasks.py +0 -0
  23. {climate_ref_celery-0.5.5 → climate_ref_celery-0.6.1}/tests/unit/test_worker_tasks.py +0 -0
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climate-ref-celery
3
- Version: 0.5.5
3
+ Version: 0.6.1
4
4
  Summary: Celery app for mananging tasks and workers
5
5
  Author-email: Jared Lewis <jared.lewis@climate-resource.com>
6
+ License-Expression: Apache-2.0
6
7
  License-File: LICENCE
7
8
  License-File: NOTICE
8
9
  Classifier: Development Status :: 3 - Alpha
@@ -1,11 +1,12 @@
1
1
  [project]
2
2
  name = "climate-ref-celery"
3
- version = "0.5.5"
3
+ version = "0.6.1"
4
4
  description = "Celery app for mananging tasks and workers"
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Jared Lewis", email = "jared.lewis@climate-resource.com" }
8
8
  ]
9
+ license = "Apache-2.0"
9
10
  requires-python = ">=3.11"
10
11
  classifiers = [
11
12
  "Development Status :: 3 - Alpha",
@@ -11,7 +11,7 @@ from loguru import logger
11
11
  from rich.pretty import pretty_repr
12
12
 
13
13
  from climate_ref.config import Config
14
- from climate_ref_core.logging import add_log_handler, capture_logging
14
+ from climate_ref_core.logging import initialise_logging
15
15
 
16
16
  os.environ.setdefault("CELERY_CONFIG_MODULE", "climate_ref_celery.celeryconf.dev")
17
17
 
@@ -33,16 +33,11 @@ def create_celery_app(name: str) -> Celery:
33
33
  @setup_logging.connect
34
34
  def setup_logging_handler(loglevel: int, **kwargs: Any) -> None: # pragma: no cover
35
35
  """Set up logging for the Celery worker using the celery signal"""
36
- capture_logging()
37
-
38
- # Include process name in celery logs
39
- msg_format = (
40
- "<green>{time:YYYY-MM-DD HH:mm:ss.SSS Z}</green> | <level>{level: <8}</level> | {process.name} | "
41
- "<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>"
42
- )
36
+ # We ignore the format passed by Celery instead using our own configuration
37
+ config = Config.default()
38
+ msg_format = config.log_format
43
39
 
44
- logger.remove()
45
- add_log_handler(level=loglevel, format=msg_format, colorize=True)
40
+ initialise_logging(level=loglevel, format=msg_format, log_directory=config.paths.log)
46
41
 
47
42
 
48
43
  @worker_ready.connect