Repository navigation
Split pystemd.utils into a package - #127
Merged
Merged
Conversation
pystemd/utils.py becomes pystemd/utils/, one module per kind of helper:
- utils/x2.py: x2char_star, str2cmd, strlist2cmd, x2cmdlist (the old
file, moved, so its history follows)
- utils/unit.py: random_unit_name
- utils/typing.py: T, unwrap
utils/__init__.py re-exports all of them, so existing imports such as
`from pystemd.utils import x2char_star` and `pystemd.utils.unwrap(...)`
keep working unchanged (including mock.patch("pystemd.utils.random_unit_name")
in the tests). setup.py lists packages explicitly, so pystemd.utils is
added there.
No behaviour change; this makes room for new helper modules (e.g.
namespaces) without growing a single catch-all file.
aleivag
force-pushed
the
utils-package
branch
from
November 18, 2026 21:36
fc17756 to
6515f58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pystemd/utils.py becomes pystemd/utils/, one module per kind of helper:
utils/init.py re-exports all of them, so existing imports such as
from pystemd.utils import x2char_starandpystemd.utils.unwrap(...)keep working unchanged (including mock.patch("pystemd.utils.random_unit_name") in the tests). setup.py lists packages explicitly, so pystemd.utils is added there.No behaviour change; this makes room for new helper modules (e.g. namespaces) without growing a single catch-all file.