diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..df4d15b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3903639..7e9efe8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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') }} @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d2847e..e449a03 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9986747..223a46e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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", @@ -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 diff --git a/requirements.txt b/requirements.txt index ffb93ca..43957b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/haproxy/line.py b/src/haproxy/line.py index eb502a8..95405ac 100644 --- a/src/haproxy/line.py +++ b/src/haproxy/line.py @@ -2,7 +2,6 @@ import re - # Example log line, to understand the regex below (truncated to fit into # 80 chars): # diff --git a/src/haproxy/utils.py b/src/haproxy/utils.py index 4b6f0b6..87331ae 100644 --- a/src/haproxy/utils.py +++ b/src/haproxy/utils.py @@ -3,7 +3,6 @@ import re - DELTA_REGEX = re.compile(r'\A(?P\d+)(?P[smhd])\Z') START_REGEX = re.compile( diff --git a/tests/conftest.py b/tests/conftest.py index 2b6e88d..8726b1c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,6 @@ import pytest - DEFAULT_DATA = { 'syslog_date': 'Dec 9 13:01:26', 'process_name_and_pid': 'localhost haproxy[28029]:', @@ -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( @@ -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 diff --git a/tests/test_log_line.py b/tests/test_log_line.py index add9ed4..8cfffaf 100644 --- a/tests/test_log_line.py +++ b/tests/test_log_line.py @@ -3,7 +3,6 @@ import pytest - NOW = datetime.now() TWO_DAYS_AGO = NOW - timedelta(days=2) IN_TWO_DAYS = NOW + timedelta(days=2) diff --git a/tests/test_main.py b/tests/test_main.py index c6f5c71..c6e12bc 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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 { diff --git a/tox.ini b/tox.ini index 78e689e..c98c6d6 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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