0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 19:17:48 +01:00
wagtail/scripts/nightly/get_version.py
Karl Hobley 229c845481
Added CI config to generate nightly builds from master (#5320)
* Added CI config to generate nightly builds from master

* Fix typo

* Don't write __init__.py directly

We need to import the original in the script

* Update wagtail.utils.version

This is based off a copy from Django master made just now and adds
support for 'dev' versions.
2019-06-21 11:13:34 +01:00

32 lines
683 B
Python

"""
This script is called by the nightly build in Circle CI.
It alters the version of Wagtail to include the build date
"""
import datetime
from wagtail import VERSION
INIT_TEMPLATE = """
from wagtail.utils.version import get_semver_version, get_version
# major.minor.patch.release.number
# release must be one of alpha, beta, rc, or final
VERSION = ({major}, {minor}, {patch}, 'dev', '{datestamp}')
__version__ = get_version(VERSION)
# Required for npm package for frontend
__semver__ = get_semver_version(VERSION)
"""
print(INIT_TEMPLATE.format(
major=VERSION[0],
minor=VERSION[1],
patch=VERSION[2],
datestamp=datetime.date.today().strftime('%Y%m%d'),
))