{"id":21599429,"url":"https://github.com/abichinger/semantic-release-pypi","last_synced_at":"2025-04-06T15:13:39.146Z","repository":{"id":39859235,"uuid":"316815707","full_name":"abichinger/semantic-release-pypi","owner":"abichinger","description":"semantic-release plugin to publish a python package to PyPI","archived":false,"fork":false,"pushed_at":"2025-03-28T13:02:52.000Z","size":467,"stargazers_count":27,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T13:08:33.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abichinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-28T20:23:47.000Z","updated_at":"2025-03-28T13:02:54.000Z","dependencies_parsed_at":"2024-06-18T19:51:02.416Z","dependency_job_id":"5f9a5c91-a59c-4140-a250-39e1ee8cb71e","html_url":"https://github.com/abichinger/semantic-release-pypi","commit_stats":{"total_commits":97,"total_committers":7,"mean_commits":"13.857142857142858","dds":"0.38144329896907214","last_synced_commit":"d8f52a17601ce8eadd16df6cc3c14d9e9c1f3051"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fsemantic-release-pypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fsemantic-release-pypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fsemantic-release-pypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abichinger%2Fsemantic-release-pypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abichinger","download_url":"https://codeload.github.com/abichinger/semantic-release-pypi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500469,"owners_count":20948880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T18:15:21.281Z","updated_at":"2025-04-06T15:13:39.115Z","avatar_url":"https://github.com/abichinger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦🐍 semantic-release-pypi\n[semantic-release](https://semantic-release.gitbook.io/semantic-release/) plugin to publish a python package to PyPI\n\n\u003ca href=\"https://www.npmjs.com/package/semantic-release-pypi\"\u003e\n  \u003cimg alt=\"npm latest version\" src=\"https://img.shields.io/npm/v/semantic-release-pypi\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/abichinger/semantic-release-pypi/actions?query=workflow%3ATest+branch%3Amain\"\u003e\n  \u003cimg alt=\"Build states\" src=\"https://github.com/abichinger/semantic-release-pypi/actions/workflows/test.yml/badge.svg?branch=main\"\u003e\n\u003c/a\u003e\n\n## CI environment\n\n- [Node.js](https://semantic-release.gitbook.io/semantic-release/support/node-version) \u003e= 18.0.0\n- Python \u003e= 3.9\n\n## Build System Interfaces\n\n`semantic-release-pypi` support two [build system interfaces](https://pip.pypa.io/en/stable/reference/build-system/#)\n\n- `pyproject.toml` based (Recommended)\n  - `version` will be set inside `pyproject.toml` - [PEP 621](https://peps.python.org/pep-0621/)\n  - The build backend can be specified inside `pyproject.toml` (defaults to `setuptools`) - [PEP 518](https://peps.python.org/pep-0518/)\n\n\u003cbr /\u003e\n\n- `setup.py` based (Legacy interface)\n  - `setuptools` is required, other packaging tools like Poetry or Hatch are not supported when using this interface\n  - `version` will be set inside `setup.cfg`\n  - `version` must **not be set** inside `setup.py`\n\n## Steps\n\n| Step | Description\n| ---- | -----------\n| ```verifyConditions``` | \u003cul\u003e\u003cli\u003everify the environment variable ```PYPI_TOKEN```\u003c/li\u003e\u003cli\u003everify ```PYPI_TOKEN``` is authorized to publish on the specified repository\u003c/li\u003e\u003cli\u003echeck if the packages `setuptools`, `wheel` and `twine` are installed\u003c/li\u003e\u003c/ul\u003e\n| ```prepare``` | Update the version in `pyproject.toml` (legacy: `setup.cfg`) and create the distribution packages\n| ```publish``` | Publish the python package to the specified repository (default: pypi)\n\n## Environment variables\n\n| Variable | Description | Required | Default\n| -------- | ----------- | ----------- | -----------\n| ```PYPI_TOKEN``` | [API token](https://test.pypi.org/help/#apitoken) for PyPI | true | \n| ```PYPI_USERNAME``` | Username for PyPI | false | ```__token__```\n| ```PYPI_REPO_URL``` | Repo URL for PyPI | false | See [Options](#options)\n\n## Usage\n\nThe plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration). Here is a minimal example:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    \"semantic-release-pypi\",\n  ]\n}\n```\n\nNote that this plugin modifies the version inside of `pyproject.toml` (legacy: `setup.cfg`). \nMake sure to commit `pyproject.toml` using the `@semantic-release/git` plugin, if you want to save the changes:\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    \"semantic-release-pypi\",\n    [\n      \"@semantic-release/git\",\n      {\n          \"message\": \"chore(release): ${nextRelease.version} [skip ci]\\n\\n${nextRelease.notes}\",\n          \"assets\": [\"pyproject.toml\"]\n      }\n    ]\n  ]\n}\n```\n\nWorking examples using Github Actions can be found here:\n- [semantic-release-pypi-pyproject](https://github.com/abichinger/semantic-release-pypi-pyproject)\n- [semantic-release-pypi-setup](https://github.com/abichinger/semantic-release-pypi-setup)\n\n## Options\n\n| Option | Type | Default | Description\n| ------ | ---- | ------- | -----------\n| ```srcDir``` | str | ```.``` | source directory (defaults to current directory)\n| ```distDir``` | str | ```dist``` | directory to put the source distribution archive(s) in, relative to ```srcDir```\n| ```repoUrl``` | str | ```https://upload.pypi.org/legacy/``` | The repository (package index) to upload the package to.\n| ```pypiPublish``` | bool | ```true``` | Whether to publish the python package to the pypi registry. If false the package version will still be updated.\n| ```gpgSign``` | bool | ```false``` | Whether to sign the package using GPG. A valid PGP key must already be installed and configured on the host.\n| ```gpgIdentity``` | str | ```null``` | When ```gpgSign``` is true, set the GPG identify to use when signing files. Leave empty to use the default identity.\n| ```envDir``` | string \\| ```false``` | ```.venv``` | directory to create the virtual environment in, if set to `false` no environment will be created\n| ```installDeps``` | bool | ```true``` | wether to automatically install python dependencies\n| ```versionCmd``` | string | ```undefined``` | Run a custom command to update the version (e.g. `hatch version ${version}`). `srcDir` is used as working directory. `versionCmd` is required if the version is set [dynamically](https://packaging.python.org/en/latest/specifications/pyproject-toml/#dynamic)\n\n## Development\n\n### Pre-requisites\n\n- pyenv \u003e= 2.1.0\n\n```shell\nsource init.sh\n```\n\n### Contribute\n\n- Fork from this repository\n- Run `source init.sh`\n- Add your changes\n- Make sure your code passes all unit tests by running `yarn test`\n- Run `yarn lint` to ensure your code adheres to the linting rules\n- Issue a PR\n\n## Alternatives\n\n[Python Semantic Release](https://github.com/python-semantic-release/python-semantic-release)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabichinger%2Fsemantic-release-pypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabichinger%2Fsemantic-release-pypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabichinger%2Fsemantic-release-pypi/lists"}