Skip to content

chore: replace legacy vendored operator-libs-linux with PyPI charmlibs packages#121

Open
jansdhillon wants to merge 2 commits intocanonical:mainfrom
jansdhillon:chore/replace-vendored-operator-libs-linux
Open

chore: replace legacy vendored operator-libs-linux with PyPI charmlibs packages#121
jansdhillon wants to merge 2 commits intocanonical:mainfrom
jansdhillon:chore/replace-vendored-operator-libs-linux

Conversation

@jansdhillon
Copy link
Copy Markdown
Contributor

@jansdhillon jansdhillon commented Apr 22, 2026

Description of changes

Replaces three vendored charm libraries under lib/charms/operator_libs_linux/ with their published PyPI equivalents:

Vendored file PyPI package New import
lib/charms/operator_libs_linux/v0/apt.py charmlibs-apt==1.0.0.post0 from charmlibs import apt
lib/charms/operator_libs_linux/v0/passwd.py charmlibs-passwd==1.0.1 from charmlibs.passwd import ...
lib/charms/operator_libs_linux/v1/systemd.py charmlibs-systemd==1.0.0 from charmlibs.systemd import ...

All public APIs are identical (PackageError, PackageNotFoundError, DebianPackage, PackageState, group_exists, user_exists, daemon_reload, service_pause, service_reload, service_resume, service_running, SystemdError).

The remaining vendored libs (data_platform_libs, grafana_agent, haproxy) have no PyPI equivalents yet and remain unchanged.

Rationale

Vendored libraries are static snapshots that require manual updates. PyPI packages are versioned and can be updated via standard dependency management tools (renovate, uv lock --upgrade-package).

https://documentation.ubuntu.com/charmlibs/how-to/manage-libraries/

jansdhillon and others added 2 commits April 22, 2026 12:42
Replace three vendored charm libraries under lib/charms/operator_libs_linux/
with their published PyPI equivalents:

- lib/charms/operator_libs_linux/v0/apt.py → charmlibs-apt==1.0.0.post0
- lib/charms/operator_libs_linux/v0/passwd.py → charmlibs-passwd==1.0.1
- lib/charms/operator_libs_linux/v1/systemd.py → charmlibs-systemd==1.0.0

Import paths change from charms.operator_libs_linux.v{N}.* to charmlibs.*,
but all public APIs (PackageError, PackageNotFoundError, DebianPackage,
PackageState, group_exists, user_exists, daemon_reload, service_*, etc.)
are identical.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jansdhillon jansdhillon changed the title chore: replace vendored operator-libs-linux with PyPI charmlibs packages chore: replace legacy vendored operator-libs-linux with PyPI charmlibs packages Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant