What is it ?
Makaron is a simple tool that help you with the brain teaser that is to handle your project version number.
Just tell Makaron how to find your version number, and that is it. Next time you want to release a new version just call:
$ makaron major
Makaron version system follow the rule major.minor.patch
.
Let’s take an example, If your current version is 1.3.13
, after executing makaron patch
the new version will be 1.3.14
,
after makaron minor
it will be 1.4.0
and after makaron major
it will be 2.0.0
.
Makaron is language agnostic and work with every kind of project.
How to install it ?
Makaron is coded in python, so it is available on pip.
$ pip install makaron
How to configure it ?
Makaron expect a .makaron.yml
file in the current working directory.
You have to give Makaron two informations. First, the file in which it is supposed to search for the version. Second, a regex that will let him find the line where the version is in the file.
If you store your version number as a string major.minor.patch
like in this python code:
# setup.py
__version__ = '1.3.14'
To configure Makaron provide a relative path to a file and a pattern that is matching where is your version in your file.
Just replace the version number by [version]
.
# .makaron.yml
setup.py: "__version__ = [version]"
You can configure Makaron to update versions across different files.
# .makaron.yml
setup.py: "__version__ = [version]"
script/makaron: "version = [version]"
You can also configure Makaron to update different version int the same file.
# .makaron.yml
setup.py:
- "__version__ = [version]"
- "version = [version]"
And of course you can combine those two feature.
# .makaron.yml
setup.py:
- "__version__ = [version]"
- "version = [version]"
script/makaron: "version = [version]"
You can use the command makaron --generate-config
to create a new configuration file.
How to use it ?
Now that Makaron is configured, let’s use it !
Just type makaron
and the number you want to increase: major
, minor
or patch
.
$ makaron major
# or
$ makaron minor
# or
$ makaron patch
Is there more ?
Yes there is !
Print the current version number by giving no arguments to Makaron.
This can be usefull if you use it with git like this git tag `makaron`
.
$ makaron
Print the next version number.
Also usefull with git, like this git branch release/`makaron --next major`
.
$ makaron --next major
Appy a specific version.
$ makaron --apply 7.5.1
Apply version without prompt.
$ makaron minor --yes
Print the help.
$ makaron -h
Hope you will enjoy it …
Pastry fact
The macaron as it is known today, composed of two almond meringue discs filled with a layer of buttercream, jam, or ganache filling, was originally called the “Gerbet” or the “Paris macaron.” Pierre Desfontaines, of the French pâtisserie Ladurée, has sometimes been credited with its creation in the early part of the 20th century, but another baker, Claude Gerbet, also claims to have invented it. (source)