diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e54a5f..c0b1b70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,12 +15,12 @@ jobs: strategy: matrix: # only use oldest and newest version for the lint step - python-version: ["3.9", "3.11"] + python-version: ["3.10", "3.14"] steps: - id: checkout-code - uses: actions/checkout@v2 + uses: actions/checkout@v6 - id: system-dependencies run: | @@ -28,7 +28,7 @@ jobs: sudo apt-get install -y libsystemd-dev libsnappy-dev - id: prepare-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -47,11 +47,11 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.9", "3.11"] + python-version: ["3.10", "3.14"] steps: - id: checkout-code - uses: actions/checkout@v2 + uses: actions/checkout@v6 - id: system-dependencies run: | @@ -59,7 +59,7 @@ jobs: sudo apt-get install -y libsystemd-dev libsnappy-dev - id: prepare-python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -77,7 +77,7 @@ jobs: run: make systest - id: upload-codecov - # Third-party action pinned to v2.1.0 - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b + # Third-party action pinned to v5.5.2 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de with: verbose: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e933381..17f0b75 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,11 +40,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v6 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -55,7 +55,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v4 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -69,4 +69,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ac50fb..988269d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -10,7 +10,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 26.3.0 hooks: - id: black - repo: local @@ -21,7 +21,7 @@ repos: language: system types: [python] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.960 + rev: v1.19.1 hooks: - id: mypy args: [--ignore-missing-imports] diff --git a/.pylintrc b/.pylintrc index 2f2612b..53d7245 100644 --- a/.pylintrc +++ b/.pylintrc @@ -31,3 +31,4 @@ reports=no [TYPECHECK] ignored-classes=responses +ignored-modules=re2 diff --git a/journalpump/__init__.py b/journalpump/__init__.py index 59ad602..fc2597b 100644 --- a/journalpump/__init__.py +++ b/journalpump/__init__.py @@ -3,4 +3,5 @@ # This file is under the Apache License, Version 2.0. # See the file `LICENSE` for details. """journalpump""" + __version__ = "2.5.0" diff --git a/journalpump/daemon.py b/journalpump/daemon.py index b1129db..840feff 100644 --- a/journalpump/daemon.py +++ b/journalpump/daemon.py @@ -6,6 +6,7 @@ Common Daemon functionality """ + from systemd import daemon, journal import json diff --git a/mypy.ini b/mypy.ini index 3505247..41ca336 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.7 +python_version = 3.10 ignore_missing_imports = True diff --git a/requirements.dev.txt b/requirements.dev.txt index fb4ba67..ef2c4ca 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -15,4 +15,3 @@ coverage coveralls pre-commit responses -unify diff --git a/requirements.txt b/requirements.txt index eb4a9b0..3f9fbe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,4 @@ google-api-python-client google-auth geoip2 https://github.com/systemd/python-systemd/zipball/master -google-re2<1.1.20251105 +google-re2<1.1.20251105; python_version < "3.14" diff --git a/scripts/generate_logs.py b/scripts/generate_logs.py index 5a13a3e..dd3f25b 100644 --- a/scripts/generate_logs.py +++ b/scripts/generate_logs.py @@ -69,7 +69,7 @@ def __init__(self, *, logs_dir: pathlib.Path, uid: int) -> None: self._runtime_dir: Optional[pathlib.Path] = None self._journald_process: Optional[subprocess.Popen] = None self._sender_process: Optional[multiprocessing.Process] = None - self._sender_queue: multiprocessing.Queue = multiprocessing.JoinableQueue() + self._sender_queue: multiprocessing.JoinableQueue = multiprocessing.JoinableQueue() self._uid = uid @property @@ -157,8 +157,7 @@ def __exit__(self, *args) -> None: shutil.rmtree(self._runtime_dir) -_PARSER = argparse.ArgumentParser( - usage="""Genrate journald log files. +_PARSER = argparse.ArgumentParser(usage="""Genrate journald log files. This program reads messages from stdin in following format msg Test 1 @@ -168,8 +167,7 @@ def __exit__(self, *args) -> None: msg command argument be either plain message or json object rotate command invokes journald rotation -""" -) +""") _PARSER.add_argument("--uid", type=int, default=1000, help="user id of log sender") diff --git a/setup.py b/setup.py index 1fd4722..9353d30 100644 --- a/setup.py +++ b/setup.py @@ -32,8 +32,10 @@ "Intended Audience :: Developers", "Topic :: System :: Logging", "License :: OSI Approved :: Apache Software License", - "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", ], )