Skip to main content

A Python project release with Git integration.

Project description

Release and Git Repository Automation

PyPI Python 3.11 Python 3.12 Build Status

A Python project release with Git integration. This program uses a configuration file (relpo.yaml) to create a pyproject.toml file to maintain projects with pixi.

Features:

  • Track versions using Git tags rather than having to keep versions in files in sync with the repository
  • Create Sphinx API documentation with dependent project inventories
  • Create, increment and update Git tags
  • Validate the change log and Git tag versions are in sync.
  • Incorporate custom jinja2 templates to amend the pyproject.toml file creation (see Templating).
  • Render templates using the project's build information

Documentation

See the full documentation. The API reference is also available.

Obtaining

The library can be installed with pip from the pypi repository:

pip3 install zensols_relpo

Usage

The program is standalone, but needs template files to create the pyproject.toml file. The easiest way to do that is to use zenbuild, which has them. This process needs GNU make for build automation.

  1. Create a relpo.yml file (see Configuration File and example relpo.yml).
  2. Add source to src/<organization name>/<project name>
  3. Add unit tests to tests
  4. Add a makefile (see makefile)
  5. Add git: git init .
  6. Add the build sub: git submodule add https://github.com/plandes/zenbuild
  7. Add a minimal change log: echo "## [0.0.1] - $(date +%Y-%m-%d)" > CHANGELOG.md (see Keep a Changelog)
  8. Write the README.md or a placeholder: touch README.md
  9. Create the pyproject.toml file and pixi environments: make pyinit

Configuration File

A minimal relpo.yml file is given below. The file has everything needed to create the standard project section of a pyproject.toml file, and the sections needed by pixi. Additional build and doc top level mappings can add to the pyproject.toml file creation and Sphinx API documentation (see example relpo.yml).

# author full name and email
author:
  name: <first> <last>
  email: email@example.com
# GitHub user name
github:
  user: exghuser
# 'project' section metadata
project:
  # company or organization name
  domain: acme
  # project name
  name: anvil
  # project documentation
  short_description: A short description
  long_description: >-
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua.
  # keywords used in the package metadata
  keywords:
    - file
    - utility
  # Python version and dependencies
  python:
    # Python interpreter versions
    version:
      # constraint on install eligibility
      required: '>=3.11,<3.13'
      # last supported version of Python supported for the project
      previous: '3.11.12'
      # Python version supported for current development
      current: '3.12.10'
      # version of Python used to build/link specific to the host
      package_host: '3.11.6'
    # pypi dependencies added to 'project'
    dependencies:
      # cli
      - plac

Makefile

Project makefiles that use zenbuild have the minimal form:

## Build system
#
#
# type of project
PROJ_TYPE =         python
PROJ_MODULES =      python/doc git


## Includes
#
include ./zenbuild/main.mk

Templating

Build automation tasks often use the project's configuration. You can retrieve project info using the program with jinja2 templates. For example, to output the author's name as configured in the relpo.yml file:

cmd="relpo template --config relpo.yml,zenbuild/src/template/relpo/build.yml"
echo "author: {{ config.author.name }}" | $cmd

Changelog

An extensive changelog is available here.

Community

Please star this repository and let me know how and where you use this API. Contributions as pull requests, feedback and any input is welcome.

License

MIT License

Copyright (c) 2025 Paul Landes

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zensols_relpo-0.0.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file zensols_relpo-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: zensols_relpo-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for zensols_relpo-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c8fe3ddc894a76100c54903c254c75fc2290426e4fe246b00b3077870bc83c4f
MD5 d569afaea0b9e5000d7219dc5a8da91a
BLAKE2b-256 95e019d6a0c047e49fc3cdaffa62d8384d9e04119af2f5a655f9ef735972a4ec

See more details on using hashes here.

Supported by

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