Miro Hrončok :fedora: :python: on Nostr: When writing command line tools in Python, always assume people will need to use them ...
When writing command line tools in Python, always assume people will need to use them from their own Python scripts. Don't force them call subprocess or use complex APIs. Please, provide a high-level CLI-like Python function and create the CLI by wrapping that in argparse/click/etc.
I wish I could just call fedpkg.build(), spectool.get("foo.spec"), or dnf.repoquery(whatrequires="bar", repo="rawhide") instead of copy-pasting boring wrappers from script to stript.
Published at
2023-11-23 22:35:16Event JSON
{
"id": "510298d10de72b4625e5dc899959e81e7f71547bbb9c3caafd94720354066fe7",
"pubkey": "fab4ac8ff6fc9b6650bf5d46a3793176c456ab11ee92ec74a0af72350c8020e1",
"created_at": 1700778916,
"kind": 1,
"tags": [
[
"proxy",
"https://floss.social/users/hroncok/statuses/111462247053649608",
"activitypub"
]
],
"content": "When writing command line tools in Python, always assume people will need to use them from their own Python scripts. Don't force them call subprocess or use complex APIs. Please, provide a high-level CLI-like Python function and create the CLI by wrapping that in argparse/click/etc.\n\nI wish I could just call fedpkg.build(), spectool.get(\"foo.spec\"), or dnf.repoquery(whatrequires=\"bar\", repo=\"rawhide\") instead of copy-pasting boring wrappers from script to stript.",
"sig": "e1f48716e072fb222ff358090f24e7d760860212bb21b5967f65e54021170736e5c6cc6a950404cc18e45a4639ba52504ea62a0947d790df12f29e01969c8f68"
}