changeset 26611e92a723 in proteus:default
details: https://hg.tryton.org/proteus?cmd=changeset;node=26611e92a723
description:
        Manage local version in tox and do not set local_version when no CI

        issue9928
diffstat:

 .drone.yml |   3 +++
 setup.py   |  10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 9e0f52550aba -r 26611e92a723 .drone.yml
--- a/.drone.yml        Thu Dec 10 23:05:58 2020 +0100
+++ b/.drone.yml        Fri Dec 11 13:51:54 2020 +0100
@@ -9,6 +9,9 @@
 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 -r 9e0f52550aba -r 26611e92a723 setup.py
--- a/setup.py  Thu Dec 10 23:05:58 2020 +0100
+++ b/setup.py  Fri Dec 11 13:51:54 2020 +0100
@@ -45,13 +45,19 @@
     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,

Reply via email to