JSPM

  • Created
  • Published
  • Downloads 5491
  • Score
    100M100P100Q132054F
  • License MIT

semantic-release plugin to publish a python package to PyPI

Package Exports

  • semantic-release-pypi

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (semantic-release-pypi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

semantic-release-pypi

semantic-release plugin to publish a python package to PyPI

Step Description
verifyConditions
  • verify the environment variable PYPI_TOKEN
  • verify PYPI_TOKEN is authorized to publish on the specified repository
  • verify that version is not set inside setup.py (version will be set in setup.cfg)
  • check if the packages setuptools, wheel and twine are installed
prepare Update the version in setup.cfg and create the distribution packages
publish Publish the python package to the specified repository (default: pypi)

Configuration

Environment variables

Variable Description Required Default
PYPI_TOKEN API token for PyPI true
PYPI_USERNAME Username for PyPI false __token__
PYPI_REPO_URL Repo URL for PyPI false See Options

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "semantic-release-pypi",
  ]
}

An example using Github Actions can be found in the repo semantic-release-pypi-example.

Options

Option Type Default Description
setupPy str ./setup.py location of setup.py
distDir str dist directory to put the source distribution archive(s) in, relative to the directory of setup.py
repoUrl str https://upload.pypi.org/legacy/ The repository (package index) to upload the package to.
pypiPublish bool true Whether to publish the python package to the pypi registry. If false the package version will still be updated.

Development

Pre-requisites

  • pyenv >= 2.1.0
source init.sh

Contribute

  • Fork from this repository
  • Run source init.sh
  • Make sure your code passes all unit tests by running yarn test
  • Issue a PR