Skip to main content

upgrade projects created from a Cookiecutter template

Project description

Cookiecutter Project Upgrader

https://img.shields.io/pypi/v/cookiecutter_project_upgrader.svg https://img.shields.io/travis/thomasjahoda/cookiecutter_project_upgrader.svg Documentation Status

Upgrade projects created from a Cookiecutter template.

Features

Cookiecutter Project Upgrader allows upgrading projects that were created using Cookiecutter.

After a project has been created from a Cookiecutter template, changes made to the Cookiecutter template usually have to be applied manually to the project. This tool automates this process.

When run the first time on a project, it creates a new branch from the first commit of the current branch (the oldest one). It then generates the project again using the latest version of the template and creates a new commit that contains the latest cookiecuttered code,

Usage: cookiecutter_project_upgrader [OPTIONS]

Upgrade projects created from a Cookiecutter template

Options:
-c, --context-file PATH

Default: docs/cookiecutter_input.json

-b, --branch TEXT

Default: cookiecutter-template

-m, --merge-now BOOLEAN

Execute a git merge after a successful update, default: ask if interactive, otherwise false.

-m, --push-template-branch-changes BOOLEAN

Push changes to the remote Git branch on a successful update, default: ask if interactive, otherwise false.

--help

Show this message and exit.

Preconditions

The tool requires a JSON file with context that matches the existing service. This file can be created through Cookiecutter with the following contents:

{{ cookiecutter | jsonify }}

You will need a recent version of git for this to work. (it needs –no-checkout on git worktree)

Auto-Completion

The script uses the Click toolkit. Because the script uses Click, you can enable completion for Zsh and Bash.

For Bash, add the following to your .bashrc or some other profile initialization file. eval “$(_COOKIECUTTER_PROJECT_UPGRADER_COMPLETE=source cookiecutter_project_upgrader)”

For Zsh, please read the Click documentation.

Credits

The concept and some code is heavily based on https://github.com/senseyeio/cupper, with some changes to use Click and some flags and default values to ease usage. Also cleanup has been done and automated tests have been added.

This package was created with Cookiecutter and the thomasjahoda/cookiecutter-pypackage project template.

History

1.0.0 (2019-03-22)

  • First release on PyPI.

1.1.0 (2019-03-24)

  • Ask for some options interactively if within interactive shell.

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

cookiecutter_project_upgrader-1.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

cookiecutter_project_upgrader-1.1.0-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cookiecutter_project_upgrader-1.1.0.tar.gz.

File metadata

  • Download URL: cookiecutter_project_upgrader-1.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for cookiecutter_project_upgrader-1.1.0.tar.gz
Algorithm Hash digest
SHA256 98e07ef97f3dd2bf36a4ba23c569add16a24c6a3bcbbd5aaded56e3a9da1ba4b
MD5 751f5cbe4b4189bfb13a8870c77c305c
BLAKE2b-256 ae1ea26269d1c828a5547141b7bfe2f37af97f73ee8148de379d690cffbb5e3c

See more details on using hashes here.

File details

Details for the file cookiecutter_project_upgrader-1.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: cookiecutter_project_upgrader-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for cookiecutter_project_upgrader-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 33af9cf0ea42ced7e22b10281e205a89ecd237c873a31009f605399210cab59f
MD5 009b986517a70346fda78ddc5487c831
BLAKE2b-256 2dd349a7ba90093500684b2badb1df7e77dca8c63c583949be643ada033166bf

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