Skip to main content

A framework for automating software releases

Project description

Modeltee is a tool to automate software releases.

I find that release time often involves several manual steps: remember to update the version number in several places, commit, make a clean build, upload, make and push a git tag…

Why a new tool? I could automate all that with a shell script. Modeltee lets you:

  • Define a reusable release procedure and subclass that for different projects.

  • Automatically check for required tools before starting a release.

  • Share components which can add checks and information.

You define a release process as a subclass of modeltee.ReleaserBase. There are five steps you can control.

  1. Automated checks (check_prereqs): check that e.g. git is installed. The base method runs checks from components you’re using. If you override it, it’s recommended to call it using super().

  2. Manual confirmation (user_confirm): present information to the user, and give them an opportunity to cancel. The base method presents information provided by components you’re using.

  3. Steps before release (before_release): you might want to set the version number, make a clean build, give the tests a final run…

  4. The release itself (do_release): upload and tag the release. This is the one step you must define.

  5. Steps after release (after_release): e.g. set the version number to x+1.dev.

A simple releaser for a Python package might look like this:

from modeltee import ReleaserBase, Command, Bumpversion, Git
import sys

class Releaser(ReleaserBase):
    # These are components: they define checks to run before starting and
    # info to present, as well as providing shortcuts to use below.
    git = Git()
    twine = Command('twine')
    python = Command(sys.executable)
    bumpversion = Bumpversion()

    def before_release(self):
        self.bumpversion('--new-version', self.version, 'minor')
        self.python('setup.py', 'sdist')
        self.git('commit', '-am', 'version number -> {}'.format(self.version))
        self.git('push')

    def do_release(self):
        self.twine('upload', 'foo-{}.tar.gz'.format(self.version))
        self.git('tag', str(self.version))
        self.git('push', '--tags')

if __name__ == '__main__':
    Releaser.main()

And you’d run it like this:

./release.py 1.3

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

modeltee-0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

modeltee-0.1-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file modeltee-0.1.tar.gz.

File metadata

  • Download URL: modeltee-0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for modeltee-0.1.tar.gz
Algorithm Hash digest
SHA256 a1aac7991807b0015f1efbd474f0f6dc6c3ec92154e95f1b4c2d10c65f5ea2fb
MD5 80da0d1a966f148d6a4faa4f6a3d16c9
BLAKE2b-256 b0f3b7d5f3417086d7f2a876cee93dfea7eba06ed487b9f07402493a00a88de9

See more details on using hashes here.

File details

Details for the file modeltee-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for modeltee-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8ec57243ae89bc633d72b06b0352c12dbf7ff7ddebdf2e7662ef28f4a15abf82
MD5 c6b0a9df8369a78a668933fb313d3887
BLAKE2b-256 9a97ffd7abba3f4f4865a2a6222289ff8cb55e6d6b271412f02572d2b9e729da

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