Skip to content

Commit 3518488

Browse files
authored
Merge pull request #6 from mlcommons/publishable-to-pypi
Make commitable to pypi
2 parents c52348a + 9733d6a commit 3518488

File tree

12 files changed

+48
-104
lines changed

12 files changed

+48
-104
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
__pycache__
2+
dist

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Modellogger
1+
# airrlogger
22

3-
The modellogger package provides a standardized logging configuration for AIRR applications.
3+
The airrlogger package provides a standardized logging configuration for AIRR applications.
44

55
## Usage
66

7-
Install in a poetry project: `poetry add git+https://github.com/mlcommons/modellogger.git`
7+
Install in a poetry project: `poetry add airrlogger`
88

99
Near the top of any file where you want to log, do something like:
1010

1111
```python
12-
from modellogger.log_config import get_logger
12+
from airrlogger.log_config import get_logger
1313
logger = get_logger(__name__)
1414
```
1515

@@ -18,7 +18,7 @@ handle the logging:
1818

1919
```python
2020
import logging
21-
from modellogger.log_config import configure_logging
21+
from airrlogger.log_config import configure_logging
2222

2323
configure_logging(app_name="myapp", level=logging.INFO)
2424
```
@@ -45,7 +45,7 @@ A class that formats log messages with UTC timestamps and optional ANSI color co
4545
A function that configure the root logger with console and optional file output.
4646

4747
```
48-
from modellogger.log_config import configure_logging
48+
from airrlogger.log_config import configure_logging
4949
5050
logger = configure_logging(app_name="modelrunner-api", file="./app.log", level=logging.DEBUG)
5151
```
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def get_config_dict(
7373
app_name: str = ".",
7474
level: int = logging.INFO,
7575
log_file: Optional[str] = None,
76+
include_colors: bool = False,
7677
) -> Dict[str, Any]:
7778
config: Dict[str, Any] = {
7879
"version": 1,
@@ -81,12 +82,12 @@ def get_config_dict(
8182
"default_console": {
8283
"()": f"{__name__}.DefaultFormatter",
8384
"app_name": app_name,
84-
"include_colors": True,
85+
"include_colors": include_colors,
8586
},
8687
"default_file": {
8788
"()": f"{__name__}.DefaultFormatter",
8889
"app_name": app_name,
89-
"include_colors": False,
90+
"include_colors": include_colors,
9091
},
9192
},
9293
"handlers": {

poetry.lock

Lines changed: 2 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
[tool.poetry]
2-
name = "modellogger"
2+
name = "airrlogger"
33
version = "0.1.0"
4-
description = ""
5-
authors = ["dhosterman <daniel@danielhosterman.com>"]
4+
description = "Python logging configuration library for MLCommons AIRR applications."
5+
authors = ["Daniel Hosterman <daniel@mlcommons.org>"]
66
readme = "README.md"
7+
packages = [{include = "airrlogger"}]
8+
homepage = "https://github.com/mlcommons/modellogger"
9+
repository = "https://github.com/mlcommons/modellogger"
10+
documentation = "https://github.com/mlcommons/modellogger#readme"
11+
keywords = ["logging", "internal"]
12+
classifiers = [
13+
"Development Status :: 3 - Alpha",
14+
"Intended Audience :: Developers",
15+
"Programming Language :: Python :: 3.12",
16+
"Programming Language :: Python :: 3.13",
17+
"Programming Language :: Python :: 3.14",
18+
]
719

820
[tool.poetry.dependencies]
9-
python = ">=3.10"
21+
python = ">=3.12,<4.0"
1022

1123
[tool.poetry.group.dev.dependencies]
1224
pytest = "^9.0.2"

tests/example_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import logging
22

33
import click
4-
from modellogger.log_config import get_logger, configure_logging
4+
5+
from airrlogger.log_config import configure_logging, get_logger
56
from tests.example_top_library import top_library_function
67

78

tests/example_lower_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modellogger.log_config import get_logger
1+
from airrlogger.log_config import get_logger
22

33
logger = get_logger(__name__)
44

tests/example_top_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modellogger.log_config import get_logger
1+
from airrlogger.log_config import get_logger
22
from tests.example_lower_library import lower_library_function
33

44
logger = get_logger(__name__)

0 commit comments

Comments
 (0)