Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --locked --all-extras --dev
shell: bash
run: uv sync --locked --all-extras --group dev

- name: Run tests with coverage
uses: nick-fields/retry@v3
Expand Down
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
<a href="https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ"><img src="https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic" alt="Donate"/></a>
<a href="https://github.com/sponsors/ddc"><img src="https://img.shields.io/static/v1?style=plastic&label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=ff69b4" alt="Sponsor"/></a>
<br>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=plastic" alt="Code style: black"/></a>
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json?style=plastic" alt="uv"/></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json?style=plastic" alt="Ruff"/></a>
<br>
<a href="https://www.python.org/downloads"><img src="https://img.shields.io/pypi/pyversions/pythonLogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="Python"/></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic" alt="License: MIT"/></a>
<a href="https://pepy.tech/projects/pythonLogs"><img src="https://static.pepy.tech/badge/pythonLogs?style=plastic" alt="PyPI Downloads"/></a>
<a href="https://pypi.python.org/pypi/pythonLogs"><img src="https://img.shields.io/pypi/v/pythonLogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="PyPi"/></a>
<br>
<a href="https://www.python.org/downloads"><img src="https://img.shields.io/pypi/pyversions/pythonLogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="Python"/></a>
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json?style=plastic" alt="uv"/></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json?style=plastic" alt="Ruff"/></a>
<br>
<a href="https://github.com/ddc/pythonLogs/issues"><img src="https://img.shields.io/github/issues/ddc/pythonLogs?style=plastic" alt="issues"/></a>
<a href="https://codecov.io/gh/ddc/pythonLogs"><img src="https://codecov.io/gh/ddc/pythonLogs/graph/badge.svg?token=XWB53034GI&style=plastic" alt="codecov"/></a>
<a href="https://sonarcloud.io/dashboard?id=ddc_pythonLogs"><img src="https://sonarcloud.io/api/project_badges/measure?project=ddc_pythonLogs&metric=alert_status&style=plastic" alt="Quality Gate Status"/></a>
Expand All @@ -40,7 +39,7 @@
- [Environment Variables](#env-variables-optional)
- [Settings Cache Management](#settings-cache-management)
- [Flexible Configuration Options](#flexible-configuration-options)
- [Development](#development)
- [Development and Testing](#development-and-testing)
- [Create DEV Environment and Running Tests](#create-dev-environment-and-running-tests)
- [Update DEV Environment Packages](#update-dev-environment-packages)
- [Building Wheel](#building-wheel)
Expand Down Expand Up @@ -349,17 +348,15 @@ RotateWhen.MONDAY # "W0"



# Development
# Development and Testing

Must have [UV](https://uv.run/docs/getting-started/installation) installed.

## Create DEV Environment and Running Tests

> **Note:** All poe tasks automatically run ruff linter along with Black formatting

```shell
uv sync --all-extras --all-groups
poe test
poe tests
```


Expand Down
17 changes: 6 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = ["pythonLogs"]

[project]
name = "pythonLogs"
version = "6.0.2"
version = "6.0.3"
description = "High-performance Python logging library with file rotation and optimized caching for better performance"
urls.Repository = "https://github.com/ddc/pythonLogs"
urls.Homepage = "https://pypi.org/project/pythonLogs"
Expand Down Expand Up @@ -54,16 +54,15 @@ dev = [
"psutil>=7.2.2",
"pytest-cov>=7.0.0",
"poethepoet>=0.41.0",
"ruff>=0.15.0",
"black>=26.1.0",
"ruff>=0.15.1",
]

[tool.poe.tasks]
linter.shell = "uv run ruff check --fix . && uv run black ."
profile.sequence = ["linter", {shell = "uv run python -m cProfile -o cprofile_unit.prof -m pytest --no-cov"}]
test.sequence = ["linter", {shell = "uv run pytest"}]
linter.shell = "uv run ruff check --fix . && uv run ruff format ."
profile = "uv run python -m cProfile -o cprofile_unit.prof -m pytest --no-cov"
tests = "uv run pytest"
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --group dev"}]
build.sequence = ["updatedev", "test", {shell = "uv build --wheel"}]
build.sequence = ["updatedev", "tests", {shell = "uv build --wheel"}]

[tool.pytest.ini_options]
addopts = "-v --cov --cov-report=term --cov-report=xml --junitxml=junit.xml"
Expand Down Expand Up @@ -95,10 +94,6 @@ exclude_lines = [
"@(abc\\.)?abstractmethod",
]

[tool.black]
line-length = 120
skip-string-normalization = true

[tool.ruff]
line-length = 120
target-version = "py311"
Expand Down
12 changes: 6 additions & 6 deletions tests/thread_safety/test_thread_safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ def stress_worker():
# Just verify it has at least some loggers and doesn't exceed the total
registry = LoggerFactory.get_registered_loggers()
assert len(registry) > 0, "Registry should have at least one logger"
assert len(registry) <= len(
logger_names
), f"Registry has {len(registry)} loggers, expected at most {len(logger_names)}"
assert len(registry) <= len(logger_names), (
f"Registry has {len(registry)} loggers, expected at most {len(logger_names)}"
)

# Verify that loggers in the registry are from our expected set
for logger_name in registry.keys():
Expand Down Expand Up @@ -375,9 +375,9 @@ def _verify_thread_results(self, thread_results, num_threads):
"""Helper to verify all thread results are successful."""
for worker_id in range(num_threads):
assert worker_id in thread_results
assert (
"error" not in thread_results[worker_id]
), f"Thread {worker_id} failed: {thread_results[worker_id].get('error')}"
assert "error" not in thread_results[worker_id], (
f"Thread {worker_id} failed: {thread_results[worker_id].get('error')}"
)
assert "messages" in thread_results[worker_id]
assert len(thread_results[worker_id]["messages"]) == 10

Expand Down
Loading