Skip to content

Commit

Permalink
Add support of Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapiitao committed Jul 18, 2023
1 parent a31956f commit 07314f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

runs-on: ubuntu-20.04
steps:
Expand Down
6 changes: 3 additions & 3 deletions daiquiri/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ def format(self, record: logging.LogRecord) -> str:
return s


class DatadogFormatter(jsonlogger.JsonFormatter): # type: ignore[misc]
class DatadogFormatter(jsonlogger.JsonFormatter):
def __init__(self) -> None:
super(DatadogFormatter, self).__init__(timestamp=True)
super(DatadogFormatter, self).__init__(timestamp=True) # type: ignore

def add_fields(
self,
Expand All @@ -183,5 +183,5 @@ def add_fields(


TEXT_FORMATTER = ColorExtrasFormatter(fmt=DEFAULT_EXTRAS_FORMAT)
JSON_FORMATTER = jsonlogger.JsonFormatter()
JSON_FORMATTER = jsonlogger.JsonFormatter() # type: ignore
DATADOG_FORMATTER = DatadogFormatter()
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ classifier =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12

[options]
install_requires =
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[tox]
envlist = py37,py38,py39,p310,pep8,docs
envlist = py37,py38,py39,p310,py311,py312,pep8,docs

[testenv]
whitelist_externals = sh
allowlist_externals = sh
deps = -e.[test]
commands =
pytest {posargs}
sh -c "for example in examples/*.py; do python $example; done"
sh -c "rm errors.log everything.log"

[testenv:pep8]
basepython = python3.10
basepython = python3.12
deps =
{[testenv]deps}
black
Expand All @@ -37,4 +37,4 @@ ignore = E203,E501,W503,E231,A003,D101,D102,D103,D104,D105,D107,A003,D100

[testenv:docs]
deps = sphinx
commands = python setup.py build_sphinx
commands = sphinx-build -b html doc/source doc/build/html

0 comments on commit 07314f2

Please sign in to comment.