JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 122
  • Score
    100M100P100Q77812F
  • License MIT

A semantic-release plugin for PyPi.org that supports both regular and Poetry projects

Package Exports

  • semantic-release-python
  • semantic-release-python/index.js

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-python) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Plugin: Semantic Release Python

A plugin created by Megabyte Labs


A semantic-release plugin for PyPi.org that supports both regular and Poetry projects


Table of Contents

Overview

Semantic Release Python is a semantic-release plugin that brings support for managing the publication of PyPi packages. It supports traditional Python projects with a setup.cfg file and also supports Poetry projects.

This plugin requires both Python 3 and a recent version of Node.js to be present. After installing the plugin, a few supporting Python packages will automatically be installed into a virtualenv located at .venv. Using a virtualenv helps to prevent incompatibilities with your current installed software. Before you run any configuration that contains, you must source the virtualenv by running . .venv/bin/activate or install the dependencies in this project's requirements.txt through other means prior to utilizing the plugin.

Requirements

Lifecycle Hooks

Step Description
verifyConditions
  • Verify the environment variable PYPI_TOKEN
  • Verify PYPI_TOKEN is authorized to publish on the specified repository
  • If the project is not a Poetry project (i.e. it has a setup.cfg), then verify that version is not set inside setup.py (version will be set in setup.cfg)
  • If it is not Poetry project, check if the packages setuptools, wheel and twine are installed
  • If it is a Poetry project (i.e. contains pyproject.toml instead of setup.cfg), ensure Poetry is installed
prepare Update the version in setup.cfg and create the distribution packages if it is not a Poetry project. But, if it is a Poetry project, then just update the version.
publish Build the project if it is a Poetry project and then publish the Python package to the PYPI_REPO_URL

Environment Variables

Variable Description Required Default
PYPI_TOKEN API token for PyPi (or password if PYPI_USERNAME is specified) true
PYPI_USERNAME PyPi username (only required if you are using a password instead of an API token) false __token__
PYPI_REPO_URL URL of remote Python package repository false https://upload.pypi.org/legacy/

Options

Option Type Default Description
setupPy string ./setup.py Location of setup.py (or any file in the root of the project for a Poetry project)
distDir string dist Directory to put the source distribution archive(s) in, relative to the directory of setup.py (this variable is not used in Poetry projects)
repoUrl string https://upload.pypi.org/legacy/ The repository to upload the package to
pypiPublish boolean true Whether to publish the Python package to the PyPi registry. If false, the package version will still be updated.
gpgSign boolean false Whether to sign the package using GPG. A valid PGP key must already be installed and configured on the host. Our implementation for Poetry projects currently do not support this feature.
gpgIdentity string null When gpgSign is true, set the GPG identify to use when signing files. Leave empty to use the default identity. Our implementation for Poetry projects currently do not support this feature.

Examples

This plugin can be configured in the semantic-release configuration file. For a full example of a configuration used for multiple project types, check out the shareable configuration we use for all our of projects.

Basic Example Using setup.cfg

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

Example Using Poetry

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-python",
      {
        "setupPy": "./pyproject.toml"
      }
    ]
  ]
}

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page. If you would like to contribute, please take a look at the contributing guide.

Sponsorship

Dear Awesome Person,

I create open source projects out of love. Although I have a job, shelter, and as much fast food as I can handle, it would still be pretty cool to be appreciated by the community for something I have spent a lot of time and money on. Please consider sponsoring me! Who knows? Maybe I will be able to quit my job and publish open source full time.

Sincerely,

Brian Zalewski

Open Collective sponsors GitHub sponsors Patreon

License

Copyright © 2020-2021 Megabyte LLC. This project is MIT licensed.