From a84be5acf7425b204cdc9bded21fcd3554dcd298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 11 Dec 2020 13:51:51 +0100 Subject: [PATCH] Manage local version in tox and do not set local_version when no CI issue9928 --- .drone.yml | 2 +- setup.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 22e53fe42b..5cc4cd360a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/setup.py b/setup.py index 7dae59addd..f47d8e6198 100755 --- a/setup.py +++ b/setup.py @@ -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) @@ -62,7 +66,9 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_edocument_uncefact')] 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,