Package: github-release-retry2
github-release-retrygithub-release-retry2is a tool for creating GitHub Releases and uploading
assetsreliably. It differs from other tools because it uploads assets
reliably by verifying that the asset exists, and retries
(deleting partial assets) if not.This is not an officially supported Google product.
This is a fork from the original github-release-retry with advanced patches
applied for use in scancode-toolkit release scripts.InstallRequires Python 3.6+.To ensure you use thepipmodule associated with your
preferred Python 3.6+ binary:python3-mpipinstall--usergithub-release-retry# where `python3` is your preferred Python 3.6+ binary.# Omit `--user` to install for all users.Or just:pip3install--usergithub-release-retry# where `pip3` is your version of pip for Python 3.6+.# Omit `--user` to install for all users.UsageIf yourPython user scripts directoryis not on yourPATH,
you can use:python3-mgithub_release_retry.github_release_retry# where `python3` is your preferred Python 3.6+ binary.Otherwise:$github-release-retry-h
usage:github-release-retry[-h]--userUSER--repoREPO--tag_nameTAG_NAME[--target_commitishTARGET_COMMITISH][--release_nameRELEASE_NAME](--body_stringBODY_STRING|--body_fileBODY_FILE)[--draft][--prerelease][--github_api_urlGITHUB_API_URL][--retry_limitRETRY_LIMIT][files[files...]]CreatesaGitHubrelease(ifitdoesnotalreadyexist)anduploadsfilestotherelease.
PleasesettheGITHUB_TOKENenvironmentvariable.
EXAMPLE:
github-release-retry\--userpaul\--repohello-world\--tag_namev1.0\--target_commitish448301eb\--body_string"My first release."\hello-world.zipRELEASE_NOTES.txt

positionalarguments:filesThefilestouploadtotherelease.(default:None)optionalarguments:-h,--helpshowthishelpmessageandexit--userUSERRequired:TheGitHubusernameororganizationnameinwhichthereporesides.(default:None)--repoREPORequired:TheGitHubreponameinwhichtomaketherelease.(default:None)--tag_nameTAG_NAMERequired:Thenameofthetagtocreateoruse.(default:None)--target_commitishTARGET_COMMITISHThecommit-ishvaluewherethetagwillbecreated.Unusedifthetagalreadyexists.(default:None)--release_nameRELEASE_NAMEThenameoftherelease.Leaveunsettousethetag_name(recommended).(default:None)--body_stringBODY_STRINGRequired(oruse--body_file):Textdescribingtherelease.Ignoredifthereleasealreadyexists.(default:None)--body_fileBODY_FILERequired(oruse--body_string):Textdescribingtherelease,whichwillbereadfromBODY_FILE.Ignoredifthereleasealreadyexists.(default:None)--draftCreatesadraftrelease,whichmeansitisunpublished.(default:False)--prereleaseCreatesaprereleaserelease,whichmeansitwillbemarkedassuch.(default:False)--github_api_urlGITHUB_API_URLTheGitHubAPIURLwithoutatrailingslash.(default:https://api.github.com)--retry_limitRETRY_LIMITThenumberoftimestoretrycreating/gettingthereleaseand/oruploadingeachfile.(default:10)DevelopmentOptional: if you have just donegit pullandPipfile.lockwas updated,
you can delete.venv/to start from a fresh virtual environment.On Windows, you can use the Git Bash shell, or adapt the commands (including those insidedev_shell.sh.template) for the Windows command prompt.Clone this repo and change to the directory that contains this README file. Execute./dev_shell.sh.template. If the default settings don't work, make a copy of the file calleddev_shell.shand modify according to the comments before executing.pipmust be installed for the version of Python you wish to use. Note that you can do e.g.export PYTHON=python3first to set your preferred Python binary.
We currently target Python 3.6+.Pip for Python 3.6 may be broken on certain Debian distributions.
You can just use the newer Python 3.7+ version provided by your
distribution.
Alternatively, see "Installing Python" below if you want to use Python 3.6.The script generates a Python virtual environment (located at.venv/) with all dependencies installed.
Activate the Python virtual environment via:source .venv/bin/activate(on Linux)source .venv/Scripts/activate(on Windows with the Git Bash shell).venv/Scripts/activate.bat(on Windows with cmd)Presubmit checksExecute./check_all.shto run various presubmit checks, linters, etc.Execute./fix_all.shto automatically fix certain issues, such as formatting.PyCharmUse PyCharm to open the directory containing this README file.
It should pick up the Python virtual environment
(at.venv/) automatically
for both the code
and when you open aTerminalorPython Consoletab.Install and configure plugins:File Watchers (may already be installed)The watcher task should already be under version control.Mypy: the built-in PyCharm type checking uses Mypy behind-the-scenes, but this plugin enhances it by using the latest version and allowing the use of stricter settings, matching the settings used by the./check_all.shscript.Addwhitelist.dicas a custom dictionary (search for "Spelling" in Actions). Do not add words via PyCharm's "Quick Fixes" feature, as the word will only be added to your personal dictionary. Instead, manually add the word towhitelist.dic.Coding conventionsTerminalTheTerminaltab in PyCharm is useful and will use the project's Python virtual environment.Installing PythonTo manually install Python on your Linux distribution, you can usepyenv.https://github.com/pyenv/pyenv#basic-github-checkoutIn summary:Install the required packages recommendedhere.Then:gitclonehttps://github.com/pyenv/pyenv.git~/.pyenv# Add the following two lines to your ~/.bashrc file.exportPYENV_ROOT="$HOME/.pyenv"exportPATH="$PYENV_ROOT/bin:$PATH"# In a new terminal:eval"$(pyenvinit-)"pyenvinstall3.6.9
pyenvglobal3.6.9# Now execute the development shell script, as usual.exportPYTHON="python"./dev_shell.sh.templateYou can reactivate the virtual environment later
usingsource .venv/bin/activate,
without having to re-execute the abovepyenvcommands.