systemd / pystemd

A thin Cython-based wrapper on top of libsystemd, focused on exposing the dbus API via sd-bus in an automated and easy to consume way.
GNU Lesser General Public License v2.1
414 stars 36 forks source link

typestubs no longer in 0.13.x #85

Closed antdking closed 1 year ago

antdking commented 1 year ago

Lost editor hints for modules like dbuslib, as the .pyi files are no longer included

pystemd/systemd1/*.pyi files still appear intact, it's just pystemd/*.pyi that's missin.

https://github.com/systemd/pystemd/blob/53662f0b6a00ab7f94416ef9a07d19346e49ce9b/setup.py#L73

This line likely needs glob(..., recursive=True), so that ** includes the base directory and not just child directories.

aleivag commented 1 year ago

Thanks for reporting this, this feels clowny... glob.glob works different as pathlib.Path.glob ....

>>> [*pathlib.Path().glob("pystemd/**/*.pyi")]
[PosixPath('pystemd/__init__.pyi'), PosixPath('pystemd/daemon.pyi'), PosixPath('pystemd/dbuslib.pyi'), PosixPath('pystemd/base.pyi'), PosixPath('pystemd/systemd1/manager.pyi'), PosixPath('pystemd/systemd1/unit.pyi')]
>>> glob.glob("pystemd/**/*.pyi")
['pystemd/systemd1/manager.pyi', 'pystemd/systemd1/unit.pyi']

i'll fix and submit a new version

aleivag commented 1 year ago

has this PR (https://github.com/systemd/pystemd/pull/86) I think it fix the issue... also, I want to get rid of typestubs and just have them in code

antdking commented 1 year ago

Confirmed working in 0.13.2, thanks