mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
searx/version.py uses the new frozen version
This commit is contained in:
parent
3a14cf0efe
commit
1a75548526
2 changed files with 11 additions and 11 deletions
|
@ -10,8 +10,8 @@ import importlib
|
||||||
|
|
||||||
# fallback values
|
# fallback values
|
||||||
# if there is searx.version_frozen module, and it is not possible to get the git tag
|
# if there is searx.version_frozen module, and it is not possible to get the git tag
|
||||||
VERSION_STRING = "1.0.0"
|
VERSION_STRING = "2.0.0"
|
||||||
VERSION_TAG = "1.0.0"
|
VERSION_TAG = "2.0.0"
|
||||||
GIT_URL = "unknow"
|
GIT_URL = "unknow"
|
||||||
GIT_BRANCH = "unknow"
|
GIT_BRANCH = "unknow"
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ def get_git_version():
|
||||||
subprocess_run("git diff --quiet -- . ':!searx/settings.yml' ':!utils/brand.env'")
|
subprocess_run("git diff --quiet -- . ':!searx/settings.yml' ':!utils/brand.env'")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
if e.returncode == 1:
|
if e.returncode == 1:
|
||||||
git_version += "+dirty"
|
git_version += ".dirty"
|
||||||
else:
|
else:
|
||||||
logger.warning('"%s" returns an unexpected return code %i', e.returncode, e.cmd)
|
logger.warning('"%s" returns an unexpected return code %i', e.returncode, e.cmd)
|
||||||
docker_tag = git_version.replace("+", "-")
|
docker_tag = git_version.replace("+", "-")
|
||||||
|
@ -76,13 +76,12 @@ def get_git_version():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vf = importlib.import_module('searx.version_frozen')
|
vf = importlib.import_module('searx.version_frozen')
|
||||||
VERSION_STRING, VERSION_TAG, DOCKER_TAG, GIT_URL, GIT_BRANCH = (
|
vt = vf.version_tuple
|
||||||
vf.VERSION_STRING,
|
VERSION_STRING = vf.version
|
||||||
vf.VERSION_TAG,
|
VERSION_TAG = f"{vt[0]}.{vt[1]}.{vt[2]}-{vt[3].split('.')[0]}"
|
||||||
vf.DOCKER_TAG,
|
DOCKER_TAG = f"{vt[0]}.{vt[1]}.{vt[2]}-{vt[3]}"
|
||||||
vf.GIT_URL,
|
GIR_URL = ""
|
||||||
vf.GIT_BRANCH,
|
GIT_BRANCH = ""
|
||||||
)
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -16,8 +16,9 @@ def version_yyyymmdd_tag():
|
||||||
def custom_local_scheme(version: ScmVersion):
|
def custom_local_scheme(version: ScmVersion):
|
||||||
return '.dirty' if version.dirty else ''
|
return '.dirty' if version.dirty else ''
|
||||||
|
|
||||||
|
# FIXME : GIT_URL and GIT_BRANCH are missing from searx/version_frozen.py
|
||||||
return {
|
return {
|
||||||
'write_to': 'searx/_version.py',
|
'write_to': 'searx/version_frozen.py',
|
||||||
'version_scheme': custom_version_scheme,
|
'version_scheme': custom_version_scheme,
|
||||||
'local_scheme': custom_local_scheme
|
'local_scheme': custom_local_scheme
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue