API Docs#

Library Functions#

jupyter_releaser.lib.bump_version(version_spec, version_cmd, changelog_path)#

Bump the version and verify new version

Check URLs for HTML-containing files.

jupyter_releaser.lib.delete_release(auth, release_url)#

Delete a draft GitHub release by url to the release page

jupyter_releaser.lib.draft_changelog(version_spec, branch, repo, since, since_last_stable, auth, changelog_path, dry_run)#

Create a changelog entry PR

jupyter_releaser.lib.draft_release(ref, branch, repo, auth, changelog_path, version_cmd, dist_dir, dry_run, post_version_spec, post_version_message, assets)#

Publish Draft GitHub release and handle post version bump

jupyter_releaser.lib.extract_release(auth, dist_dir, dry_run, release_url, npm_install_options, pydist_check_cmd, pydist_resource_paths, python_imports)#

Download and verify assets from a draft GitHub release

jupyter_releaser.lib.forwardport_changelog(auth, ref, branch, repo, username, changelog_path, dry_run, release_url)#

Forwardport Changelog Entries to the Default Branch


Parse a release url into a regex match

jupyter_releaser.lib.prep_git(ref, branch, repo, auth, username, url)#

Set up git

jupyter_releaser.lib.publish_assets(dist_dir, npm_token, npm_cmd, twine_cmd, npm_registry, twine_registry, dry_run, release_url, python_package)#

Publish release asset(s)

jupyter_releaser.lib.publish_release(auth, release_url)#

Publish GitHub release

jupyter_releaser.lib.tag_release(dist_dir, release_message, tag_format, tag_message, no_git_tag_workspace)#

Create release commit and tag

Python Utility Functions#

jupyter_releaser.python.build_dist(dist_dir, clean=True)#

Build the python dist files into a dist folder

jupyter_releaser.python.check_dist(dist_file, test_cmd='', python_imports=None, check_cmd='twine check --strict', resource_paths=None)#

Check a Python package locally (not as a cli)

jupyter_releaser.python.get_pypi_token(release_url, python_package)#

Get the PyPI token

Note: Do not print the token in CI since it will not be sanitized if it comes from the PYPI_TOKEN_MAP


Start a local PyPI server

NPM Utility Functions#

jupyter_releaser.npm.build_dist(package, dist_dir)#

Build npm dist file(s) from a package

jupyter_releaser.npm.check_dist(dist_dir, install_options)#

Check npm dist file(s) in a dist dir

jupyter_releaser.npm.extract_dist(dist_dir, target)#

Extract dist files from a dist_dir into a target dir


Get the package json info from the tarball


Get the formatted list of npm package names and versions


Handle npm_config


Generate tags for npm workspace packages

Changelog Utility Functions#

jupyter_releaser.changelog.build_entry(ref, branch, repo, auth, changelog_path, since, since_last_stable, resolve_backports)#

Build a python version entry

jupyter_releaser.changelog.check_entry(ref, branch, repo, auth, changelog_path, since, since_last_stable, resolve_backports, output)#

Check changelog entry


Extract the current changelog entry


Extract the current released version from the changelog


Clean up changelog formatting

jupyter_releaser.changelog.format_pr_entry(target, number, auth=None)#

Format a PR entry in the style used by our changelogs.

  • target (str) – The GitHub owner/repo

  • number (int) – The PR number to resolve

  • auth (str, optional) – The GitHub authorization token


A formatted PR entry

Return type:


jupyter_releaser.changelog.get_version_entry(ref, branch, repo, version, *, since=None, since_last_stable=None, until=None, auth=None, resolve_backports=False)#

Get a changelog for the changes since the last tag on the given branch.

  • branch (str) – The target branch

  • ref (str) – The source reference

  • repo (str) – The GitHub owner/repo

  • version (str) – The new version

  • since (str) – Use PRs with activity since this date or git reference

  • since_last_stable – Use PRs with activity since the last stable git tag

  • until (str, optional) – Use PRs until this date or git reference

  • auth (str, optional) – The GitHub authorization token

  • resolve_backports (bool, optional) – Whether to resolve backports to the original PR


A formatted changelog entry with markers

Return type:


jupyter_releaser.changelog.insert_entry(changelog, entry, version=None)#

Insert the entry into the existing changelog.

jupyter_releaser.changelog.splice_github_entry(orig_entry, github_entry)#

Splice an entry created on GitHub into one created by build_entry

Global Utility Functions#

jupyter_releaser.util.actions_output(name, value)#

Print the special GitHub Actions ::set-output line for name::value

jupyter_releaser.util.bump_version(version_spec, *, changelog_path='', version_cmd='')#

Bump the version


Compute the sha256 of a file

jupyter_releaser.util.create_release_commit(version, release_message=None, dist_dir='dist')#

Generate a release commit that has the sha256 digests for the release files


Get the appropriate git branch


Get the default remote branch


Get the default ‘since’ value for a branch

jupyter_releaser.util.get_latest_tag(source, since_last_stable=False)#

Get the default ‘since’ value for a branch


Get the remote repo owner and name


Get the current package version


Test whether a version is a prerelease version


Get the latest draft release for a given repo

jupyter_releaser.util.log(*outputs, **kwargs)#

Log an output to stderr


Normalize a path to use backslashes


Read the jupyter-releaser config data

jupyter_releaser.util.release_for_url(gh, url)#

Get release response data given a release url

jupyter_releaser.util.retry(cmd, **kwargs)#

Run a command with retries

jupyter_releaser.util.run(cmd, **kwargs)#

Run a command as a subprocess and get the output as a string