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
33 changes: 23 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
## Summary
<!-- Brief description of what this PR does and why -->

<!-- What is this pull request for? Does it fix any issues? -->
## Changes Made
<!-- List the key changes -->

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change (existing functionality affected)
- [ ] Refactoring (no functional changes)
- [ ] Documentation
- [ ] CI/CD or build configuration
- [ ] Dependencies update

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] All existing tests pass
- [ ] Manual testing performed

## Checklist
- [ ] If code changes were made, then they have been tested
- [ ] I have updated the documentation to reflect any changes made
- [ ] I have thought about how this code may affect other services
- [ ] This PR fixes an issue
- [ ] This PR is a breaking change (e.g. method, parameters, env variables)
- [ ] This PR adds something new (e.g. method, parameters, env variables)
- [ ] This PR change unit and integration tests
- [ ] This PR is **NOT** a code change (e.g. documentation, packages)
- [ ] Code follows the project's style and conventions
- [ ] Documentation updated (if applicable)
- [ ] No new warnings or linter errors introduced
- [ ] I have considered how this change may affect other services

## Reviewer
- [ ] I understand that approving this code, I am also responsible for it going into the codebase
- [ ] I understand that by approving this PR, I share responsibility for these changes
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
23 changes: 9 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ 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"
license = {text = "MIT"}
readme = "README.md"
authors = [
{name = "Daniel Costa", email = "ddcsoftwares@proton.me"},
{name = "Daniel Costa", email = "daniel@ddcsoftwares.com"},
]
maintainers = [
{name = "Daniel Costa"},
Expand Down Expand Up @@ -53,20 +53,19 @@ dependencies = [
dev = [
"psutil>=7.2.2",
"pytest-cov>=7.0.0",
"poethepoet>=0.41.0",
"ruff>=0.15.0",
"black>=26.1.0",
"poethepoet>=0.42.0",
"ruff>=0.15.2",
]

[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.sequence = ["linter", {shell = "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"
addopts = "-v --import-mode=importlib --cov --cov-report=term --cov-report=xml --junitxml=junit.xml"
junit_family = "legacy"
testpaths = ["tests"]
markers = [
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
2 changes: 1 addition & 1 deletion pythonLogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

__title__ = "pythonLogs"
__author__ = "Daniel Costa"
__email__ = "ddcsoftwares@proton.me"
__email__ = "daniel@ddcsoftwares.com"
__license__ = "MIT"
__copyright__ = "Copyright 2024-present DDC Softwares"
__version__ = version(__title__)
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