Skip to main content

release-gitter

Easily download releases from sites like Github and Gitea

Original repo

Originally hosted at https://git.iamthefij.com/iamthefij/release-gitter.git

GitHub Rate Limits

Unauthenticated requests to the GitHub API are limited to 60 requests per hour. If you exceed this limit, you will receive rate limit errors when trying to fetch releases.

To increase your rate limit to 5,000 requests per hour, set a GITHUB_TOKEN environment variable with a GitHub personal access token:

export GITHUB_TOKEN=ghp_your_token_here

You can create a personal access token at https://github.com/settings/tokens (no special scopes required for public repository access).

Installation

From pypi pip install release-gitter

Alternatively, you can download release_gitter.py and run that file as long as you have requests installed.

Usage

At minimum, release-gitter can be used to download the latest release file for a given repo using something like the following:

release-gitter --git-url https://github.com/coder/super-tool "super-tool-{version}-{system}-{arch}"

Originally created for downloading binary releases for pre-commit hooks, so it also has features to detect the remote repo automatically using git remote get-url origin, as well as detecting the currently checked out version by parsing metadata files (currently only Cargo.toml).

In practice, it means that for a project like StyLua, when run within the repo one would only need to provide:

release-gitter --extract-files "stylua" --exec "chmod +x stylua" \
    --map-system Windows=win64 --map-system Darwin=macos --map-system=linux=Linux \
    "stylua-{version}-{system}.zip"

And release-gitter will get the release version from the Cargo.toml, get the URL from the git remote, call the Github API and look for a release matching the templated file name, extract the stylua file from the archive, and then make it executable. Alternatively, if you're project --version-git-tag can be used to pull the version from the latest tag. This will automatically do a shallow fetch (depth = 1), but this can be supressed with --version-git-no-fetch.

This allows a single command to be run from a checked out repo from pre-commit on any system to fetch the appropriate binary.

Additionally, it can be used to simplify install instructions for users by providing the --git-url option so it can be run from outside the repo.

Full usage is as follows:

usage: release-gitter [-h] [-v] [--hostname HOSTNAME] [--owner OWNER]
                      [--repo REPO] [--git-url GIT_URL] [--version VERSION]
                      [--prerelease] [--version-git-tag]
                      [--version-git-no-fetch] [--map-system MAP_SYSTEM]
                      [--map-arch MAP_ARCH] [--exec EXEC]
                      [--extract-files EXTRACT_FILES] [--extract-all]
                      [--url-only] [--use-temp-dir]
                      format [DEST]

positional arguments:
  format                Format template to match assets. Eg.
                        `foo-{version}-{system}-{arch}.zip`
  DEST                  Destination directory. Defaults to current directory

options:
  -h, --help            show this help message and exit
  -v                    verbose or debug logging
  --hostname HOSTNAME   Git repository hostname
  --owner OWNER         Owner of the repo. If not provided, it will be
                        retrieved from the git url
  --repo REPO           Repo name. If not provided, it will be retrieved from
                        the git url
  --git-url GIT_URL     Git repository URL. Overrides `git remote` detection,
                        but not command line options for hostname, owner, and
                        repo
  --version VERSION     Release version to download. If not provided, it will
                        look for project metadata
  --prerelease          Include pre-release versions in search
  --version-git-tag, -t
                        Get the release version from a git tag
  --version-git-no-fetch
                        Shallow fetch tags prior to checking versions
  --map-system, -s MAP_SYSTEM
                        Map a platform.system() value to a custom value
  --map-arch, -a MAP_ARCH
                        Map a platform.machine() value to a custom value
  --exec, -c EXEC       Shell commands to execute after download or
                        extraction. {} will be expanded to the downloaded
                        asset name.
  --extract-files, -e EXTRACT_FILES
                        A list of file names to extract from the downloaded
                        archive
  --extract-all, -x     Extract all files from the downloaded archive
  --url-only            Only print the URL and do not download
  --use-temp-dir        Use a temporary directory as the destination

Pre-Commit usage

This can be used a way to wrap a binary release from a Github or Gitea by adding a pyproject.toml file to your current project directory and adding a .pre-commit-hooks.yaml file.

Take a look at the ./sample_pseudo_bin directory to see an example.

Metadata

Release files for release-gitter 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for release-gitter 3.2.0
File Size Uploaded Provenance
release_gitter-3.2.0.tar.gz 12.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for release-gitter 3.2.0
File Interpreter ABI Platform
release_gitter-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.5 kB

Release files / release_gitter-3.2.0.tar.gz

Download URL release_gitter-3.2.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1b98818e15297d7c5d5099b7dc20fa0232e0adf361a8e3fd00304973d7e6a492
BLAKE2b-256 checksum
How to use checksums
94d6c08b68c815e4cbf42c765f3832a873fb1949bdee5df6a294302ed3ee138c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.14.7"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.14.7","system":{"name":"Linux","release":"5.15.0-187-generic"}} HTTPX2/2.13.1

Release files / release_gitter-3.2.0-py3-none-any.whl

Download URL release_gitter-3.2.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a66bfb04dbec9db0d5e8e9b242a93146e5e6e87caa128bf44bd65e11cde53d9
BLAKE2b-256 checksum
How to use checksums
e9d7bfda20b022c02d6d780cfe5457e9bc8acc88eecae4aeb1fd46e5141f39d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.14.7"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.14.7","system":{"name":"Linux","release":"5.15.0-187-generic"}} HTTPX2/2.13.1

Security for release-gitter 3.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page