[systemd-devel] Fwd: make pystemd part of systemd repo.

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Aug 17 16:24:34 UTC 2022


[I misplaced the original mail, so I'm replying to a forward.
Apologies if threading is broken.]

> What do we propose to do?
> -----
> 
> We want to bring pystemd[1] into the systemd organization, and merge
> (functionality wise) with python-systemd[2], so that there is a single
> Python library, supported by the systemd community, that interacts
> with the systemd API.

In short, you propose to subsume bring pystemd under the systemd org
umbrella and to subsume python-systemd functionality into pystemd.
I think this makes the most sense.

> systemd has a Python library already under the organization:
> python-systemd. This library does some interesting stuff with the
> journal (my personal favorite is creating a Python logger that talks
> directly with the journal, kudos to whoever did that!).

Marti Raudsepp, 603876167a7ea78d0a71d70766f65979618ca423.
 
> But in my honest opinion, this library is missing some core
> functionality to interact with systemd: the service manager,
> start/stop/interaction with Units, create ephemeral units, etc. At
> Meta (the company formerly known as Facebook) we created a python
> library that does that… among other things.

The functionality in python-systemd is fairly cleanly split between
the python frontent, and the the C backend which is a thin wrapper
around libsystemd. When pystemd functions replace the backend, it
should be possible to move the higher-level code without minimal
changes.

> with Unit(b'postfix.service') as unit:
>    if unit.Unit.ActiveState == b"active":
>        unit.Unit.Stop(b'replace')

Not that it matters for this discussion, but what with all those b''
prefixes? systemd itself doesn't do non-unicode, so it should all be
trivially translatable to and from str.

> How do we propose to do this?
> -----
> 
> Preliminary plan (of course we are open to any suggestions) look like this:
> 
> 1. We move pystemd repo [1] into the systemd org, something like
> https://github.com/systemd/pystemd
> 2. People with commit access to this repo (Davide, Anita and me) would
> remain having commit access to this repo, and whoever has access to
> the python-systemd repo [2] would be added here.
> 3. We merge all features of python-systemd (that are not in pystemd
> yet) into pystemd, this will probably mean re-writing most of those
> features. Development would be done by mostly me, with code review and
> from hopefully as close to the original authors as possible… Basically
> I don't want to be disrespectful of python-systemd.

This sounds all good.

> 4. If we want to keep the name python-systemd (and the import
> namespace of systemd) we can rename the repo as python-systemd, if we
> want to keep pystemd as the name of the package and the import
> namespace, we can make python-systemd as “a link” to pystemd
> 5. Whatever we decide on the last point, we cut the version 1.0.0 of
> pystemd, or the next version of python-systemd. And we let the new era
> of Python bindings start!

I'd keep the names as they are. Renames create confusion, and I think
everything will be easier if we keep the original names and keep
things parallel-installable.

Thank you for doing this.

Zbyszek


More information about the systemd-devel mailing list