From 6823f645415885dad53575f0c4c0dc85780ec26a Mon Sep 17 00:00:00 2001 From: SpookyDervish Date: Thu, 22 Jan 2026 06:08:36 +1100 Subject: [PATCH] "Raises" section in autogenerated markdown, warning for uploading a package ending in _build --- requirements.txt | 3 ++- src/build.py | 2 ++ src/publish.py | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3bfa0c6..b8da9de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ rich -requests \ No newline at end of file +requests +textual \ No newline at end of file diff --git a/src/build.py b/src/build.py index 782117b..ed0defc 100644 --- a/src/build.py +++ b/src/build.py @@ -89,6 +89,8 @@ def build(args): f.write("- myArgument (double): describe your arguments in a list format like this.\n\n") f.write("## Returns\n") f.write("result (int): then explain what the function returns\n\n") + f.write("## Raises\n") + f.write("- `ErrorName`: have your error reason here, include this if your function raises any errors\n") f.write("## Example\n") f.write("```python\n") f.write("# then show how you use the function in an example\n") diff --git a/src/publish.py b/src/publish.py index ca594f8..1683fd4 100644 --- a/src/publish.py +++ b/src/publish.py @@ -28,6 +28,8 @@ def publish(args): if not os.path.isfile(os.path.join(args.folder_path, "mineral.ini")): console.print(f"[b red]digpkg: failed to publish mineral: mineral has no \"mineral.ini\" file") sys.exit(1) + if os.path.basename(os.path.normpath(args.folder_path)).endswith("_build"): + console.print(f"\n[b yellow]You didn't remove the \"_build\" suffix from your mineral's folder name!\n\nIf this is intentional you can ignore this message, however it is bad practice.\nIf this is not intentional, you will be unable to install your package properly using dig.[/]") # ask for user and pass console.print("[b]Please authenticate.\n[/]")