supports github releases
Project description
Intro
setuptools-github is both a library and a script to support package deliveries using beta branches on github: in a simple model each (automated) commit on a beta/N.M.O branch will result in a package with a __version__ of N.M.Ob<build-number> and a __hash__ corresponding to the commit.
Finally tagging the code with a release/N.M.O tag will result in a package of __version__ N.M.O and “close” the beta branch (this is the same sorting strategy used in pep440).
A script setuptools-github-start-release will help to start a beta release branch.
Setup
We start from the master branch (or main, depending on the repository setting).
Initial steps (setup.py)
First add into the setup.py file the function handling the __version__/__hash__ variables:
from setuptools_github import tools initfile = pathlib.Path(__file__).parent / "your_package/__init__.py" # this will manage the __version__/__hash__ in initfile using the github envs version = tools.update_version(initfile, os.getenv("GITHUB_DUMP")) setup( name="a-name", version=version, ...
Second update the .github/workflows/{beta,master,release}.yml
Adds to the workflows yaml files the following:
- name: Build wheel package env: PYTHONPATH: . GITHUB_DUMP: ${{ toJson(github) }} run: | python -m build
This will set the environment variable GITHUB_DUMP to a json string from the action context.
Release process
To begin a new branch from master:
setuptools-github-start-release micro src/your_package/__init__.py
This will create a new branch beta/0.0.0 initially where your-package will build 0.0.0b1, 0.0.0b2 etc. wheels.
Tagging beta/0.0.0 as release/0.0.0, will close the branch and you can restart a new branch:
setuptools-github-start-release micro src/your_package/__init__.py
This will (1) bump the master __version__ to 0.0.1 (micro), and create a new beta/0.0.1 branch.
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
Built Distribution
Hashes for setuptools-github-0.2.1b44.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d66ad9452b88207ffa7bfd8cee15cffeff33fcf759ee17174a37296bdc2ee2ad |
|
MD5 | f912c18b72a6f4708c0304c9a4d81851 |
|
BLAKE2b-256 | c8d30e9599ce157ae4370ef2e7f77310cb1c46a77e3ccd30d4f5e8541d19f356 |
Hashes for setuptools_github-0.2.1b44-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd083b2adc2d1a4dfa321aa2a894460b2f2cfdbfb4d1c9cc6ad9b641757fe649 |
|
MD5 | ecced0fdc088803bbf63373fa4090830 |
|
BLAKE2b-256 | a39f25a8f68631a1c0e772a24dad181c96d8945ab2a71487b9e16311c1d34fe2 |