API Reference
Table of Contents
Changed in version 0.3.0: All methods now take and return github3.py objects in place of their PyGithub counterparts.
octocheese.__main__
Entry points when running as a script.
Functions:
|
Helper function for when running as script or action. |
-
run(github_token, github_username, repo_name, pypi_name, self_promotion=True, max_tags=- 1)[source] Helper function for when running as script or action.
- Parameters
github_token (
Secret) – The token to authenticate with the GitHub API with. See https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token for instructions on generating a token.github_username (
str) – The username of the GitHub account that owns the repository.repo_name (
str) – The name of the GitHub repository.pypi_name (
str) – The name of the package on PyPI.self_promotion – Show information about OctoCheese at the bottom of the release message. Default
True.max_tags (
int) – The maximum number of tags to process, starting with the most recent. Set to-1to process all tags. Default-1.
Changed in version 0.1.0: Added the
self_promotionoption.Changed in version 0.3.0: Added the
max_tagsoption.
octocheese.colours
Functions for printing coloured text.
Functions:
|
Prints the given text in red to stderr. |
|
Prints the given text in green to stdout. |
|
Prints the given text in yellow to stderr. |
-
error(text)[source] Prints the given text in red to stderr.
- Parameters
text (
str) – The text to print.
octocheese.core
The main logic of octocheese.
Functions:
|
The main function for |
|
Create a release message. |
|
Update the given release on GitHub with the new name, message, and files. |
-
copy_pypi_2_github(g, repo_name, github_username, *, changelog='', pypi_name=None, self_promotion=True, max_tags=- 1, traceback=False)[source] The main function for
OctoCheese.- Parameters
g (
GitHub)repo_name (
str) – The name of the GitHub repository.github_username (
str) – The username of the GitHub account that owns the repository.changelog (
str) – Default''.pypi_name (
Optional[str]) – The name of the project on PyPI. Default The value ofrepo_name.self_promotion – Show information about OctoCheese at the bottom of the release message. Default
True.max_tags (
int) – The maximum number of tags to process, starting with the most recent. Set to-1to process all tags. Default-1.traceback (
bool) – Show the full traceback on error. DefaultFalse.
Changed in version 0.1.0: Added the
self_promotionoption.Changed in version 0.3.0:Added the optional
max_tagsoption.Added the optional
tracebackparameter.
-
make_release_message(name, version, release_date, changelog='', self_promotion=True)[source] Create a release message.
- Parameters
name (
str) – The name of the software.version (
Union[str,float]) – The version number of the new release.release_date (
date) – The date of the release.changelog (
str) – Optional block of text detailing changes made since the previous release.self_promotion – Show information about OctoCheese at the bottom of the release message. Default
True.
- Return type
- Returns
The release message.
Changed in version 0.1.0: Added the
self_promotionoption.
-
update_github_release(repo, tag_name, pypi_name, changelog='', self_promotion=True, file_urls=(), traceback=False)[source] Update the given release on GitHub with the new name, message, and files.
- Parameters
repo (
Repository)tag_name (
str)pypi_name (
str) – The name of the project on PyPI.changelog (
str) – The changelog entry for the release. Default''.self_promotion (
bool) – Show information about OctoCheese at the bottom of the release message. DefaultTrue.file_urls (
Union[Iterable[str],Iterable[FileURL]]) – The files to download from PyPI and add to the release. Either the files URLs themselves, or mappings giving the URL and its sha256 checksum. Default().traceback (
bool) – Show the full traceback on error. DefaultFalse.
- Return type
- Returns
The release, and a list of URLs for the current assets.
Changed in version 0.3.0: Now takes a very different set of parameters to the previous version. Please read the current documentation carefully.