forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
43 lines (33 loc) · 1.31 KB
/
__init__.py
File metadata and controls
43 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from . import checks # pyflakes:ignore
# Version must stay in single quotes for automatic CI replace
# Don't add patch number here:
__version__ = '1.0.0-dev'
# Release hash must stay in single quotes for automatic CI replace
__release_hash__ = ''
# Release branch must stay in single quotes for automatic CI replace
__release_branch__ = ''
# set this to ".p1", ".p2", etc. after patching
__patch__ = ""
if __version__ == '1.0.0-dev' and __release_hash__ == '' and __release_branch__ == '':
import subprocess
branch = subprocess.run(
["/usr/bin/git", "branch", "--show-current"],
capture_output=True,
).stdout.decode().strip()
git_hash = subprocess.run(
["/usr/bin/git", "rev-parse", "head"],
capture_output=True,
).stdout.decode().strip()
rev = subprocess.run(
["/usr/bin/git", "describe", "--tags", git_hash],
capture_output=True,
).stdout.decode().strip().split('-', 1)[0]
__version__ = f"{rev}-dev"
__release_branch__ = branch
__release_hash__ = git_hash
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celeryapp import app as celery_app
__all__ = ('celery_app',)