npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

semantic-release-pypi

v3.0.0

Published

semantic-release plugin to publish a python package to PyPI

Downloads

6,102

Readme

📦🐍 semantic-release-pypi

semantic-release plugin to publish a python package to PyPI

CI environment

Build System Interfaces

semantic-release-pypi support two build system interfaces

  • pyproject.toml based (Recommended)
    • version will be set inside pyproject.toml - PEP 621
    • The build backend can be specified inside pyproject.toml (defaults to setuptools) - PEP 518
  • setup.py based (Legacy interface)
    • setuptools is required, other packaging tools like Poetry or Hatch are not supported when using this interface
    • version will be set inside setup.cfg
    • version must not be set inside setup.py

Steps

| Step | Description | ---- | ----------- | verifyConditions | verify the environment variable PYPI_TOKENverify PYPI_TOKEN is authorized to publish on the specified repositorycheck if the packages setuptools, wheel and twine are installed | prepare | Update the version in pyproject.toml (legacy: setup.cfg) and create the distribution packages | publish | Publish the python package to the specified repository (default: pypi)

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. Here is a minimal example:

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

Note that this plugin modifies the version inside of pyproject.toml (legacy: setup.cfg). Make sure to commit pyproject.toml using the @semantic-release/git plugin, if you want to save the changes:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "semantic-release-pypi",
    [
      "@semantic-release/git",
      {
          "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
          "assets": ["pyproject.toml"]
      }
    ]
  ]
}

Working examples using Github Actions can be found here:

Options

| Option | Type | Default | Description | ------ | ---- | ------- | ----------- | srcDir | str | . | source directory (defaults to current directory) | 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. | gpgSign | bool | false | Whether to sign the package using GPG. A valid PGP key must already be installed and configured on the host. | gpgIdentity | str | null | When gpgSign is true, set the GPG identify to use when signing files. Leave empty to use the default identity.

Development

Pre-requisites

  • pyenv >= 2.1.0
source init.sh

Contribute

  • Fork from this repository
  • Run source init.sh
  • Add your changes
  • Make sure your code passes all unit tests by running yarn test
  • Run yarn lint to ensure your code adheres to the linting rules
  • Issue a PR

Alternatives

Python Semantic Release