Skip to main content

Publish python package to PyPI and Github

Project description

Codacy Quality Badge Codacy Coverage Badge

publish is a tool to package and release a python project. It will create a changelog and upload artifacts to Github and PyPI.

It is created for and by the FIAAS project, and used for most of our projects.

Usage

In order to use publish, you must first install it:

pip install publish

Under the covers, publish uses github-release and twine to do most of the work, and those tools require credentials for Github and PyPI to be available in environment variables:

export GITHUB_TOKEN=gh-token
export TWINE_USERNAME=pypi-user
export TWINE_PASSWORD=pypi-pass

In order to know where to upload the artifacts, you must specify an organization, and a repository:

publish fiaas k8s

Before uploading anything, publish will verify that the current checkout is suitable to be released, and checks the following items:

  • Are all files either ignored or in version control?

  • Is every change committed?

  • Is the currently checked out code tagged with an annotated tag?

  • Does that tag use the convention v<major>.<minor>.<bugfix>?

If the answer to all of these is yes, the name of the tag is used as the version to release. A changelog is generated from the git log, source tarballs and wheels are built, the release is created in Github and PyPI, and the files are uploaded.

When uploading a release to Github, the changelog is attached to the release automatically.

In order for the changelog to be attached to the release on PyPI, it needs to be included in the long description generated by setup.py. To help with this, the changelog is written to a file, and the name of the file is available in an environment variable called CHANGELOG_FILE. Append the contents of this file to your long description, and it will be included in the description on PyPI.

Changes since last version

  • a923e90: Upgrade twine, githubrelease

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publish-0.3.5.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

publish-0.3.5-py2.py3-none-any.whl (10.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file publish-0.3.5.tar.gz.

File metadata

  • Download URL: publish-0.3.5.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for publish-0.3.5.tar.gz
Algorithm Hash digest
SHA256 e419093191f7dbfc3cb568a7400fa5ae2075782a352f9ef1ee5391ebfb7f24d9
MD5 ab3c384e7c8c0d94fe58ba2aa6932595
BLAKE2b-256 65f3464f44e701f3985b19370c8d88070382595a657fbdfe97567555d6a1f406

See more details on using hashes here.

File details

Details for the file publish-0.3.5-py2.py3-none-any.whl.

File metadata

  • Download URL: publish-0.3.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for publish-0.3.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 721357c20c97b927168a48098ade72e53b8806ec2c6032faa0847ec0f02dc213
MD5 310584ae34a537741451f8aa93fdc254
BLAKE2b-256 2a37becc57c526d31177e8e1af5f390ce1bfa1889eebf685f516d3ccaa33bf26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page