changeset 78b8e2bda95d in proteus:5.6
details: https://hg.tryton.org/proteus?cmd=changeset;node=78b8e2bda95d
description:
        Add support for local_version on trydevpi.tryton.org

        issue9928
diffstat:

 .drone.yml |   3 +++
 setup.py   |  16 ++++++++++++----
 tox.ini    |   2 +-
 3 files changed, 16 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 7d7197e84a04 -r 78b8e2bda95d .drone.yml
--- a/.drone.yml        Wed Nov 11 15:55:55 2020 +0100
+++ b/.drone.yml        Fri Dec 11 15:44:43 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 7d7197e84a04 -r 78b8e2bda95d setup.py
--- a/setup.py  Wed Nov 11 15:55:55 2020 +0100
+++ b/setup.py  Fri Dec 11 15:44:43 2020 +0100
@@ -41,15 +41,23 @@
     download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % (
         name, name, version)
 local_version = []
-for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER', 'CI_JOB_ID']:
-    if os.environ.get(build):
-        local_version.append(os.environ[build])
+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']:
+        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,
diff -r 7d7197e84a04 -r 78b8e2bda95d tox.ini
--- a/tox.ini   Wed Nov 11 15:55:55 2020 +0100
+++ b/tox.ini   Fri Dec 11 15:44:43 2020 +0100
@@ -7,4 +7,4 @@
 setenv =
     TRYTOND_DATABASE_URI={env:TRYTOND_DATBASE_URI:sqlite://}
     DB_NAME={env:DB_NAME::memory:}
-install_command = pip install --pre --find-links https://trydevpi.tryton.org/ 
{opts} {packages}
+install_command = pip install --pre --find-links 
https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}}
 {opts} {packages}

Reply via email to