{"id":27834,"library":"ghstatus","title":"ghstatus","description":"A lightweight Python library and CLI tool to update GitHub commit statuses via the Checks API. Supports setting commit statuses (pending, success, failure, error) with context, description, and target URL. Current version: 0.3.2. Release cadence: infrequent, last release in 2021.","status":"maintenance","version":"0.3.2","language":"python","source_language":"en","source_url":"https://github.com/chickenzord/ghstatus","tags":["github","commit-status","ci","api"],"install":[{"cmd":"pip install ghstatus","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Often confused with 'import gh_status' or 'from ghstatus import ghstatus'.","symbol":"ghstatus","correct":"import ghstatus"}],"quickstart":{"code":"import os\nimport ghstatus\n\n# Use a GitHub personal access token\ntoken = os.environ.get('GITHUB_TOKEN', '')\ns = ghstatus.Session(token)\ns.set('owner/repo', 'commit_sha', 'success', 'CI passed', 'https://ci.example.com/123')\nprint('Status updated.')","lang":"python","description":"Updates a GitHub commit status. Requires a personal access token with repo status permissions."},"warnings":[{"fix":"Use PyGithub or the requests library with the Checks API endpoints.","message":"The library only supports GitHub API v3. It does not use the newer Checks API endpoint for creating checks (e.g., check runs). If you need check runs, use PyGithub or requests directly.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Session(token) only.","message":"The 'Session' constructor expects a single argument (token). In older versions, you could pass a password; this is now removed.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Ensure state is one of 'error', 'failure', 'pending', or 'success'.","message":"The 'set' method does not validate the 'state' parameter. Passing an invalid state (e.g., 'queued') will cause a 422 error from GitHub.","severity":"gotcha","affected_versions":"all"},{"fix":"For check runs, use a different library or raw API calls.","message":"The library sets status using the '/repos/:owner/:repo/statuses/:sha' endpoint, which is for commit statuses (not check runs). It does not support 'details_url'. This means you cannot attach rich Markdown output.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3.6+.","message":"Python 2 support was removed in version 0.3.0. Only Python 3 is supported.","severity":"breaking","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install ghstatus' in the correct virtual environment.","cause":"ghstatus is not installed, or installed in a different environment.","error":"ModuleNotFoundError: No module named 'ghstatus'"},{"fix":"Rename your local file. The correct import is 'import ghstatus' and then use 'ghstatus.Session(token)'.","cause":"You might have a conflicting file named 'ghstatus.py' in your project shadowing the package.","error":"AttributeError: module 'ghstatus' has no attribute 'Session'"},{"fix":"Generate a new token at https://github.com/settings/tokens with 'repo:status' scope.","cause":"Invalid or expired GitHub personal access token, or token lacks 'repo:status' permission.","error":"ghstatus.exceptions.GitHubError: 401 Unauthorized"},{"fix":"Check state is exactly one of the allowed values. Ensure owner/repo is in 'username/repository' format.","cause":"Invalid 'state' parameter (must be one of error, failure, pending, success) or incorrect owner/repo format.","error":"ghstatus.exceptions.GitHubError: 422 Unprocessable Entity"},{"fix":"Use only a token: Session(token). For older usage, downgrade to ghstatus 0.1.x.","cause":"Trying to pass a username and password to Session in a version where only token is accepted.","error":"TypeError: __init__() takes 1 positional argument but 2 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}