get_version.py 683 B

12345678910111213141516171819202122232425262728293031
  1. """
  2. This script is called by the nightly build in Circle CI.
  3. It alters the version of Wagtail to include the build date
  4. """
  5. import datetime
  6. from wagtail import VERSION
  7. INIT_TEMPLATE = """
  8. from wagtail.utils.version import get_semver_version, get_version
  9. # major.minor.patch.release.number
  10. # release must be one of alpha, beta, rc, or final
  11. VERSION = ({major}, {minor}, {patch}, 'dev', '{datestamp}')
  12. __version__ = get_version(VERSION)
  13. # Required for npm package for frontend
  14. __semver__ = get_semver_version(VERSION)
  15. """
  16. print(INIT_TEMPLATE.format(
  17. major=VERSION[0],
  18. minor=VERSION[1],
  19. patch=VERSION[2],
  20. datestamp=datetime.date.today().strftime('%Y%m%d'),
  21. ))