Manage local version in tox and do not set local_version when no CI

issue9928
This commit is contained in:
Cédric Krier
2020-12-11 13:51:51 +01:00
parent 5876b364e4
commit 420ad0babf
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ pipeline:
environment:
- CFLAGS=-O0
- DB_CACHE=/cache
- TOX_TESTENV_PASSENV=CFLAGS DB_CACHE
- TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID
- POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
commands:
- echo "[extensions]" >> /root/.hgrc
+8 -2
View File
@@ -49,7 +49,11 @@ if os.environ.get('CI_JOB_ID'):
local_version.append(os.environ['CI_JOB_ID'])
else:
for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']:
local_version.append(os.environ.get(build, ''))
if os.environ.get(build):
local_version.append(os.environ[build])
else:
local_version = []
break
if local_version:
version += '+' + '.'.join(local_version)
@@ -61,7 +65,9 @@ requires.append(get_require_version('trytond'))
dependency_links = []
if minor_version % 2:
dependency_links.append('https://trydevpi.tryton.org/')
dependency_links.append(
'https://trydevpi.tryton.org/?local_version='
+ '.'.join(local_version))
setup(name=name,
version=version,