From b28db8fa9f183b2d2657c38096e4bd2292c979eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 11 Dec 2020 13:51:54 +0100 Subject: [PATCH] Manage local version in tox and do not set local_version when no CI issue9928 --- .drone.yml | 3 +++ setup.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9d43e88f93..2c5c8de915 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,6 +9,9 @@ clone: pipeline: tox: image: ${IMAGE} + environment: + - CFLAGS=-O0 + - TOX_TESTENV_PASSENV=CFLAGS CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID commands: - echo "[extensions]" >> /root/.hgrc - echo "hgext.share =" >> /root/.hgrc diff --git a/setup.py b/setup.py index 850ebaa1a2..3537b82285 100755 --- a/setup.py +++ b/setup.py @@ -45,13 +45,19 @@ 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) 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,