From 96ecff2dabb449516b1c03bbe6a82725aa1e4be9 Mon Sep 17 00:00:00 2001 From: Harmanpreet Singh Date: Thu, 20 Feb 2025 12:23:31 +0530 Subject: [PATCH 1/3] chore(logger): pyproject fixes --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 89a5bed..6e2d716 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,3 +7,11 @@ build-backend = "setuptools.build_meta" # For smarter version schemes and other configuration options, # check out https://github.com/pypa/setuptools_scm version_scheme = "no-guess-dev" + +[tool.poetry.extras] +pipfile_deprecated_finder = [ + "valid-entry", + "another_valid_entry", + "invalid_entry", + "yet.another-valid_entry" +] From a7300124e6682b8a307505d815422424e91ca520 Mon Sep 17 00:00:00 2001 From: Harmanpreet Singh Date: Thu, 20 Feb 2025 12:28:39 +0530 Subject: [PATCH 2/3] chore(logger): pyproject fixes --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6e2d716..402a4e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,5 @@ version_scheme = "no-guess-dev" pipfile_deprecated_finder = [ "valid-entry", "another_valid_entry", - "invalid_entry", "yet.another-valid_entry" ] From b175c50fb6c175f5e75433bcd666fa3b6cc8decd Mon Sep 17 00:00:00 2001 From: Harmanpreet Singh Date: Tue, 25 Feb 2025 17:30:09 +0530 Subject: [PATCH 3/3] chore(logger): pyproject lint fixes --- .github/workflows/pr.yml | 7 ++++--- .github/workflows/publish.yml | 9 +++++---- .pre-commit-config.yaml | 10 +++++----- pyproject.toml | 12 +++--------- setup.py | 1 + src/safe_security_logger/logger.py | 12 +++++++++++- tox.ini | 2 +- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 15f7c4f..998b144 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 with: { fetch-depth: 0 } # deep clone for setuptools-scm - uses: actions/setup-python@v4 - with: { python-version: "3.10" } + with: { python-version: "3.11" } - name: Run static analysis and format checkers run: pipx run pre-commit run --all-files --show-diff-on-failure - name: Build package distribution files @@ -47,8 +47,9 @@ jobs: strategy: matrix: python: - - "3.7" # oldest Python supported by PSF - - "3.10" # newest Python that is stable + - "3.10" + - "3.11" + - "3.12" platform: - ubuntu-latest - macos-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e3b407..f80c08c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 with: { fetch-depth: 0 } # deep clone for setuptools-scm - uses: actions/setup-python@v4 - with: { python-version: "3.10" } + with: { python-version: "3.11" } - name: Run static analysis and format checkers run: pipx run pre-commit run --all-files --show-diff-on-failure - name: Build package distribution files @@ -42,8 +42,9 @@ jobs: strategy: matrix: python: - - "3.7" # oldest Python supported by PSF - - "3.10" # newest Python that is stable + - "3.10" + - "3.11" + - "3.12" platform: - ubuntu-latest - macos-latest @@ -89,7 +90,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 - with: { python-version: "3.10" } + with: { python-version: "3.11" } - name: Retrieve pre-built distribution files uses: actions/download-artifact@v4 with: { name: python-distribution-files, path: dist/ } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25d45c7..eee8532 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - --fix=lf id: mixed-line-ending repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.5.0 - hooks: - args: - --in-place @@ -23,17 +23,17 @@ repos: - --remove-unused-variables id: autoflake repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v2.2.1 - hooks: - id: isort repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.13.2 - hooks: - id: black language_version: python3 repo: https://github.com/psf/black - rev: stable + rev: 24.2.0 - hooks: - id: commitizen repo: https://github.com/commitizen-tools/commitizen - rev: v2.32.2 + rev: v3.13.0 diff --git a/pyproject.toml b/pyproject.toml index 402a4e4..fb3e62e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,10 @@ [build-system] # AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD! -requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"] +requires = ["setuptools>=61.0", "setuptools_scm[toml]>=7"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] # For smarter version schemes and other configuration options, # check out https://github.com/pypa/setuptools_scm -version_scheme = "no-guess-dev" - -[tool.poetry.extras] -pipfile_deprecated_finder = [ - "valid-entry", - "another_valid_entry", - "yet.another-valid_entry" -] +version_scheme = "post-release" +local_scheme = "node-and-date" diff --git a/setup.py b/setup.py index c32edf8..d767602 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ PyScaffold helps you to put up the scaffold of your new Python project. Learn more under: https://pyscaffold.org/ """ + from setuptools import setup if __name__ == "__main__": diff --git a/src/safe_security_logger/logger.py b/src/safe_security_logger/logger.py index ded9cb4..282f03b 100644 --- a/src/safe_security_logger/logger.py +++ b/src/safe_security_logger/logger.py @@ -8,7 +8,17 @@ __copyright__ = "Safe Security" __license__ = "MIT" -ROOT_LEVEL_FIELDS = ["level", "service", "timestamp", "type", "message", "error", "tenantId", "requestId"] +ROOT_LEVEL_FIELDS = [ + "level", + "service", + "timestamp", + "type", + "message", + "error", + "tenantId", + "requestId", +] + # Adding custom logger to support additional default field such as serviceName class CustomJsonFormatter(jsonlogger.JsonFormatter): diff --git a/tox.ini b/tox.ini index 3d737d5..df7dade 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.24 -envlist = default +envlist = py{310,311,312} # Test against multiple Python versions isolated_build = True