Skip to main content

supports github releases

Project description

PyPI version Python versions Build Black Coverage

This package manages the __version__ and __hash__ variables in a __init__.py file in the github actions-driven builds.

For each build in a specially named branch (eg. /beta/N.M.O) a wheel package will created with a __version__ set to N.M.Ob<build-number> to respect the order in pep440 and a __hash__ set to the git hash.

A script setuptools-github-start-release will help to start a beta release branch.

Setup

The starting point is the master branch.

First add into the setup.py:

from setuptools_github import tools
initfile = pathlib.Path(__file__).parent / "your_package/__init__.py"
version = tools.update_version(initfile, os.getenv("GITHUB_DUMP"))

setup(
     name="a-name",
     version=version,
     ...

Then insert into your_package/__init__.py:

__version__ = "0.0.0"
__hash__ = ""

The setuptools_github supports a simple but reliable way to maintain beta and release branches of a project.

The main model is rather simple, all the code gets developed on the master branch.

A branch (named beta/N.M.O) maintains all the beta releases for a particular release: each one will have a version N.M.Ob<build-no>. Finally tagging the code as release/N.M.O, will formalize the “release” for N.M.O.

Features

Usage in setup.py:

from setuptools_github import tools
initfile = pathlib.Path(__file__).parent / "your_package/__init__.py"
version = tools.update_version(initfile, os.getenv("GITHUB_DUMP"))

setup(
     name="a-name",
     version=version,
     ...

Requirements

  • Python >= 3.7.

  • setuptools

Installation

You can install setuptools-github via pip from PyPI:

$ pip install setuptools-github

Or conda:

$ conda install -c conda-forge setuptools-github

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

setuptools-github-0.2.1b43.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distribution

setuptools_github-0.2.1b43-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

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