From 0d6c3d9e5fdd228c034c06fd034c937ebb30e466 Mon Sep 17 00:00:00 2001 From: Jules Lasne Date: Mon, 13 Mar 2023 15:42:53 +0100 Subject: [PATCH 01/14] Moving to pyproject.toml (#27) Moving to pyproject.toml --- pyproject.toml | 26 ++++++++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cfdca25 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + + +[project] +name = "JSON-log-formatter" +description = 'JSON log formatter' +authors = [ + {name = "Marsel Mavletkulov", email = "marselester@ya.ru"}, +] +readme = "README.rst" +version = '0.5.1' +license = {text = "MIT"} +classifiers=[ + 'License :: OSI Approved :: MIT License', + 'Intended Audience :: Developers', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Topic :: Software Development :: Libraries :: Python Modules' +] + +[tool.setuptools] +packages = ["json_log_formatter"] diff --git a/setup.py b/setup.py index bb73bf3..3a722c5 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,9 @@ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules' ], ) + From b5fa70b66e1e19177553b3648aefe694e26bce82 Mon Sep 17 00:00:00 2001 From: marselester Date: Mon, 13 Mar 2023 18:32:32 -0400 Subject: [PATCH 02/14] Add github ci --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..67f969e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest ujson simplejson django + - name: Lint with flake8 + run: | + flake8 . --count --show-source --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest -s tests.py From 903266e83a352591ebf4c53a37d93663ce468920 Mon Sep 17 00:00:00 2001 From: marselester Date: Mon, 13 Mar 2023 20:21:01 -0400 Subject: [PATCH 03/14] Remove .travis.yml --- .travis.yml | 18 ------------------ README.rst | 9 +++------ setup.py | 1 - 3 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7f5c18c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 - - 3.7 - - 3.8 -install: - - pip install ujson simplejson django - - python setup.py install -script: nosetests tests -notifications: - email: - recipients: - - marselester@ya.ru - on_success: change - on_failure: change diff --git a/README.rst b/README.rst index e1f9404..ff16f52 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,6 @@ -================== -JSON log formatter -================== - -.. image:: https://travis-ci.org/marselester/json-log-formatter.png - :target: https://travis-ci.org/marselester/json-log-formatter +==================== +JSON log formatter 🪵 +==================== The library helps you to store logs in JSON format. Why is it important? Well, it facilitates integration with **Logstash**. diff --git a/setup.py b/setup.py index 3a722c5..718705a 100644 --- a/setup.py +++ b/setup.py @@ -20,4 +20,3 @@ 'Topic :: Software Development :: Libraries :: Python Modules' ], ) - From eda4f77e1e30010f78a66ffac7b4a53e43f77a45 Mon Sep 17 00:00:00 2001 From: marselester Date: Mon, 13 Mar 2023 20:33:18 -0400 Subject: [PATCH 04/14] Bump version to 0.5.2 --- pyproject.toml | 29 ++++++++++++++++------------- setup.py | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cfdca25..c34c6a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,25 +2,28 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.setuptools] +packages = ["json_log_formatter"] [project] name = "JSON-log-formatter" -description = 'JSON log formatter' +version = "0.5.2" +description = "JSON log formatter" +readme = "README.rst" +requires-python = ">=2.7" +license = {text = "MIT"} authors = [ {name = "Marsel Mavletkulov", email = "marselester@ya.ru"}, ] -readme = "README.rst" -version = '0.5.1' -license = {text = "MIT"} classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Intended Audience :: Developers', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', - 'Topic :: Software Development :: Libraries :: Python Modules' + "License :: OSI Approved :: MIT License", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules" ] -[tool.setuptools] -packages = ["json_log_formatter"] +[project.urls] +repository = "https://github.com/marselester/json-log-formatter" diff --git a/setup.py b/setup.py index 718705a..3f7d91e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='JSON-log-formatter', - version='0.5.1', + version='0.5.2', license='MIT', packages=['json_log_formatter'], author='Marsel Mavletkulov', From 6d054cb68f0765b328c4a2be66dc218a64b6f947 Mon Sep 17 00:00:00 2001 From: marselester Date: Mon, 13 Mar 2023 21:15:35 -0400 Subject: [PATCH 05/14] Use twine instead of "setup.py upload" --- Makefile | 3 ++- README.rst | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5ac4438..f5362b3 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,5 @@ test: tox pypi: - python setup.py sdist upload + python setup.py sdist + python -m twine upload dist/* diff --git a/README.rst b/README.rst index ff16f52..799447b 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ -==================== +===================== JSON log formatter 🪵 -==================== +===================== The library helps you to store logs in JSON format. Why is it important? Well, it facilitates integration with **Logstash**. From 74f04ee4f6aa8e461fcb2d688459888b7279fc73 Mon Sep 17 00:00:00 2001 From: marselester Date: Sat, 6 Jan 2024 16:20:13 -0500 Subject: [PATCH 06/14] Fix tests failing on ujson v5.9 and python v3.12 --- .github/workflows/ci.yml | 2 +- requirements.txt | 2 +- tests.py | 7 ++++--- tox.ini | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67f969e..016c8c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/requirements.txt b/requirements.txt index 1b32173..e78704f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -e . -tox==2.9.1 +tox==4.11.4 diff --git a/tests.py b/tests.py index 5823156..a532b86 100644 --- a/tests.py +++ b/tests.py @@ -58,7 +58,7 @@ def test_message_and_time_are_in_json_record_when_extra_is_blank(self): 'message', 'time', ]) - self.assertEqual(set(json_record), expected_fields) + self.assertTrue(expected_fields.issubset(json_record)) def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(self): logger.info('Sign up', extra={'fizz': 'bazz'}) @@ -68,7 +68,7 @@ def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(se 'time', 'fizz', ]) - self.assertEqual(set(json_record), expected_fields) + self.assertTrue(expected_fields.issubset(json_record)) def test_exc_info_is_logged(self): try: @@ -213,7 +213,8 @@ def test_django_wsgi_request_is_serialized_as_empty_list(self): if 'status_code' in json_record: self.assertEqual(json_record['status_code'], 500) if 'request' in json_record: - self.assertEqual(json_record['request'], []) + self.assertEqual(json_record['request']['path'], '/bogus') + self.assertEqual(json_record['request']['method'], 'BOGUS') def test_json_circular_reference_is_handled(self): d = {} diff --git a/tox.ini b/tox.ini index aae28ab..764496d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] -envlist=py27,py35,py36,py37,py38,py39,py310 +envlist=py27,py35,py36,py37,py38,py39,py310,py311,py312 [testenv] deps= pytest - ujson - simplejson + ujson==5.9.0 + simplejson==3.19.2 django commands= pytest -s tests.py From b29dc07a8b64a0b2ca5760ea05f43b1b0096f17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Sat, 6 Jan 2024 21:57:51 +0100 Subject: [PATCH 07/14] test: do not assume parent directory name --- tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index a532b86..c536d73 100644 --- a/tests.py +++ b/tests.py @@ -4,6 +4,7 @@ import unittest import logging import json +import os.path from django.core.handlers.wsgi import WSGIRequest @@ -319,7 +320,7 @@ def test_logger_name_is_test(self): def test_path_name_is_test(self): logger.error('An error has occured') json_record = json.loads(log_buffer.getvalue()) - self.assertIn('json-log-formatter/tests.py', json_record['pathname']) + self.assertIn(os.path.basename(os.path.abspath('.')) + '/tests.py', json_record['pathname']) def test_process_name_is_MainProcess(self): logger.error('An error has occured') From ffeabc8cce5f1f869682f8c561788bdc9c3cbfc8 Mon Sep 17 00:00:00 2001 From: marselester Date: Thu, 7 Mar 2024 23:36:04 -0500 Subject: [PATCH 08/14] Deprecate Python versions below 3.6 --- LICENSE | 2 +- json_log_formatter/__init__.py | 4 ++-- pyproject.toml | 7 +++---- setup.py | 4 +--- tox.ini | 6 +++--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index 01be757..5204e34 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Marsel Mavletkulov +Copyright (c) 2024 Marsel Mavletkulov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/json_log_formatter/__init__.py b/json_log_formatter/__init__.py index ac1dc4b..08fa5ec 100644 --- a/json_log_formatter/__init__.py +++ b/json_log_formatter/__init__.py @@ -1,5 +1,5 @@ import logging -from datetime import datetime +from datetime import datetime, timezone import json @@ -120,7 +120,7 @@ def json_record(self, message, extra, record): """ extra['message'] = message if 'time' not in extra: - extra['time'] = datetime.utcnow() + extra['time'] = datetime.now(timezone.utc) if record.exc_info: extra['exc_info'] = self.formatException(record.exc_info) diff --git a/pyproject.toml b/pyproject.toml index c34c6a1..26d2717 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,20 +7,19 @@ packages = ["json_log_formatter"] [project] name = "JSON-log-formatter" -version = "0.5.2" +version = "1.0" description = "JSON log formatter" readme = "README.rst" -requires-python = ">=2.7" +requires-python = ">=3.6" license = {text = "MIT"} authors = [ - {name = "Marsel Mavletkulov", email = "marselester@ya.ru"}, + {name = "Marsel Mavletkulov"}, ] classifiers=[ "License :: OSI Approved :: MIT License", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ] diff --git a/setup.py b/setup.py index 3f7d91e..83046f9 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,10 @@ setup( name='JSON-log-formatter', - version='0.5.2', + version='1.0', license='MIT', packages=['json_log_formatter'], author='Marsel Mavletkulov', - author_email='marselester@ya.ru', url='https://github.com/marselester/json-log-formatter', description='JSON log formatter', long_description=open('README.rst').read(), @@ -15,7 +14,6 @@ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries :: Python Modules' ], diff --git a/tox.ini b/tox.ini index 764496d..b60642c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] -envlist=py27,py35,py36,py37,py38,py39,py310,py311,py312 +envlist=py36,py37,py38,py39,py310,py311,py312 [testenv] deps= pytest - ujson==5.9.0 - simplejson==3.19.2 + ujson + simplejson django commands= pytest -s tests.py From eeac2e95bebb1310a81d5de4be77a5c5f0c654bc Mon Sep 17 00:00:00 2001 From: marselester Date: Mon, 30 Sep 2024 22:13:42 -0400 Subject: [PATCH 09/14] Add FlatJSONFormatter to flatten complex objects --- README.rst | 22 ++++++++ json_log_formatter/__init__.py | 33 ++++++++++++ tests.py | 95 +++++++++++++++++++++++++++++++++- 3 files changed, 149 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 799447b..e4968aa 100644 --- a/README.rst +++ b/README.rst @@ -73,6 +73,28 @@ with ``VerboseJSONFormatter``. "time": "2021-07-04T21:05:42.767726" } +If you need to flatten complex objects as strings, use ``FlatJSONFormatter``. + +.. code-block:: python + + json_handler.setFormatter(json_log_formatter.FlatJSONFormatter()) + logger.error('An error has occured') + + logger.info('Sign up', extra={'request': WSGIRequest({ + 'PATH_INFO': 'bogus', + 'REQUEST_METHOD': 'bogus', + 'CONTENT_TYPE': 'text/html; charset=utf8', + 'wsgi.input': BytesIO(b''), + })}) + +.. code-block:: json + + { + "message": "Sign up", + "time": "2024-10-01T00:59:29.332888+00:00", + "request": "" + } + JSON libraries -------------- diff --git a/json_log_formatter/__init__.py b/json_log_formatter/__init__.py index 08fa5ec..33d318c 100644 --- a/json_log_formatter/__init__.py +++ b/json_log_formatter/__init__.py @@ -1,4 +1,5 @@ import logging +from decimal import Decimal from datetime import datetime, timezone import json @@ -204,3 +205,35 @@ def json_record(self, message, extra, record): extra['thread'] = record.thread extra['threadName'] = record.threadName return super(VerboseJSONFormatter, self).json_record(message, extra, record) + + +class FlatJSONFormatter(JSONFormatter): + """Flat JSON log formatter ensures that complex objects are stored as strings. + + Usage example:: + + logger.info('Sign up', extra={'request': WSGIRequest({ + 'PATH_INFO': 'bogus', + 'REQUEST_METHOD': 'bogus', + 'CONTENT_TYPE': 'text/html; charset=utf8', + 'wsgi.input': BytesIO(b''), + })}) + + The log file will contain the following log record (inline):: + + { + "message": "Sign up", + "time": "2024-10-01T00:59:29.332888+00:00", + "request": "" + } + + """ + + keep = (bool, int, float, Decimal, complex, str, datetime) + + def json_record(self, message, extra, record): + extra = super(FlatJSONFormatter, self).json_record(message, extra, record) + return { + k: v if v is None or isinstance(v, self.keep) else str(v) + for k, v in extra.items() + } diff --git a/tests.py b/tests.py index c536d73..b2012d7 100644 --- a/tests.py +++ b/tests.py @@ -17,7 +17,7 @@ except ImportError: from io import StringIO -from json_log_formatter import JSONFormatter, VerboseJSONFormatter +from json_log_formatter import JSONFormatter, VerboseJSONFormatter, FlatJSONFormatter log_buffer = StringIO() json_handler = logging.StreamHandler(log_buffer) @@ -336,3 +336,96 @@ def test_stack_info_is_none(self): logger.error('An error has occured') json_record = json.loads(log_buffer.getvalue()) self.assertIsNone(json_record['stack_info']) + + +class FlatJSONFormatterTest(TestCase): + def setUp(self): + json_handler.setFormatter(FlatJSONFormatter()) + + def test_given_time_is_used_in_log_record(self): + logger.info('Sign up', extra={'time': DATETIME}) + expected_time = '"time": "2015-09-01T06:09:42.797203"' + self.assertIn(expected_time, log_buffer.getvalue()) + + def test_current_time_is_used_by_default_in_log_record(self): + logger.info('Sign up', extra={'fizz': 'bazz'}) + self.assertNotIn(DATETIME_ISO, log_buffer.getvalue()) + + def test_message_and_time_are_in_json_record_when_extra_is_blank(self): + logger.info('Sign up') + json_record = json.loads(log_buffer.getvalue()) + expected_fields = set([ + 'message', + 'time', + ]) + self.assertTrue(expected_fields.issubset(json_record)) + + def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(self): + logger.info('Sign up', extra={'fizz': 'bazz'}) + json_record = json.loads(log_buffer.getvalue()) + expected_fields = set([ + 'message', + 'time', + 'fizz', + ]) + self.assertTrue(expected_fields.issubset(json_record)) + + def test_exc_info_is_logged(self): + try: + raise ValueError('something wrong') + except ValueError: + logger.error('Request failed', exc_info=True) + json_record = json.loads(log_buffer.getvalue()) + self.assertIn( + 'Traceback (most recent call last)', + json_record['exc_info'] + ) + + def test_builtin_types_are_serialized(self): + logger.log(level=logging.ERROR, msg='Payment was sent', extra={ + 'first_name': 'bob', + 'amount': 0.00497265, + 'context': { + 'tags': ['fizz', 'bazz'], + }, + 'things': ('a', 'b'), + 'ok': True, + 'none': None, + }) + + json_record = json.loads(log_buffer.getvalue()) + self.assertEqual(json_record['first_name'], 'bob') + self.assertEqual(json_record['amount'], 0.00497265) + self.assertEqual(json_record['context'], "{'tags': ['fizz', 'bazz']}") + self.assertEqual(json_record['things'], "('a', 'b')") + self.assertEqual(json_record['ok'], True) + self.assertEqual(json_record['none'], None) + + def test_decimal_is_serialized_as_string(self): + logger.log(level=logging.ERROR, msg='Payment was sent', extra={ + 'amount': Decimal('0.00497265') + }) + expected_amount = '"amount": "0.00497265"' + self.assertIn(expected_amount, log_buffer.getvalue()) + + def test_django_wsgi_request_is_serialized_as_dict(self): + request = WSGIRequest({ + 'PATH_INFO': 'bogus', + 'REQUEST_METHOD': 'bogus', + 'CONTENT_TYPE': 'text/html; charset=utf8', + 'wsgi.input': BytesIO(b''), + }) + + logger.log(level=logging.ERROR, msg='Django response error', extra={ + 'status_code': 500, + 'request': request, + 'dict': { + 'request': request, + }, + 'list': [request], + }) + json_record = json.loads(log_buffer.getvalue()) + self.assertEqual(json_record['status_code'], 500) + self.assertEqual(json_record['request'], "") + self.assertEqual(json_record['dict'], "{'request': }") + self.assertEqual(json_record['list'], "[]") From f8d79df935f82b068611e6e01ff1e0577b92ce19 Mon Sep 17 00:00:00 2001 From: marselester Date: Tue, 1 Oct 2024 21:09:04 -0400 Subject: [PATCH 10/14] Bump version to 1.1 --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26d2717..cfb46b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ packages = ["json_log_formatter"] [project] name = "JSON-log-formatter" -version = "1.0" +version = "1.1" description = "JSON log formatter" readme = "README.rst" requires-python = ">=3.6" diff --git a/setup.py b/setup.py index 83046f9..6cd6c89 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='JSON-log-formatter', - version='1.0', + version='1.1', license='MIT', packages=['json_log_formatter'], author='Marsel Mavletkulov', From 369a6336a8d9ab830a7b08ddee579885ff145e9a Mon Sep 17 00:00:00 2001 From: Andrii Yurchuk Date: Mon, 4 Nov 2024 20:49:22 +0100 Subject: [PATCH 11/14] Add taskName to BUILTIN_ATTRS set `taskName` is a new attribute of `LogRecord`, that was added in Python 3.12. See the [doc](https://docs.python.org/3/library/logging.html#logrecord-attributes) --- json_log_formatter/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/json_log_formatter/__init__.py b/json_log_formatter/__init__.py index 33d318c..6e0be3d 100644 --- a/json_log_formatter/__init__.py +++ b/json_log_formatter/__init__.py @@ -25,6 +25,7 @@ 'processName', 'relativeCreated', 'stack_info', + 'taskName', 'thread', 'threadName', } From 7b15ab338aea4738c34f786b5ee737be04b82670 Mon Sep 17 00:00:00 2001 From: marselester Date: Thu, 27 Feb 2025 17:31:56 -0500 Subject: [PATCH 12/14] Bump version to 1.1.1 --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cfb46b2..3394697 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ packages = ["json_log_formatter"] [project] name = "JSON-log-formatter" -version = "1.1" +version = "1.1.1" description = "JSON log formatter" readme = "README.rst" requires-python = ">=3.6" diff --git a/setup.py b/setup.py index 6cd6c89..71f3ae5 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='JSON-log-formatter', - version='1.1', + version='1.1.1', license='MIT', packages=['json_log_formatter'], author='Marsel Mavletkulov', From 1505b75a76e77921bf02c4a22333b18828c422bc Mon Sep 17 00:00:00 2001 From: marselester Date: Thu, 27 Feb 2025 18:07:55 -0500 Subject: [PATCH 13/14] Deprecate Python versions below 3.9 --- .github/workflows/ci.yml | 6 +++--- LICENSE | 2 +- pyproject.toml | 4 ++-- setup.py | 2 +- tox.ini | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 016c8c4..ee4488d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/LICENSE b/LICENSE index 5204e34..d23ebf0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Marsel Mavletkulov +Copyright (c) 2025 Marsel Mavletkulov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pyproject.toml b/pyproject.toml index 3394697..436d913 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ packages = ["json_log_formatter"] [project] name = "JSON-log-formatter" -version = "1.1.1" +version = "1.2" description = "JSON log formatter" readme = "README.rst" -requires-python = ">=3.6" +requires-python = ">=3.9" license = {text = "MIT"} authors = [ {name = "Marsel Mavletkulov"}, diff --git a/setup.py b/setup.py index 71f3ae5..63e922c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='JSON-log-formatter', - version='1.1.1', + version='1.2', license='MIT', packages=['json_log_formatter'], author='Marsel Mavletkulov', diff --git a/tox.ini b/tox.ini index b60642c..64abe5f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py36,py37,py38,py39,py310,py311,py312 +envlist=py39,py310,py311,py312,py313 [testenv] deps= From 223cf3d2d1fa8052cdf4e1e37ef4e7a7debbd409 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sat, 1 Mar 2025 15:53:23 +0000 Subject: [PATCH 14/14] build and publish wheels --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f5362b3..4226fb8 100644 --- a/Makefile +++ b/Makefile @@ -2,5 +2,5 @@ test: tox pypi: - python setup.py sdist + python -m build python -m twine upload dist/*