Commit graph

396 commits

Author SHA1 Message Date
Nguyễn Hồng Quân
2653d19fc7 Drop Python 3.7 and 3.8 2025-06-30 22:39:06 +07:00
Nguyễn Hồng Quân
31b17c0b29 Adopt pyproject.toml and Meson to build Python extension 2025-06-30 18:58:20 +07:00
Zbigniew Jędrzejewski-Szmek
9031424234 docs: update intersphinx_mapping
Newer sphinx doesn't like the old syntax:
  Running Sphinx v8.1.3
  loading translations [en]... done
  making output directory... done
  Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`.
  ERROR: Invalid value `None` in intersphinx_mapping['http://docs.python.org/']. Expected a two-element tuple or list.
2025-01-19 16:59:22 +01:00
Eric T. Johnson
3f0801c8ac Fix test failure
One usage of `connection_error` got missed when dropping Python 2 support.
2023-03-26 17:09:46 +02:00
Jelle van der Waa
684a6cc222 README: stop mentioning Python 2 build dependencies
Python 2 support was fully dropped in 802c8dcaa3 so it can
be a bit confusing to advertise Python 2 build dependencies in the
README.
2023-03-26 17:08:44 +02:00
Guiorgy
f95161fccd fixed PyPI url in last commit 2023-03-04 13:01:11 +01:00
Joerg Behrmann
802c8dcaa3 treewide: remove python 2 support and assume we have python 3.3+ 2023-02-11 14:39:52 +01:00
Zbigniew Jędrzejewski-Szmek
7e3313a15b
Merge pull request #123 from Guiorgy/patch-1
Update README.md
2023-02-11 14:39:12 +01:00
Guiorgy
9267af36d8
Update README.md
Moved pypi instructions under the Installation heading and added a pypi badge
2023-02-06 19:49:12 +04:00
Frantisek Sumsal
263dc92d55 ci: use CodeQL instead of LGTM
As LGTM is going to be shut down by EOY[0], let's move the code scanning to
CodeQL as recommended. Thanks to GH integration the results from such
scans will be shown both in the respective PR and in the Security ->
Code Scanning tab[1].

[0] https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/
[1] https://github.com/systemd/python-systemd/security/code-scanning
2022-09-22 13:13:56 +02:00
Zbigniew Jędrzejewski-Szmek
661ee278e8
Merge pull request #119 from keszybz/sd128-tests
tests: check for errnos that sd_id128_get_machine actually returns
2022-08-17 13:16:28 +02:00
Zbigniew Jędrzejewski-Szmek
4bba47da39 ci: drop instantiation of machine-id
Now the tests should pass without it.
2022-08-17 12:19:24 +02:00
Zbigniew Jędrzejewski-Szmek
8f84fbe8c2 tests: check for errnos that sd_id128_get_machine actually returns
Fixes #118.
2022-08-17 12:17:57 +02:00
Zbigniew Jędrzejewski-Szmek
dc1dae2eaa Version 235 v235
Fixes #76.
2022-08-16 15:50:06 +02:00
Zbigniew Jędrzejewski-Szmek
8360d1d01c
Merge pull request #117 from keszybz/python2-compat
Compat with python2
2022-08-16 12:20:44 +02:00
Zbigniew Jędrzejewski-Szmek
c5f8b887be NEWS: say that we'll drop support for python2 soon
I think it's nicer to make one last release with the remaining code
for python2 in place.
2022-08-16 11:03:09 +02:00
Zbigniew Jędrzejewski-Szmek
cc03ed6d20 tests: simplify imports
'import foo as _foo' is useful in exported modules to avoid 'foo' being
present in the public API. No need to play that game in test code.
2022-08-16 11:03:09 +02:00
Zbigniew Jędrzejewski-Szmek
ba9d9f8910 tests: python2-compat in another place 2022-08-16 11:03:09 +02:00
Zbigniew Jędrzejewski-Szmek
872ce304a0 journal: fix compatibility with python2
This is a lazy workaround: 4c9a241949
is amended to do nothing on python2, so we have the same issue that
was present before. This allows the code to execute, and hopefully
almost nobody is using python2 code anyway.

f868a56b93 is amended in the same way.
For python2 code we have the same lack of timezone-awareness as before.

This allows the tests to pass under python 2.7.
2022-08-16 11:03:09 +02:00
Zbigniew Jędrzejewski-Szmek
6320847472
Merge pull request #92 from chrismullins/support-realtime-cutoff
Support realtime cutoff access
2022-08-16 09:55:39 +02:00
Zbigniew Jędrzejewski-Szmek
8b92ac57d6
Merge pull request #114 from keszybz/install-docs
Update/clean-up installation instructions
2022-08-16 09:44:26 +02:00
Frantisek Sumsal
fe4450ee3e ci: run CIs on push events as well
Let's cover merges into main with CIs too.
2022-08-15 21:42:32 +00:00
Zbigniew Jędrzejewski-Szmek
65b1c19258 README: apt-get → apt
Based on Jörg Behrmann's comment:
https://github.com/systemd/python-systemd/pull/114#discussion_r945896280
> apt is available in the stretch, which is the oldest listed [1] release for it
> and stretch has already ended LTS support.

[1] https://packages.debian.org/bullseye/apt
2022-08-15 19:29:28 +02:00
Zbigniew Jędrzejewski-Szmek
05773b4548 README: drop distro instructions for python2, drop epel/rhel
Fedora has no python2 package, so drop that.
Similarly, with latest Debian and Opensuse, 'apt-get install
python3-systemd' works, but 'apt-get install python-systemd' doesn't.

(Tested with
podman run -it --rm debian apt-get install python3-systemd
mock -r opensuse-tumbleweed-x86_64 --enable-network -i python3-systemd)

It also seems we never built the package in EPEL, so let's drop
RHEL/CentOS from the list.

If people need to, they can install from sources where the distro
packages are unavailable (and they shouldn't be using python2 anyway
at this point.)

Also add 'apt-get update' into the instructions because w/o that
install does not work in a pristine container.

Fixes #78.
2022-08-15 17:50:38 +02:00
Zbigniew Jędrzejewski-Szmek
d361f0bfa5 Update constants for systemd 251 2022-08-15 16:59:02 +02:00
Zbigniew Jędrzejewski-Szmek
e261fc0a7e README: markup and line wrapping
Bash doesn't do anything special for a command with '#', but at least
zsh treat it as a comment. It's better to quote such a commandline.
2022-08-15 16:56:40 +02:00
Zbigniew Jędrzejewski-Szmek
8659af2179 README: fix installation urls
pip3 install says:
WARNING: Discarding git+https://github.com/systemd/python-systemd.git#egg=systemd. Requested systemd-python from git+https://github.com/systemd/python-systemd.git#egg=systemd has inconsistent name: filename has 'systemd', but metadata has
 'systemd-python'

Closes #97.
2022-08-15 16:56:40 +02:00
Zbigniew Jędrzejewski-Szmek
75066b51aa
Merge pull request #111 from keszybz/setuptools-compat
make: fix compat with setuptools >= 61
2022-08-13 21:27:47 +02:00
Zbigniew Jędrzejewski-Szmek
23b329d253 ci: add 3.11 to the test matrix 2022-08-13 21:18:52 +02:00
Zbigniew Jędrzejewski-Szmek
09053a2139 make: fix compat with setuptools >= 61
Fixes #110.
2022-08-13 20:56:48 +02:00
Samuel BF
f868a56b93 Adding timezone information to datetimes from systemd-journal 2022-08-13 19:34:51 +02:00
Andrew Stone
1abac3cfec reader: Fix use of potentially uninitialized value 2022-08-13 17:03:30 +02:00
Tim Orling
44f7d19536 setup.py: switch from distutils to setuptools
In Python 3.10, distutils is deprecated and slated for removal in Python
3.12. It also prevents 'setup.py bdist_wheel' from building a wheel.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-08-13 17:02:37 +02:00
Zbigniew Jędrzejewski-Szmek
04ee44d230
Merge pull request #104 from systemd/ci-shenanigans
ci: move the CI to GitHub Actions
2022-08-13 16:57:31 +02:00
Dan Bungert
671dc03e06 Update news since 234 2022-08-13 16:48:32 +02:00
Federico Ceratto
21d9b1664d Set unit name in JournalHandler example, see #74 2022-08-13 16:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
e6b457fb1e
Merge pull request #91 from chrismullins/journal-examples
Journal examples
2022-08-13 16:46:20 +02:00
Architector #4
b109b7587d fix a mistype in README.md
"libsytemd" should obviously be "libsystemd"
2022-06-23 21:07:39 +02:00
Frantisek Sumsal
884a43eb2e ci: introduce a simple install test 2022-04-14 13:10:36 +02:00
Frantisek Sumsal
720d3cb738 ci: move the CI to GitHub Actions 2022-04-14 13:09:54 +02:00
Frantisek Sumsal
76e7478a34 Makefile: accept $SPHINXOPTS from the outside 2022-03-06 19:25:47 +01:00
Chris Mullins
d6b3af95f5 Pass NULL for unnecessary timestamps 2021-01-03 01:34:48 +00:00
Chris Mullins
9bb147c26b Add support for sd_journal_get_cutoff_realtime_usec wrapper 2021-01-03 01:22:22 +00:00
Chris Mullins
1088520535 Add link to journal fields docs 2021-01-02 23:12:15 +00:00
Chris Mullins
1532b67c51 Add journalctl example for ring buffer 2021-01-02 23:07:49 +00:00
Chris Mullins
86ad413dfc Add some examples 2021-01-02 23:05:35 +00:00
Glandos
2166b5759c journal: remove ChainMap
"after some quick testing, the execution time got halved (32-ish
seconds to 16-ish seconds) when going through all journal entries."

Closes #63.
2020-11-12 19:19:47 +01:00
Alexander Olekhnovich
9cbc4e93b4 journal: add namespace support
Add log namespace support which is added since systemd v245
2020-11-12 19:10:13 +01:00
Tamaki Nishino
5dd8afda3e journal: allow JournalHandler constructor to be called with args in a positional param
This change enables to add extra fields to JournalHandler in a
configuration file loaded by `logging.config.fileConfig`, which only allows positional
parameters:

class=systemd.journal.JournalHandler
args={'level': INFO, 'SYSLOG_IDENTIFIER': 'my-cool-app'}

[zj: originally the patch added a new positional parameter to
__init__(), but that is not backwards compatible. So I added a new
classmethod to allow the positional parameters to be passed.]
2020-11-12 19:05:37 +01:00
Zbigniew Jędrzejewski-Szmek
397dec7411 test: make sure $NOTIFY_SOCKET is unset in test
When running the tests in Fedora's mock, the test would
fail because NOTIFY_SOCKET is set to /run/systemd/nspawn/notify, and
we get a permission error.
2020-11-12 17:20:05 +01:00