logger-36 2024.6__tar.gz → 2024.8__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.
- {logger-36-2024.6 → logger-36-2024.8}/MANIFEST.in +1 -0
- {logger-36-2024.6 → logger-36-2024.8}/PKG-INFO +36 -16
- {logger-36-2024.6 → logger-36-2024.8}/README-COPYRIGHT-utf8.txt +3 -3
- {logger-36-2024.6 → logger-36-2024.8}/README.rst +35 -15
- {logger-36-2024.6 → logger-36-2024.8}/documentation/wiki/description.asciidoc +17 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/__init__.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/config/console_rich.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/handler/console.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/handler/console_rich.py +1 -2
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/handler/file.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/handler/generic.py +10 -7
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/logging/chronos.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/logging/gpu.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/logging/memory.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/catalog/logging/system.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/config/issue.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/config/memory.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/config/message.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/config/system.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/generic.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/handler.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/issue.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/logger.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/memory.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/message.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/record.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/constant/system.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/instance.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/main.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/format/memory.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/format/message.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/format/rule.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/inspection.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/measure/chronos.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/measure/memory.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/task/storage.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/type/extension.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/type/issue.py +1 -1
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/type/logger.py +3 -2
- {logger-36-2024.6 → logger-36-2024.8}/logger_36/version.py +2 -2
- {logger-36-2024.6 → logger-36-2024.8}/logger_36.egg-info/PKG-INFO +36 -16
- {logger-36-2024.6 → logger-36-2024.8}/pyproject.toml +0 -1
- {logger-36-2024.6 → logger-36-2024.8}/setup.py +60 -53
- {logger-36-2024.6 → logger-36-2024.8}/README-LICENCE-utf8.txt +0 -0
- {logger-36-2024.6 → logger-36-2024.8}/logger_36.egg-info/SOURCES.txt +0 -0
- {logger-36-2024.6 → logger-36-2024.8}/logger_36.egg-info/dependency_links.txt +0 -0
- {logger-36-2024.6 → logger-36-2024.8}/logger_36.egg-info/top_level.txt +0 -0
- {logger-36-2024.6 → logger-36-2024.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: logger-36
|
3
|
-
Version: 2024.
|
3
|
+
Version: 2024.8
|
4
4
|
Summary: Simple logger with a catalog of handlers
|
5
5
|
Home-page: https://src.koda.cnrs.fr/eric.debreuve/logger-36/
|
6
6
|
Author: Eric Debreuve
|
@@ -18,7 +18,7 @@ Requires-Python: >=3.10
|
|
18
18
|
Description-Content-Type: text/x-rst
|
19
19
|
|
20
20
|
..
|
21
|
-
Copyright CNRS/Inria/
|
21
|
+
Copyright CNRS/Inria/UniCA
|
22
22
|
Contributor(s): Eric Debreuve (since 2023)
|
23
23
|
|
24
24
|
eric.debreuve@cnrs.fr
|
@@ -50,7 +50,7 @@ Description-Content-Type: text/x-rst
|
|
50
50
|
knowledge of the CeCILL license and that you accept its terms.
|
51
51
|
|
52
52
|
.. |PROJECT_NAME| replace:: logger-36
|
53
|
-
.. |SHORT_DESCRIPTION| replace:: Simple logger
|
53
|
+
.. |SHORT_DESCRIPTION| replace:: Simple logger with a catalog of handlers
|
54
54
|
|
55
55
|
.. |PYPI_NAME_LITERAL| replace:: ``logger-36``
|
56
56
|
.. |PYPI_PROJECT_URL| replace:: https://pypi.org/project/logger-36/
|
@@ -59,6 +59,9 @@ Description-Content-Type: text/x-rst
|
|
59
59
|
.. |DOCUMENTATION_URL| replace:: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
60
60
|
.. _DOCUMENTATION_URL: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
61
61
|
|
62
|
+
.. |DEPENDENCIES_MANDATORY| replace:: platformdirs
|
63
|
+
.. |DEPENDENCIES_OPTIONAL| replace:: psutil, rich
|
64
|
+
|
62
65
|
|
63
66
|
|
64
67
|
===================================
|
@@ -67,6 +70,13 @@ Description-Content-Type: text/x-rst
|
|
67
70
|
|
68
71
|
|
69
72
|
|
73
|
+
Documentation
|
74
|
+
=============
|
75
|
+
|
76
|
+
The documentation is available at |DOCUMENTATION_URL|_.
|
77
|
+
|
78
|
+
|
79
|
+
|
70
80
|
Installation
|
71
81
|
============
|
72
82
|
|
@@ -74,31 +84,41 @@ This project is published
|
|
74
84
|
on the `Python Package Index (PyPI) <https://pypi.org/>`_
|
75
85
|
at: |PYPI_PROJECT_URL|_.
|
76
86
|
It should be installable from Python distribution platforms or Integrated Development Environments (IDEs).
|
77
|
-
Otherwise, it can be installed from a command console:
|
87
|
+
Otherwise, it can be installed from a command console using `pip <https://pip.pypa.io/>`_:
|
78
88
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
89
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
90
|
+
| | For all users (after acquiring administrative rights) | For the current user (no administrative rights required) |
|
91
|
+
+==============+=======================================================+==========================================================+
|
92
|
+
| Installation | ``pip install`` |PYPI_NAME_LITERAL| | ``pip install --user`` |PYPI_NAME_LITERAL| |
|
93
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
94
|
+
| Update | ``pip install --upgrade`` |PYPI_NAME_LITERAL| | ``pip install --user --upgrade`` |PYPI_NAME_LITERAL| |
|
95
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
85
96
|
|
86
97
|
|
87
98
|
|
88
|
-
|
89
|
-
|
99
|
+
Dependencies
|
100
|
+
============
|
90
101
|
|
91
|
-
The
|
102
|
+
The development relies on several packages:
|
103
|
+
|
104
|
+
- Mandatory: |DEPENDENCIES_MANDATORY|
|
105
|
+
- Optional: |DEPENDENCIES_OPTIONAL|
|
106
|
+
|
107
|
+
The mandatory dependencies are installed automatically by `pip <https://pip.pypa.io/>`_, if they are not already, as part of the installation of |PROJECT_NAME|.
|
108
|
+
Python distribution platforms or Integrated Development Environments (IDEs) should also take care of this.
|
109
|
+
The optional dependencies, if any, must be installed independently by following the related instructions, for added functionalities of |PROJECT_NAME|.
|
92
110
|
|
93
111
|
|
94
112
|
|
95
113
|
Acknowledgments
|
96
114
|
===============
|
97
115
|
|
98
|
-
|
116
|
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
117
|
+
:target: https://github.com/psf/black
|
118
|
+
.. image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
|
119
|
+
:target: https://pycqa.github.io/isort/
|
99
120
|
|
100
|
-
The
|
101
|
-
(see ``install_requires`` in ``setup.py``, if present; otherwise ``import`` statements should be searched for).
|
121
|
+
The project is developed with `PyCharm Community <https://www.jetbrains.com/pycharm/>`_.
|
102
122
|
|
103
123
|
The code is formatted by `Black <https://github.com/psf/black/>`_, *The Uncompromising Code Formatter*.
|
104
124
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
Copyright CNRS/Inria/
|
1
|
+
Copyright CNRS/Inria/UniCA
|
2
2
|
Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
|
4
4
|
eric.debreuve@cnrs.fr
|
5
5
|
|
6
6
|
This software is being developed by Eric Debreuve, a CNRS employee and member of team Morpheme.
|
7
|
-
Team Morpheme is a joint team between Inria, CNRS, and
|
7
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
8
8
|
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory I3S, and Laboratory iBV.
|
9
9
|
|
10
10
|
CNRS: https://www.cnrs.fr/index.php/en
|
11
11
|
Inria: https://www.inria.fr/en/
|
12
|
-
|
12
|
+
UniCA: https://univ-cotedazur.eu/
|
13
13
|
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
14
14
|
I3S: https://www.i3s.unice.fr/en/
|
15
15
|
iBV: http://ibv.unice.fr/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
..
|
2
|
-
Copyright CNRS/Inria/
|
2
|
+
Copyright CNRS/Inria/UniCA
|
3
3
|
Contributor(s): Eric Debreuve (since 2023)
|
4
4
|
|
5
5
|
eric.debreuve@cnrs.fr
|
@@ -31,7 +31,7 @@
|
|
31
31
|
knowledge of the CeCILL license and that you accept its terms.
|
32
32
|
|
33
33
|
.. |PROJECT_NAME| replace:: logger-36
|
34
|
-
.. |SHORT_DESCRIPTION| replace:: Simple logger
|
34
|
+
.. |SHORT_DESCRIPTION| replace:: Simple logger with a catalog of handlers
|
35
35
|
|
36
36
|
.. |PYPI_NAME_LITERAL| replace:: ``logger-36``
|
37
37
|
.. |PYPI_PROJECT_URL| replace:: https://pypi.org/project/logger-36/
|
@@ -40,6 +40,9 @@
|
|
40
40
|
.. |DOCUMENTATION_URL| replace:: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
41
41
|
.. _DOCUMENTATION_URL: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
42
42
|
|
43
|
+
.. |DEPENDENCIES_MANDATORY| replace:: platformdirs
|
44
|
+
.. |DEPENDENCIES_OPTIONAL| replace:: psutil, rich
|
45
|
+
|
43
46
|
|
44
47
|
|
45
48
|
===================================
|
@@ -48,6 +51,13 @@
|
|
48
51
|
|
49
52
|
|
50
53
|
|
54
|
+
Documentation
|
55
|
+
=============
|
56
|
+
|
57
|
+
The documentation is available at |DOCUMENTATION_URL|_.
|
58
|
+
|
59
|
+
|
60
|
+
|
51
61
|
Installation
|
52
62
|
============
|
53
63
|
|
@@ -55,31 +65,41 @@ This project is published
|
|
55
65
|
on the `Python Package Index (PyPI) <https://pypi.org/>`_
|
56
66
|
at: |PYPI_PROJECT_URL|_.
|
57
67
|
It should be installable from Python distribution platforms or Integrated Development Environments (IDEs).
|
58
|
-
Otherwise, it can be installed from a command console:
|
68
|
+
Otherwise, it can be installed from a command console using `pip <https://pip.pypa.io/>`_:
|
59
69
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
70
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
71
|
+
| | For all users (after acquiring administrative rights) | For the current user (no administrative rights required) |
|
72
|
+
+==============+=======================================================+==========================================================+
|
73
|
+
| Installation | ``pip install`` |PYPI_NAME_LITERAL| | ``pip install --user`` |PYPI_NAME_LITERAL| |
|
74
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
75
|
+
| Update | ``pip install --upgrade`` |PYPI_NAME_LITERAL| | ``pip install --user --upgrade`` |PYPI_NAME_LITERAL| |
|
76
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
66
77
|
|
67
78
|
|
68
79
|
|
69
|
-
|
70
|
-
|
80
|
+
Dependencies
|
81
|
+
============
|
71
82
|
|
72
|
-
The
|
83
|
+
The development relies on several packages:
|
84
|
+
|
85
|
+
- Mandatory: |DEPENDENCIES_MANDATORY|
|
86
|
+
- Optional: |DEPENDENCIES_OPTIONAL|
|
87
|
+
|
88
|
+
The mandatory dependencies are installed automatically by `pip <https://pip.pypa.io/>`_, if they are not already, as part of the installation of |PROJECT_NAME|.
|
89
|
+
Python distribution platforms or Integrated Development Environments (IDEs) should also take care of this.
|
90
|
+
The optional dependencies, if any, must be installed independently by following the related instructions, for added functionalities of |PROJECT_NAME|.
|
73
91
|
|
74
92
|
|
75
93
|
|
76
94
|
Acknowledgments
|
77
95
|
===============
|
78
96
|
|
79
|
-
|
97
|
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
98
|
+
:target: https://github.com/psf/black
|
99
|
+
.. image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
|
100
|
+
:target: https://pycqa.github.io/isort/
|
80
101
|
|
81
|
-
The
|
82
|
-
(see ``install_requires`` in ``setup.py``, if present; otherwise ``import`` statements should be searched for).
|
102
|
+
The project is developed with `PyCharm Community <https://www.jetbrains.com/pycharm/>`_.
|
83
103
|
|
84
104
|
The code is formatted by `Black <https://github.com/psf/black/>`_, *The Uncompromising Code Formatter*.
|
85
105
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright CNRS/Inria/
|
1
|
+
// Copyright CNRS/Inria/UniCA
|
2
2
|
// Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
//
|
4
4
|
// eric.debreuve@cnrs.fr
|
@@ -39,4 +39,20 @@
|
|
39
39
|
:REPOSITORY_NAME: logger-36
|
40
40
|
:REPOSITORY_USER: eric.debreuve
|
41
41
|
:REPOSITORY_SITE: src.koda.cnrs.fr
|
42
|
+
:DOCUMENTATION_SITE: -/wikis/home
|
42
43
|
:SINCE_YEAR: 2023
|
44
|
+
|
45
|
+
:LICENSE_SHORT: CeCILL-2.1
|
46
|
+
:LICENCE_LONG: CEA CNRS Inria Logiciel Libre License, version 2.1
|
47
|
+
:PY_VERSION_MAJOR: 3
|
48
|
+
:PY_VERSION_MIN: 3.10
|
49
|
+
|
50
|
+
:PYPI_NAME: logger-36
|
51
|
+
:PYPI_TOPIC: Software Development
|
52
|
+
:PYPI_AUDIENCE: Developers
|
53
|
+
:PYPI_STATUS: 5 - Production/Stable
|
54
|
+
|
55
|
+
:IMPORT_NAME: logger_36
|
56
|
+
:CONFIG_FOLDER: None
|
57
|
+
|
58
|
+
:DEPENDENCIES_OPTIONAL: psutil, rich
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright CNRS/Inria/
|
1
|
+
# Copyright CNRS/Inria/UniCA
|
2
2
|
# Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
#
|
4
4
|
# eric.debreuve@cnrs.fr
|
@@ -58,7 +58,6 @@ from rich.markup import escape as EscapedForRich
|
|
58
58
|
from rich.text import Text as text_t
|
59
59
|
from rich.traceback import install as InstallTracebackHandler
|
60
60
|
|
61
|
-
|
62
61
|
_COMMON_TRACEBACK_ARGUMENTS = ("theme", "width")
|
63
62
|
_EXCLUSIVE_TRACEBACK_ARGUMENTS = (
|
64
63
|
"extra_lines",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright CNRS/Inria/
|
1
|
+
# Copyright CNRS/Inria/UniCA
|
2
2
|
# Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
#
|
4
4
|
# eric.debreuve@cnrs.fr
|
@@ -33,6 +33,8 @@ import dataclasses as dtcl
|
|
33
33
|
import logging as lggg
|
34
34
|
import typing as h
|
35
35
|
|
36
|
+
from logger_36.catalog.config.console_rich import DATE_TIME_COLOR
|
37
|
+
|
36
38
|
try:
|
37
39
|
from rich.console import Console as console_t
|
38
40
|
from rich.markup import escape as EscapedForRich
|
@@ -42,7 +44,7 @@ except ModuleNotFoundError:
|
|
42
44
|
|
43
45
|
from logger_36.catalog.handler.console_rich import console_rich_handler_t
|
44
46
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
45
|
-
from logger_36.task.format.rule import Rule
|
47
|
+
from logger_36.task.format.rule import Rule, RuleAsText
|
46
48
|
from logger_36.type.extension import handler_extension_t
|
47
49
|
|
48
50
|
|
@@ -69,7 +71,7 @@ class generic_handler_t(lggg.Handler):
|
|
69
71
|
|
70
72
|
supports_html: dtcl.InitVar[bool] = False
|
71
73
|
rich_kwargs: dtcl.InitVar[dict[str, h.Any] | None] = None
|
72
|
-
interface: dtcl.InitVar[interface_h | None] = None
|
74
|
+
interface: dtcl.InitVar[interface_h | None] = None # Cannot be None actually.
|
73
75
|
|
74
76
|
def __post_init__(
|
75
77
|
self,
|
@@ -105,8 +107,6 @@ class generic_handler_t(lggg.Handler):
|
|
105
107
|
|
106
108
|
self.FormattedLines = self.extension.FormattedLines
|
107
109
|
|
108
|
-
if interface is None:
|
109
|
-
raise ValueError("Interface cannot be None.")
|
110
110
|
self.ShowMessage = getattr(
|
111
111
|
interface, can_show_message_p.ShowMessage.__name__, interface
|
112
112
|
)
|
@@ -114,10 +114,13 @@ class generic_handler_t(lggg.Handler):
|
|
114
114
|
def emit(self, record: lggg.LogRecord, /) -> None:
|
115
115
|
""""""
|
116
116
|
if self.console is None:
|
117
|
-
|
117
|
+
if hasattr(record, SHOW_W_RULE_ATTR):
|
118
|
+
message = RuleAsText(record.msg)
|
119
|
+
else:
|
120
|
+
message, _ = self.FormattedLines(record, should_join_lines=True)
|
118
121
|
else:
|
119
122
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
120
|
-
richer = Rule(record.msg,
|
123
|
+
richer = Rule(record.msg, DATE_TIME_COLOR)
|
121
124
|
else:
|
122
125
|
first, next_s = self.FormattedLines(record, PreProcessed=EscapedForRich)
|
123
126
|
richer = console_rich_handler_t.HighlightedVersion(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright CNRS/Inria/
|
1
|
+
# Copyright CNRS/Inria/UniCA
|
2
2
|
# Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
#
|
4
4
|
# eric.debreuve@cnrs.fr
|
@@ -216,9 +216,10 @@ class logger_t(lggg.Logger):
|
|
216
216
|
date = dttm.now().strftime(DATE_FORMAT)
|
217
217
|
if date != self.last_message_date:
|
218
218
|
self.last_message_date = date
|
219
|
-
# levelno
|
219
|
+
# levelno: Added for management by lggg.Logger.handle.
|
220
220
|
date_record = lggg.makeLogRecord(
|
221
221
|
{
|
222
|
+
"name": self.name,
|
222
223
|
"levelno": lggg.INFO,
|
223
224
|
"msg": f"DATE: {date}",
|
224
225
|
SHOW_W_RULE_ATTR: True,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright CNRS/Inria/
|
1
|
+
# Copyright CNRS/Inria/UniCA
|
2
2
|
# Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
#
|
4
4
|
# eric.debreuve@cnrs.fr
|
@@ -29,4 +29,4 @@
|
|
29
29
|
# The fact that you are presently reading this means that you have had
|
30
30
|
# knowledge of the CeCILL license and that you accept its terms.
|
31
31
|
|
32
|
-
__version__ = "2024.
|
32
|
+
__version__ = "2024.8"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: logger-36
|
3
|
-
Version: 2024.
|
3
|
+
Version: 2024.8
|
4
4
|
Summary: Simple logger with a catalog of handlers
|
5
5
|
Home-page: https://src.koda.cnrs.fr/eric.debreuve/logger-36/
|
6
6
|
Author: Eric Debreuve
|
@@ -18,7 +18,7 @@ Requires-Python: >=3.10
|
|
18
18
|
Description-Content-Type: text/x-rst
|
19
19
|
|
20
20
|
..
|
21
|
-
Copyright CNRS/Inria/
|
21
|
+
Copyright CNRS/Inria/UniCA
|
22
22
|
Contributor(s): Eric Debreuve (since 2023)
|
23
23
|
|
24
24
|
eric.debreuve@cnrs.fr
|
@@ -50,7 +50,7 @@ Description-Content-Type: text/x-rst
|
|
50
50
|
knowledge of the CeCILL license and that you accept its terms.
|
51
51
|
|
52
52
|
.. |PROJECT_NAME| replace:: logger-36
|
53
|
-
.. |SHORT_DESCRIPTION| replace:: Simple logger
|
53
|
+
.. |SHORT_DESCRIPTION| replace:: Simple logger with a catalog of handlers
|
54
54
|
|
55
55
|
.. |PYPI_NAME_LITERAL| replace:: ``logger-36``
|
56
56
|
.. |PYPI_PROJECT_URL| replace:: https://pypi.org/project/logger-36/
|
@@ -59,6 +59,9 @@ Description-Content-Type: text/x-rst
|
|
59
59
|
.. |DOCUMENTATION_URL| replace:: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
60
60
|
.. _DOCUMENTATION_URL: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
61
61
|
|
62
|
+
.. |DEPENDENCIES_MANDATORY| replace:: platformdirs
|
63
|
+
.. |DEPENDENCIES_OPTIONAL| replace:: psutil, rich
|
64
|
+
|
62
65
|
|
63
66
|
|
64
67
|
===================================
|
@@ -67,6 +70,13 @@ Description-Content-Type: text/x-rst
|
|
67
70
|
|
68
71
|
|
69
72
|
|
73
|
+
Documentation
|
74
|
+
=============
|
75
|
+
|
76
|
+
The documentation is available at |DOCUMENTATION_URL|_.
|
77
|
+
|
78
|
+
|
79
|
+
|
70
80
|
Installation
|
71
81
|
============
|
72
82
|
|
@@ -74,31 +84,41 @@ This project is published
|
|
74
84
|
on the `Python Package Index (PyPI) <https://pypi.org/>`_
|
75
85
|
at: |PYPI_PROJECT_URL|_.
|
76
86
|
It should be installable from Python distribution platforms or Integrated Development Environments (IDEs).
|
77
|
-
Otherwise, it can be installed from a command console:
|
87
|
+
Otherwise, it can be installed from a command console using `pip <https://pip.pypa.io/>`_:
|
78
88
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
89
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
90
|
+
| | For all users (after acquiring administrative rights) | For the current user (no administrative rights required) |
|
91
|
+
+==============+=======================================================+==========================================================+
|
92
|
+
| Installation | ``pip install`` |PYPI_NAME_LITERAL| | ``pip install --user`` |PYPI_NAME_LITERAL| |
|
93
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
94
|
+
| Update | ``pip install --upgrade`` |PYPI_NAME_LITERAL| | ``pip install --user --upgrade`` |PYPI_NAME_LITERAL| |
|
95
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
85
96
|
|
86
97
|
|
87
98
|
|
88
|
-
|
89
|
-
|
99
|
+
Dependencies
|
100
|
+
============
|
90
101
|
|
91
|
-
The
|
102
|
+
The development relies on several packages:
|
103
|
+
|
104
|
+
- Mandatory: |DEPENDENCIES_MANDATORY|
|
105
|
+
- Optional: |DEPENDENCIES_OPTIONAL|
|
106
|
+
|
107
|
+
The mandatory dependencies are installed automatically by `pip <https://pip.pypa.io/>`_, if they are not already, as part of the installation of |PROJECT_NAME|.
|
108
|
+
Python distribution platforms or Integrated Development Environments (IDEs) should also take care of this.
|
109
|
+
The optional dependencies, if any, must be installed independently by following the related instructions, for added functionalities of |PROJECT_NAME|.
|
92
110
|
|
93
111
|
|
94
112
|
|
95
113
|
Acknowledgments
|
96
114
|
===============
|
97
115
|
|
98
|
-
|
116
|
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
117
|
+
:target: https://github.com/psf/black
|
118
|
+
.. image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
|
119
|
+
:target: https://pycqa.github.io/isort/
|
99
120
|
|
100
|
-
The
|
101
|
-
(see ``install_requires`` in ``setup.py``, if present; otherwise ``import`` statements should be searched for).
|
121
|
+
The project is developed with `PyCharm Community <https://www.jetbrains.com/pycharm/>`_.
|
102
122
|
|
103
123
|
The code is formatted by `Black <https://github.com/psf/black/>`_, *The Uncompromising Code Formatter*.
|
104
124
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright CNRS/Inria/
|
1
|
+
# Copyright CNRS/Inria/UniCA
|
2
2
|
# Contributor(s): Eric Debreuve (since 2023)
|
3
3
|
#
|
4
4
|
# eric.debreuve@cnrs.fr
|
@@ -30,15 +30,18 @@
|
|
30
30
|
# knowledge of the CeCILL license and that you accept its terms.
|
31
31
|
|
32
32
|
import re as rgex
|
33
|
+
from importlib import util
|
33
34
|
from pathlib import Path as path_t
|
35
|
+
from typing import Dict
|
34
36
|
|
35
37
|
from setuptools import setup
|
36
38
|
|
37
39
|
HERE = path_t(__file__).parent.resolve()
|
38
|
-
|
40
|
+
LOCAL_DOCUMENTATION = HERE / "documentation" / "wiki"
|
41
|
+
ASCIIDOC_DESCRIPTION = "description.asciidoc"
|
39
42
|
|
40
43
|
|
41
|
-
def
|
44
|
+
def DescriptionFromAsciidoc(documentation: path_t, /) -> Dict[str, str]:
|
42
45
|
""""""
|
43
46
|
output = {}
|
44
47
|
|
@@ -54,59 +57,50 @@ def DescriptionFromDocumentation(documentation: path_t, /) -> dict[str, str]:
|
|
54
57
|
return output
|
55
58
|
|
56
59
|
|
57
|
-
DESCRIPTION =
|
58
|
-
|
59
|
-
|
60
|
-
LICENSE_SHORT = "CeCILL-2.1"
|
61
|
-
LICENCE_LONG = "CEA CNRS Inria Logiciel Libre License, version 2.1"
|
62
|
-
PY_VERSION = "3"
|
63
|
-
PY_VERSION_MIN = "3.10"
|
64
|
-
|
65
|
-
DOCUMENTATION_SITE = "-/wikis/home"
|
66
|
-
|
67
|
-
PYPI_NAME = "logger-36"
|
68
|
-
PYPI_TOPIC = "Software Development"
|
69
|
-
PYPI_AUDIENCE = "Developers"
|
70
|
-
PYPI_STATUS = "5 - Production/Stable"
|
71
|
-
|
72
|
-
IMPORT_NAME = "logger_36"
|
60
|
+
DESCRIPTION = DescriptionFromAsciidoc(LOCAL_DOCUMENTATION / ASCIIDOC_DESCRIPTION)
|
73
61
|
PACKAGES = [
|
74
|
-
IMPORT_NAME,
|
75
|
-
f"{IMPORT_NAME}.catalog",
|
76
|
-
f"{IMPORT_NAME}.catalog.config",
|
77
|
-
f"{IMPORT_NAME}.catalog.handler",
|
78
|
-
f"{IMPORT_NAME}.catalog.logging",
|
79
|
-
f"{IMPORT_NAME}.config",
|
80
|
-
f"{IMPORT_NAME}.constant",
|
81
|
-
f"{IMPORT_NAME}.task",
|
82
|
-
f"{IMPORT_NAME}.task.format",
|
83
|
-
f"{IMPORT_NAME}.task.measure",
|
84
|
-
f"{IMPORT_NAME}.type",
|
62
|
+
DESCRIPTION["IMPORT_NAME"],
|
63
|
+
f"{DESCRIPTION['IMPORT_NAME']}.catalog",
|
64
|
+
f"{DESCRIPTION['IMPORT_NAME']}.catalog.config",
|
65
|
+
f"{DESCRIPTION['IMPORT_NAME']}.catalog.handler",
|
66
|
+
f"{DESCRIPTION['IMPORT_NAME']}.catalog.logging",
|
67
|
+
f"{DESCRIPTION['IMPORT_NAME']}.config",
|
68
|
+
f"{DESCRIPTION['IMPORT_NAME']}.constant",
|
69
|
+
f"{DESCRIPTION['IMPORT_NAME']}.task",
|
70
|
+
f"{DESCRIPTION['IMPORT_NAME']}.task.format",
|
71
|
+
f"{DESCRIPTION['IMPORT_NAME']}.task.measure",
|
72
|
+
f"{DESCRIPTION['IMPORT_NAME']}.type",
|
85
73
|
]
|
86
|
-
|
87
|
-
|
74
|
+
EXCLUDED_PACKAGES = (
|
75
|
+
f"{DESCRIPTION['IMPORT_NAME']}.documentation",
|
76
|
+
)
|
77
|
+
ENTRY_POINTS = {
|
78
|
+
"console_scripts": [],
|
79
|
+
"gui_scripts": [],
|
80
|
+
}
|
88
81
|
|
89
82
|
|
90
83
|
long_description = (HERE / "README.rst").read_text(encoding="utf-8")
|
84
|
+
|
91
85
|
repository_url = (
|
92
86
|
f"https://"
|
93
87
|
f"{DESCRIPTION['REPOSITORY_SITE']}/"
|
94
88
|
f"{DESCRIPTION['REPOSITORY_USER']}/"
|
95
89
|
f"{DESCRIPTION['REPOSITORY_NAME']}/"
|
96
90
|
)
|
97
|
-
documentation_url = f"{repository_url}/{DOCUMENTATION_SITE}"
|
91
|
+
documentation_url = f"{repository_url}/{DESCRIPTION['DOCUMENTATION_SITE']}"
|
98
92
|
|
99
93
|
|
100
94
|
def CheckCoherenceBetweenDeclarationAndReality() -> None:
|
101
95
|
""""""
|
102
|
-
folders = [IMPORT_NAME]
|
103
|
-
for node in (HERE / IMPORT_NAME).rglob("*"):
|
96
|
+
folders = [DESCRIPTION["IMPORT_NAME"]]
|
97
|
+
for node in (HERE / DESCRIPTION["IMPORT_NAME"]).rglob("*"):
|
104
98
|
if node.is_dir() and not str(node).startswith("."):
|
105
99
|
node = node.relative_to(HERE)
|
106
100
|
node = ".".join(node.parts)
|
107
101
|
if not (
|
108
|
-
(node in
|
109
|
-
or any(node.startswith(_fld + ".") for _fld in
|
102
|
+
(node in EXCLUDED_PACKAGES)
|
103
|
+
or any(node.startswith(_fld + ".") for _fld in EXCLUDED_PACKAGES)
|
110
104
|
):
|
111
105
|
folders.append(node)
|
112
106
|
folders = sorted(folders)
|
@@ -116,21 +110,34 @@ def CheckCoherenceBetweenDeclarationAndReality() -> None:
|
|
116
110
|
raise ValueError(
|
117
111
|
f"Mismatch between declared and found packages:\n"
|
118
112
|
f" - Declared=\n {packages}\n"
|
119
|
-
f" - Found=\n {folders}"
|
113
|
+
f" - Found=\n {folders}\n"
|
114
|
+
f" - Undeclared=\n {set(folders).difference(packages)}\n"
|
115
|
+
f" - Nonexistent=\n {set(packages).difference(folders)}"
|
120
116
|
)
|
121
117
|
|
122
118
|
|
123
|
-
def Version():
|
119
|
+
def Version() -> str:
|
124
120
|
""""""
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
where = HERE / DESCRIPTION["IMPORT_NAME"] / "version.py"
|
122
|
+
spec = util.spec_from_file_location(where.stem, where)
|
123
|
+
module = spec.loader.load_module(spec.name)
|
128
124
|
|
129
|
-
output =
|
125
|
+
output = module.__version__
|
130
126
|
if isinstance(output, str) and rgex.fullmatch(r"20[0-9]{2}\.[1-9][0-9]*", output):
|
131
127
|
return output
|
132
128
|
|
133
|
-
raise ValueError(f"Invalid version
|
129
|
+
raise ValueError(f"{output}: Invalid version")
|
130
|
+
|
131
|
+
|
132
|
+
def Requirements() -> tuple[str, ...]:
|
133
|
+
""""""
|
134
|
+
if not (HERE / "requirements.txt").is_file():
|
135
|
+
return ()
|
136
|
+
|
137
|
+
with open(HERE / "requirements.txt") as accessor:
|
138
|
+
output = accessor.readlines()
|
139
|
+
|
140
|
+
return tuple(output)
|
134
141
|
|
135
142
|
|
136
143
|
if __name__ == "__main__":
|
@@ -141,19 +148,19 @@ if __name__ == "__main__":
|
|
141
148
|
author=DESCRIPTION["AUTHOR"],
|
142
149
|
author_email=DESCRIPTION["EMAIL"],
|
143
150
|
#
|
144
|
-
name=PYPI_NAME,
|
151
|
+
name=DESCRIPTION["PYPI_NAME"],
|
145
152
|
description=DESCRIPTION["SHORT_DESCRIPTION"],
|
146
153
|
long_description=long_description,
|
147
154
|
long_description_content_type="text/x-rst",
|
148
|
-
license=LICENSE_SHORT,
|
155
|
+
license=DESCRIPTION["LICENSE_SHORT"],
|
149
156
|
version=Version(),
|
150
157
|
#
|
151
158
|
classifiers=[
|
152
|
-
f"Topic :: {PYPI_TOPIC}",
|
153
|
-
f"Intended Audience :: {PYPI_AUDIENCE}",
|
154
|
-
f"License :: OSI Approved :: {LICENCE_LONG} ({LICENSE_SHORT})",
|
155
|
-
f"Programming Language :: Python :: {
|
156
|
-
f"Development Status :: {PYPI_STATUS}",
|
159
|
+
f"Topic :: {DESCRIPTION['PYPI_TOPIC']}",
|
160
|
+
f"Intended Audience :: {DESCRIPTION['PYPI_AUDIENCE']}",
|
161
|
+
f"License :: OSI Approved :: {DESCRIPTION['LICENCE_LONG']} ({DESCRIPTION['LICENSE_SHORT']})",
|
162
|
+
f"Programming Language :: Python :: {DESCRIPTION['PY_VERSION_MAJOR']}",
|
163
|
+
f"Development Status :: {DESCRIPTION['PYPI_STATUS']}",
|
157
164
|
],
|
158
165
|
keywords=DESCRIPTION["KEYWORDS"],
|
159
166
|
#
|
@@ -165,6 +172,6 @@ if __name__ == "__main__":
|
|
165
172
|
#
|
166
173
|
packages=PACKAGES,
|
167
174
|
entry_points=ENTRY_POINTS,
|
168
|
-
python_requires=f">={PY_VERSION_MIN}",
|
169
|
-
install_requires=
|
175
|
+
python_requires=f">={DESCRIPTION['PY_VERSION_MIN']}",
|
176
|
+
install_requires=Requirements(),
|
170
177
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|