Skip to content

Commit

Permalink
update version - 0.1.0 alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
LB Johnston committed Feb 15, 2022
1 parent 9c387ca commit cc9e3f9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -34,7 +34,6 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Framework :: Django",
"Framework :: Django :: 3.0",
"Framework :: Django :: 3.1",
"Framework :: Django :: 3.2",
"Framework :: Wagtail",
Expand Down
43 changes: 42 additions & 1 deletion wagtail_hallo/__init__.py
@@ -1,5 +1,46 @@
default_app_config = "wagtail_hallo.apps.WagtailHalloAppConfig"


VERSION = (0, 1, 0)
# This file is heavily inspired by django.utils.version


def get_version(version):
"""Return a PEP 440-compliant version number from VERSION."""
version = get_complete_version(version)

# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases
# | {a|b|rc}N - for alpha, beta, and rc releases

main = get_main_version(version)

sub = ""
if version[3] != "final":
mapping = {"alpha": "a", "beta": "b", "rc": "rc", "dev": ".dev"}
sub = mapping[version[3]] + str(version[4])

return main + sub


def get_main_version(version):
"""Return main version (X.Y[.Z]) from VERSION."""
version = get_complete_version(version)
parts = 2 if version[2] == 0 else 3
return ".".join(str(x) for x in version[:parts])


def get_complete_version(version):
"""
Return a tuple of the Wagtail version. If version argument is non-empty,
check for correctness of the tuple provided.
"""
assert len(version) == 5
assert version[3] in ("dev", "alpha", "beta", "rc", "final")

return version


VERSION = (0, 1, 0, "alpha", "1")

__version__ = ".".join(map(str, VERSION))

0 comments on commit cc9e3f9

Please sign in to comment.