Skip to content

Commit 5be4b55

Browse files
authored
Merge pull request #13 from Msameim181/fix/package_management
fix: resolve issues in license and package versions
2 parents 4b06b6c + 614f1f6 commit 5be4b55

15 files changed

Lines changed: 104 additions & 721 deletions

File tree

LICENSE

Lines changed: 21 additions & 661 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,24 @@ classifiers = [
2121
"Topic :: System :: Logging",
2222
]
2323
dependencies = [
24-
"asyncio==3.4.3",
25-
"lagom==2.6.0",
26-
"pydantic==2.9.2",
27-
"fastapi==0.100.0",
28-
"python-socketio==5.12.1",
29-
"python-socketio[client]==5.12.1",
30-
"uvicorn[standard]==0.30.6",
31-
"uvicorn-worker==0.2.0",
32-
"python-multipart==0.0.10",
33-
"httpx==0.27.2",
24+
"lagom>=2.6.0",
25+
"pydantic>=2.9.2",
26+
"fastapi>=0.100.0",
27+
"python-socketio>=5.12.1",
28+
"python-socketio[client]>=5.12.1",
29+
"uvicorn[standard]>=0.30.6",
30+
"uvicorn-worker>=0.2.0",
31+
"python-multipart>=0.0.10",
32+
"httpx>=0.27.2",
33+
]
34+
35+
[project.optional-dependencies]
36+
django = ["django>=5.1.1"]
37+
dev = [
38+
"pytest>=8.3.3",
39+
"pytest-asyncio>=0.24.0",
40+
"pytest-cov>=6.0.0",
41+
"ruff>=0.1.0",
3442
]
3543

3644
[project.urls]
@@ -40,4 +48,28 @@ Repository = "https://github.com/Msameim181/Python-Logging-Best-Practice.git"
4048
Issues = "https://github.com/Msameim181/Python-Logging-Best-Practice/issues"
4149

4250
[tool.hatch.build.targets.wheel]
43-
packages = ["src/chromatrace"]
51+
packages = ["src/chromatrace"]
52+
53+
[tool.ruff]
54+
line-length = 100
55+
target-version = "py310"
56+
57+
[tool.ruff.lint]
58+
select = [
59+
"E", # pycodestyle errors
60+
"W", # pycodestyle warnings
61+
"F", # pyflakes
62+
"I", # isort
63+
"C", # flake8-comprehensions
64+
"B", # flake8-bugbear
65+
]
66+
ignore = ["E501"] # line length
67+
68+
[tool.ruff.lint.per-file-ignores]
69+
"__init__.py" = ["F401"]
70+
71+
[tool.mypy]
72+
python_version = "3.10"
73+
warn_return_any = true
74+
warn_unused_configs = true
75+
disallow_untyped_defs = true

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pytest]
22
asyncio_mode=auto
3-
asyncio_default_fixture_loop_scope="function"
3+
asyncio_default_fixture_loop_scope=function
44
python_files = tests.py test_*.py *_tests.py *_test.py

requirements.txt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
asyncio==3.4.3
2-
django==5.1.1
3-
lagom==2.6.0
4-
pydantic==2.9.2
5-
fastapi==0.100.0
6-
python-socketio==5.12.1
7-
python-socketio[client]==5.12.1
8-
pytest==8.3.3
9-
pytest-asyncio==0.24.0
10-
pytest-cov==6.0.0
11-
uvicorn[standard]==0.30.6
12-
uvicorn-worker==0.2.0
13-
python-multipart==0.0.10
14-
httpx==0.27.2
1+
# Core dependencies
2+
lagom>=2.6.0
3+
pydantic>=2.9.2
4+
fastapi>=0.100.0
5+
python-socketio>=5.12.1
6+
python-socketio[client]>=5.12.1
7+
uvicorn[standard]>=0.30.6
8+
uvicorn-worker>=0.2.0
9+
python-multipart>=0.0.10
10+
httpx>=0.27.2
11+
12+
# Optional: Django integration
13+
django>=5.1.1
14+
15+
# Development dependencies
16+
pytest>=8.3.3
17+
pytest-asyncio>=0.24.0
18+
pytest-cov>=6.0.0
19+
ruff>=0.1.0

setup.cfg

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
[metadata]
22
license_files = LICENSE
3-
4-
[tool.ruff]
5-
line-length = 100
6-
target-version = "py37"
7-
select = [
8-
"E", # pycodestyle errors
9-
"W", # pycodestyle warnings
10-
"F", # pyflakes
11-
"I", # isort
12-
"C", # flake8-comprehensions
13-
"B", # flake8-bugbear
14-
]
15-
ignore = ["E501"] # line length
16-
17-
[tool.ruff.per-file-ignores]
18-
"__init__.py" = ["F401"]
19-
20-
[mypy]
21-
python_version = 3.10
22-
warn_return_any = True
23-
warn_unused_configs = True
24-
disallow_untyped_defs = True
3+
name = chromatrace
4+
description = Advanced logging for Python

src/chromatrace/RabbitMQ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def callback(ch, method, properties, body):
3030
with rabbitmq_trace_context(ch, properties):
3131
on_message_callback(ch, method, properties, body)
3232
self.channel.basic_consume(queue=queue, on_message_callback=callback, auto_ack=auto_ack)
33-
self.channel.start_consuming()
33+
self.channel.start_consuming()

src/chromatrace/fastapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ async def dispatch(self, request: Request, call_next):
1010
with RequestIdContext(request_id):
1111
response = await call_next(request)
1212
response.headers["X-Request-ID"] = trace_id_ctx.get()
13-
return response
13+
return response

src/chromatrace/logging_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def __init__(
132132
super().__init__(
133133
message_splitter=message_splitter,
134134
log_splitter=log_splitter,
135-
*args,
136135
**kwargs,
137136
)
138137

src/examples/adaptors/socket_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
from typing import Dict, List, Optional
77

88
import socketio
9+
from pydantic import BaseModel, Field
10+
911
from chromatrace import LoggingConfig, LoggingSettings
1012
from chromatrace.tracer import trace_id_ctx
11-
from pydantic import BaseModel, Field
1213

1314
logging_config = LoggingConfig(
1415
LoggingSettings(

src/examples/frameworks/api_app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import multiprocessing
22

33
import uvicorn
4-
from chromatrace import LoggingConfig
5-
from chromatrace.fastapi import RequestIdMiddleware
6-
from chromatrace.uvicorn import GetLoggingConfig, UvicornLoggingSettings
74
from fastapi import FastAPI
85
from fastapi.middleware.cors import CORSMiddleware
96
from usecases import AnotherSample, ExampleService
107

8+
from chromatrace import LoggingConfig
9+
from chromatrace.fastapi import RequestIdMiddleware
10+
from chromatrace.uvicorn import GetLoggingConfig, UvicornLoggingSettings
11+
1112

1213
class APIService:
1314
def __init__(

0 commit comments

Comments
 (0)