Python decorator that will automatcially create an issue on GitHub if a decorated function throws an exception
Reason this release was yanked:
old and useless
Project description
gicd
gicd
is a Python decorator that will automatcially create an issue on GitHub if a decorated function throws an exception. That's it!
Requirements
- The GitHub CLI (
gh
)
Usage
Decorate a function with it:
from gicd import auto_create_issue
@auto_create_issue(repo_owner="zmarffy", repo_name="cli-test-repo", exceptions=(IndexError, ValueError))
def error_prone_function():
if input("Don't type anything; just hit enter... "):
raise ValueError("Explosions!")
print("All good!")
Then call the function:
error_prone_function()
In the off chance that the function raises an exception, it will create a issue in the GitHub repo specified in the decorator.
You can have it do this with all exceptions (default behavior), or, if you specify the exceptions
parameter, it will only create an issue when those specific exceptions are thrown.
If you want to integrate this info your own app without having to specify the repo_owner
and repo_name
keyword arguments in the decorator, you can place a file with a name of your choice in a certain folder, formatted like this example:
zmarffy
cli-test-repo
This is a useful file for installers to create, then.
It would make sense for us to call that file cli-test
, in this example case. You can then use the decorator with only the app_name
keyword argument, set to the name of the file you created:
@auto_create_issue(app_name="cli-test", exceptions=(IndexError, ValueError))
The folder you place it in is:
OS | Folder |
---|---|
Linux | /etc/ghinfo/ |
Windows | %PROGRAMDATA%\ghinfo\ |
macOS | /Library/Application Support/ghinfo/ |
There's really not that much else to say about this tiny, somewhat humorous, tool.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gicd-2.0.0.tar.gz
.
File metadata
- Download URL: gicd-2.0.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec3e9b30abb2708c29a79ab0b61bc4aea1be36e5d7286f7db87074b29d3b865 |
|
MD5 | 91482b29dfcc7a95406b71d112e51e99 |
|
BLAKE2b-256 | 2923e17526a13e20057d45dcb38aba82de643308dc9a27ac1cea1aa447e9dea3 |
File details
Details for the file gicd-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: gicd-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 353113b3e7c626328a17a76aa73d8b51fe645233cbedd96ea162005f3b862a93 |
|
MD5 | 13a2ef9e2d1a7a6ad22b6047338d04fd |
|
BLAKE2b-256 | 7fb434fc865b9fbfe6002d72a8a38c07e1ae964238c53682e4c1a85013579a74 |