get_version.py 722 B

1234567891011121314151617181920212223242526272829303132
  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( # noqa: T201
  17. INIT_TEMPLATE.format(
  18. major=VERSION[0],
  19. minor=VERSION[1],
  20. patch=VERSION[2],
  21. datestamp=datetime.date.today().strftime("%Y%m%d"),
  22. )
  23. )