Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "pypy-3.9"]
python-version: ["3.14", "3.13", "3.12", "3.11", "pypy-3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Cache packages
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }}
Expand All @@ -36,15 +36,15 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
python-version: [3.14]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Cache packages
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: |
~/.cache/pre-commit
Expand Down
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.14.0
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py311-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 9.0.0a3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -32,20 +32,20 @@ repos:
- flake8-pytest-style

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
rev: "0.51"
hooks:
- id: check-manifest
- repo: https://github.com/regebro/pyroma
rev: "4.2"
rev: "5.0.1"
hooks:
- id: pyroma
- repo: https://github.com/mgedmin/check-python-versions
rev: "0.21.3"
rev: "0.24.2"
hooks:
- id: check-python-versions
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Analayze HAProxy log files"
keywords = ["haproxy", "log", "sysadmin", "devops", "report" ]
license = {file = "LICENSE"}
readme = "README.rst"
requires-python = ">=3.8"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -22,11 +22,10 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: Log Analysis",
Expand All @@ -44,5 +43,5 @@ haproxy_log_analysis = "haproxy.main:console_script"
profile = "plone"

[tool.black]
target-version = ["py38"]
target-version = ["py311"]
skip-string-normalization = true
32 changes: 12 additions & 20 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# pip-compile requirements.in
# pip-compile --no-index requirements.in
#
attrs==22.1.0
coverage[toml]==7.15.4
# via pytest-cov
iniconfig==2.3.0
# via pytest
coverage[toml]==6.5.0
packaging==26.3
# via pytest
pluggy==1.6.0
# via
# coverage
# pytest
# pytest-cov
exceptiongroup==1.1.3
# via pytest
iniconfig==1.1.1
# via pytest
packaging==21.3
pygments==2.21.0
# via pytest
pluggy==1.0.0
# via pytest
pyparsing==3.0.9
# via packaging
pytest==7.2.0
pytest==9.1.1
# via
# -r requirements.in
# pytest-cov
pytest-cov==4.0.0
pytest-cov==7.1.0
# via -r requirements.in
tomli==2.0.1
# via
# coverage
# pytest
1 change: 0 additions & 1 deletion src/haproxy/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import re


# Example log line, to understand the regex below (truncated to fit into
# 80 chars):
#
Expand Down
1 change: 0 additions & 1 deletion src/haproxy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import re


DELTA_REGEX = re.compile(r'\A(?P<value>\d+)(?P<time_unit>[smhd])\Z')

START_REGEX = re.compile(
Expand Down
11 changes: 5 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pytest


DEFAULT_DATA = {
'syslog_date': 'Dec 9 13:01:26',
'process_name_and_pid': 'localhost haproxy[28029]:',
Expand Down Expand Up @@ -42,9 +41,9 @@ def __call__(self, *args, **kwargs):
self.data['client_ip_and_port'] = '{client_ip}:{client_port}'.format(
**self.data
)
self.data[
'server_names'
] = '{frontend_name} {backend_name}/{server_name}'.format(**self.data)
self.data['server_names'] = (
'{frontend_name} {backend_name}/{server_name}'.format(**self.data)
)
self.data['timers'] = '{tq}/{tw}/{tc}/{tr}/{tt}'.format(**self.data)
self.data['status_and_bytes'] = '{status} {bytes}'.format(**self.data)
self.data['connections_and_retries'] = '{act}/{fe}/{be}/{srv}/{retries}'.format(
Expand All @@ -56,12 +55,12 @@ def __call__(self, *args, **kwargs):
return Line(log_line)


@pytest.fixture()
@pytest.fixture
def default_line_data():
return DEFAULT_DATA


@pytest.fixture()
@pytest.fixture
def line_factory():
# queues and headers parameters are together because if no headers are
# saved the field is completely empty and thus there is no double space
Expand Down
1 change: 0 additions & 1 deletion tests/test_log_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pytest


NOW = datetime.now()
TWO_DAYS_AGO = NOW - timedelta(days=2)
IN_TWO_DAYS = NOW + timedelta(days=2)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import pytest
import sys


PY310_OR_HIGHER = sys.version_info[1] > 9


@pytest.fixture()
@pytest.fixture
def default_arguments():
"""Return all the expected arguments the main function expects."""
return {
Expand Down
12 changes: 5 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ envlist =
format
lint
coverage
py38
py39
py310
py311
py312
py313
py314
pypy3

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
3.14: py314

[testenv]
description = run the distribution tests
Expand Down Expand Up @@ -58,7 +56,7 @@ commands =

[testenv:generate-constrains]
description = update the constrains.txt file
basepython = python3.8
basepython = python3.11
skip_install = true
deps =
pip-tools
Expand Down