liblaf-cherries 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl

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.
@@ -3,6 +3,7 @@ from ._config import BaseConfig
3
3
  from ._env import ENV_PREFIX, env
4
4
  from ._experiment import Experiment, current_experiment, set_current_experiment
5
5
  from ._main import main
6
+ from ._run import run
6
7
  from ._start import end, start
7
8
  from .git import entrypoint
8
9
  from .integration import Backend, BackendNeptune, backend_factory
@@ -28,6 +29,7 @@ __all__ = [
28
29
  "integration",
29
30
  "main",
30
31
  "plugin",
32
+ "run",
31
33
  "set_current_experiment",
32
34
  "start",
33
35
  "utils",
@@ -0,0 +1,26 @@
1
+ from collections.abc import Sequence
2
+ from typing import Protocol, get_type_hints
3
+
4
+ from liblaf import cherries
5
+
6
+
7
+ class MainFunction[T: cherries.BaseConfig](Protocol):
8
+ def __call__(self, cfg: T) -> None: ...
9
+
10
+
11
+ def run[T: cherries.BaseConfig](
12
+ main: MainFunction[T],
13
+ *,
14
+ backend: cherries.Backend | None = None,
15
+ enabled: bool | None = None,
16
+ plugins: Sequence[cherries.Plugin] | None = None,
17
+ ) -> None:
18
+ exp: cherries.Experiment = cherries.start(
19
+ backend=backend, enabled=enabled, plugins=plugins
20
+ )
21
+ type_hints: dict[str, type[T]] = get_type_hints(main)
22
+ cls: type[T] = next(iter(type_hints.values()))
23
+ cfg: T = cls()
24
+ exp.log_other("cherries/config", cfg)
25
+ main(cfg)
26
+ exp.end()
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.7'
21
- __version_tuple__ = version_tuple = (0, 0, 7)
20
+ __version__ = version = '0.0.9'
21
+ __version_tuple__ = version_tuple = (0, 0, 9)
@@ -6,7 +6,7 @@ from liblaf import cherries
6
6
 
7
7
  class PluginGit(cherries.Plugin):
8
8
  model_config = ps.SettingsConfigDict(env_prefix=cherries.ENV_PREFIX + "GIT_")
9
- auto_commit: bool = True
9
+ auto_commit: bool = False
10
10
  auto_commit_message: str = cherries.git.DEFAULT_COMMIT_MESSAGE
11
11
 
12
12
  def _pre_start(self) -> None:
@@ -1,11 +1,11 @@
1
+ from pathlib import Path
2
+
1
3
  import loguru
2
4
  import pydantic_settings as ps
3
5
  from loguru import logger
4
6
 
5
- # TODO: fix PLR0402
6
- # make pyright happy
7
- import liblaf.grapes as grapes # noqa: PLR0402
8
- from liblaf import cherries
7
+ import liblaf.cherries as cherries # noqa: PLR0402
8
+ from liblaf import grapes
9
9
 
10
10
  DEFAULT_FILTER: "loguru.FilterDict" = {
11
11
  "": "INFO",
@@ -20,17 +20,20 @@ DEFAULT_FILE_FILTER: "loguru.FilterDict" = {
20
20
 
21
21
  class PluginLogging(cherries.Plugin):
22
22
  model_config = ps.SettingsConfigDict(env_prefix=cherries.ENV_PREFIX + "LOGGING_")
23
+ file: Path | None = Path("run.log")
24
+ jsonl: Path | None = Path("run.log.jsonl")
23
25
 
24
26
  def _pre_start(self) -> None:
25
- grapes.init_logging(
26
- handlers=[
27
- grapes.logging.console_handler(),
28
- grapes.logging.file_handler(),
29
- grapes.logging.jsonl_handler(),
30
- ]
31
- )
27
+ handlers: list[loguru.HandlerConfig] = [grapes.logging.rich_handler()]
28
+ if self.file is not None:
29
+ handlers.append(grapes.logging.file_handler(self.file))
30
+ if self.jsonl is not None:
31
+ handlers.append(grapes.logging.jsonl_handler(self.jsonl))
32
+ grapes.init_logging(handlers=handlers)
32
33
 
33
34
  def _pre_end(self, run: cherries.Experiment) -> None:
34
35
  logger.complete()
35
- run.upload_file("cherries/logging/run.log", "run.log")
36
- run.upload_file("cherries/logging/run.log.jsonl", "run.log.jsonl")
36
+ if self.file is not None:
37
+ run.upload_file("cherries/logging/run.log", self.file)
38
+ if self.jsonl is not None:
39
+ run.upload_file("cherries/logging/run.log.jsonl", self.jsonl)
File without changes
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.4
2
+ Name: liblaf-cherries
3
+ Version: 0.0.9
4
+ Summary: Add your description here
5
+ Project-URL: Changelog, https://github.com/liblaf/cherries/blob/main/CHANGELOG.md
6
+ Project-URL: Documentation, https://liblaf.github.io/cherries/
7
+ Project-URL: Homepage, https://github.com/liblaf/cherries
8
+ Project-URL: Issue Tracker, https://github.com/liblaf/cherries/issues
9
+ Project-URL: Release Notes, https://github.com/liblaf/cherries/releases
10
+ Project-URL: Source Code, https://github.com/liblaf/cherries
11
+ Author-email: liblaf <30631553+liblaf@users.noreply.github.com>
12
+ License-Expression: MIT
13
+ License-File: LICENSE
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Software Development
25
+ Classifier: Topic :: Software Development :: Bug Tracking
26
+ Classifier: Topic :: Software Development :: Debuggers
27
+ Classifier: Topic :: Software Development :: Libraries
28
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
29
+ Classifier: Topic :: System
30
+ Classifier: Topic :: System :: Logging
31
+ Classifier: Topic :: Utilities
32
+ Classifier: Typing :: Typed
33
+ Requires-Python: >=3.12
34
+ Requires-Dist: environs<15,>=14.1.1
35
+ Requires-Dist: lazy-loader<0.5,>=0.4
36
+ Requires-Dist: liblaf-grapes<0.2,>=0.1.14
37
+ Requires-Dist: loguru<0.8,>=0.7.3
38
+ Requires-Dist: neptune<2,>=1.13.0
39
+ Requires-Dist: pydantic-settings<3,>=2.8.1
40
+ Requires-Dist: pydantic<3,>=2.11.1
41
+ Requires-Dist: rich<15,>=14.0.0
42
+ Description-Content-Type: text/markdown
43
+
44
+ {% include "../README.md" %}
@@ -1,12 +1,14 @@
1
1
  liblaf/cherries/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
2
- liblaf/cherries/__init__.pyi,sha256=u-eKDd-6imkzIue3LmuJJmpjLDV1yGfV0XP9aN0VdWQ,827
2
+ liblaf/cherries/__init__.pyi,sha256=84_e3bkixil-clAuX5MgUHQbDofP_Ylcu1Yeipn4Ycc,860
3
3
  liblaf/cherries/_config.py,sha256=rm-Y6roi8hBvQYdH-VQh_ovWCyVsX_7R0x1jokBPCDM,741
4
4
  liblaf/cherries/_env.py,sha256=RK9NMHIok-AkCLMqW44cXLl0d_daLjpEcjhreSP1vm0,92
5
5
  liblaf/cherries/_experiment.py,sha256=E6r5DyojfY75lKsIDxYpyaCgXFXMJTaUIglIk9Xs-Sw,3181
6
6
  liblaf/cherries/_main.py,sha256=R8vWc9e94MViqCzMiG257--QtSoOU50lmR59oIRc6nw,1237
7
+ liblaf/cherries/_run.py,sha256=zQrC2fzpbHtT6M3E9gGoYVPFsWeKYkMG5MEFwZ695vo,731
7
8
  liblaf/cherries/_start.py,sha256=iGAhDm8sF_JCaWPWdMIFL0d5nODFU8IcBPdNihhiSp4,685
8
- liblaf/cherries/_version.py,sha256=Fi0KXFzRbmtJaZ31ANCJStB858SeU6K67Widq0qwDIs,511
9
+ liblaf/cherries/_version.py,sha256=J0-psBAr052UgYPFe4_RoTpIwBL8wFdIM3d_qC8JwcE,511
9
10
  liblaf/cherries/_version.pyi,sha256=Pnv4Bxw13LHeuVkPLPsTtnp4N4jOGcAfFJw05uMMgBY,108
11
+ liblaf/cherries/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
12
  liblaf/cherries/git/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
11
13
  liblaf/cherries/git/__init__.pyi,sha256=kHd7B4_atL4929so2AnrBcCJNgGg-i-HEi4PeGh3csk,383
12
14
  liblaf/cherries/git/_commit.py,sha256=jnAtCKljNnzhXK90cj3adAYkPvcnLnOrHWA8YWhtZF4,482
@@ -25,12 +27,12 @@ liblaf/cherries/plugin/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXU
25
27
  liblaf/cherries/plugin/__init__.pyi,sha256=3wmkKoe27SI3q5zbyejf3KmaBRUhAu-OEefJAxxbECs,248
26
28
  liblaf/cherries/plugin/_abc.py,sha256=kMDFzDAEDifpxWbnQhp4M4sr24-D55x-B6MPIZW_1jA,848
27
29
  liblaf/cherries/plugin/_default.py,sha256=H7_vym_uxxba41xR2ERBeBt0kBX4s4tjzjifyKjXxS0,215
28
- liblaf/cherries/plugin/_git.py,sha256=Gyv8Uc2AnPpZul23oGm6Dba2YOaiFx6WAytrQ8ylSsk,866
29
- liblaf/cherries/plugin/_logging.py,sha256=yTp2IgwmTgWs6fkiFp6GyKz8IOTJZrHn_61VRZ_3eEY,1004
30
+ liblaf/cherries/plugin/_git.py,sha256=aZeqBdRRG8rHaSFoj1lGMEvtFk6dDKhV6nMahx5EOn8,867
31
+ liblaf/cherries/plugin/_logging.py,sha256=cLDQMongbRAwJjW5GAmRRzvuF2rK4GNTAHHkJCJh71k,1262
30
32
  liblaf/cherries/plugin/_restic.py,sha256=4ArmgD42ZUotkVdCwdMvlmJF0Z8PuKe8EukzRoWyQK8,1926
31
33
  liblaf/cherries/utils/__init__.py,sha256=OHb6Xou2v6u42swTgjRfzej4CIlRg4OmgOIQXUiRjKA,97
32
34
  liblaf/cherries/utils/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- liblaf_cherries-0.0.7.dist-info/METADATA,sha256=UCwu_3TAWiAxGhw6_iTLkwsmTO3pc6nsprVYJT9ogCc,5788
34
- liblaf_cherries-0.0.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- liblaf_cherries-0.0.7.dist-info/licenses/LICENSE,sha256=Ph4NzyU3lGVDeYv-mf8aRmImH8v9rVL9F362FV4G6Ow,1063
36
- liblaf_cherries-0.0.7.dist-info/RECORD,,
35
+ liblaf_cherries-0.0.9.dist-info/METADATA,sha256=4r3X50j5n2EBtM2AwEOOho5yNDXOhffqGdSGnw0P0Kk,1870
36
+ liblaf_cherries-0.0.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
+ liblaf_cherries-0.0.9.dist-info/licenses/LICENSE,sha256=Ph4NzyU3lGVDeYv-mf8aRmImH8v9rVL9F362FV4G6Ow,1063
38
+ liblaf_cherries-0.0.9.dist-info/RECORD,,
@@ -1,153 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: liblaf-cherries
3
- Version: 0.0.7
4
- Summary: Add your description here
5
- Project-URL: Changelog, https://github.com/liblaf/cherries/blob/main/CHANGELOG.md
6
- Project-URL: Homepage, https://github.com/liblaf/cherries
7
- Project-URL: Issue Tracker, https://github.com/liblaf/cherries/issues
8
- Project-URL: Release Notes, https://github.com/liblaf/cherries/releases
9
- Project-URL: Source Code, https://github.com/liblaf/cherries
10
- Author-email: liblaf <30631553+liblaf@users.noreply.github.com>
11
- License-Expression: MIT
12
- License-File: LICENSE
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Intended Audience :: Science/Research
16
- Classifier: License :: OSI Approved
17
- Classifier: License :: OSI Approved :: MIT License
18
- Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python
20
- Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Topic :: Software Development
24
- Classifier: Topic :: Software Development :: Bug Tracking
25
- Classifier: Topic :: Software Development :: Debuggers
26
- Classifier: Topic :: Software Development :: Libraries
27
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
- Classifier: Topic :: System
29
- Classifier: Topic :: System :: Logging
30
- Classifier: Topic :: Utilities
31
- Classifier: Typing :: Typed
32
- Requires-Python: >=3.12
33
- Requires-Dist: comet-ml<4,>=3.49.5
34
- Requires-Dist: gitpython<4,>=3.1.44
35
- Requires-Dist: giturlparse<0.13,>=0.12.0
36
- Requires-Dist: lazy-loader<0.5,>=0.4
37
- Requires-Dist: liblaf-grapes<0.2,>=0.1.9
38
- Requires-Dist: loguru<0.8,>=0.7.3
39
- Requires-Dist: neptune<2,>=1.13.0
40
- Requires-Dist: pydantic-settings<3,>=2.8.1
41
- Requires-Dist: pydantic<3,>=2.10.6
42
- Description-Content-Type: text/markdown
43
-
44
- <!-- -*- mode: markdown -*- -->
45
-
46
- <div align="center"><a name="readme-top"></a>
47
-
48
- <img height="160" src="https://api.iconify.design/logos/python.svg" />
49
-
50
- # Cherries
51
-
52
- TODO: DESCRIPTION
53
-
54
- [**Explore the docs »**](https://liblaf.github.io/cherries/)
55
-
56
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/liblaf-cherries?logo=PyPI&label=Downloads)](https://pypi.org/project/liblaf-cherries)
57
- [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/liblaf-cherries?logo=Python&label=Python)](https://pypi.org/project/liblaf-cherries)
58
- [![PyPI - Version](https://img.shields.io/pypi/v/liblaf-cherries?logo=PyPI&label=PyPI)](https://pypi.org/project/liblaf-cherries)
59
- [![Codecov](https://img.shields.io/codecov/c/github/liblaf/cherries?logo=Codecov&label=Coverage)](https://codecov.io/gh/liblaf/cherries)
60
- [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/liblaf/cherries/test.yaml?logo=GitHub%20Actions&label=Test)](https://github.com/liblaf/cherries/actions/workflows/test.yaml)
61
- <br />
62
- [![GitHub Contributors](https://img.shields.io/github/contributors/liblaf/cherries?logo=GitHub&label=Contributors)](https://github.com/liblaf/cherries/graphs/contributors)
63
- [![GitHub Forks](https://img.shields.io/github/forks/liblaf/cherries)](https://github.com/liblaf/cherries/forks)
64
- [![GitHub Repo Stars](https://img.shields.io/github/stars/liblaf/cherries)](https://github.com/liblaf/cherries/stargazers)
65
- [![GitHub Issues](https://img.shields.io/github/issues/liblaf/cherries?logo=GitHub&label=Issues)](https://github.com/liblaf/cherries/issues)
66
- [![GitHub License](https://img.shields.io/github/license/liblaf/cherries?label=License)](https://github.com/liblaf/cherries/blob/main/LICENSE)
67
-
68
- [Changelog](https://github.com/liblaf/cherries/blob/main/CHANGELOG.md) · [Report Bug](https://github.com/liblaf/cherries/issues) · [Request Feature](https://github.com/liblaf/cherries/issues)
69
-
70
- ![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
71
-
72
- </div>
73
-
74
- ## ✨ Features
75
-
76
- - [x] ✨ **TODO:** FEATURES;
77
-
78
- <div align="right">
79
-
80
- [![](https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square)](#readme-top)
81
-
82
- </div>
83
-
84
- ## 📦 Installation
85
-
86
- To install `liblaf-cherries`, run the following command:
87
-
88
- ```bash
89
- $ uv add liblaf-cherries
90
- ```
91
-
92
- <div align="right">
93
-
94
- [![](https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square)](#readme-top)
95
-
96
- </div>
97
-
98
- ## ⌨️ Local Development
99
-
100
- You can use Github Codespaces for online development:
101
-
102
- [![](https://github.com/codespaces/badge.svg)](https://codespaces.new/liblaf/cherries)
103
-
104
- Or clone it for local development:
105
-
106
- ```bash
107
- $ gh repo clone liblaf/cherries
108
- $ cd cherries
109
- $ just test
110
- ```
111
-
112
- <div align="right">
113
-
114
- [![](https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square)](#readme-top)
115
-
116
- </div>
117
-
118
- ## 🤝 Contributing
119
-
120
- Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub [Issues](https://github.com/liblaf/cherries/issues) to get stuck in to show us what you're made of.
121
-
122
- [![](https://img.shields.io/badge/%F0%9F%A4%AF%20PR%20WELCOME-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge)](https://github.com/liblaf/cherries/pulls)
123
-
124
- [![](https://contrib.rocks/image?repo=liblaf%2Fcherries)](https://github.com/liblaf/cherries/graphs/contributors)
125
-
126
- <div align="right">
127
-
128
- [![](https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square)](#readme-top)
129
-
130
- </div>
131
-
132
- ## 🔗 Links
133
-
134
- ### More Projects
135
-
136
- - **[🍇 cherries](https://github.com/liblaf/cherries)** - Powerful Python utilities for logging, timing, and more, making development smoother!
137
-
138
- ### Credits
139
-
140
- - **Python** - <https://www.python.org/>
141
-
142
- <div align="right">
143
-
144
- [![](https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square)](#readme-top)
145
-
146
- </div>
147
-
148
- ---
149
-
150
- #### 📝 License
151
-
152
- Copyright © 2025 [liblaf](https://github.com/liblaf). <br />
153
- This project is [MIT](https://github.com/liblaf/cherries/blob/main/LICENSE) licensed.