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

issue9928
This commit is contained in:
Cédric Krier committed 2020-12-11 13:51:54 +01:00
1 parent 610b83734f
commit b1faa80f99
2 files changed
+9 -3

No files matched your search

+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
- POSTGIS_URI=postgis://postgres@postgresql:5432/
commands:
- echo "[extensions]" >> /root/.hgrc
+8 -2
View File
@@ -45,7 +45,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)
@@ -54,7 +58,9 @@ requires = ['geomet', get_require_version('trytond'), 'psycopg2 >= 2.0.14']
tests_require = []
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,