From 9c81667378ba08fca01fbe7f266fe148892eab7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 11 Dec 2020 12:21:15 +0100 Subject: [PATCH] Do not set local_version when no CI and pass CI env to tox issue9928 --- .drone.yml | 2 +- setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 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 7ee8d368c8..ef1e541bdf 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)