changeset f11fd60a7c30 in modules/sale_opportunity:5.8 details: https://hg.tryton.org/modules/sale_opportunity?cmd=changeset;node=f11fd60a7c30 description: Add support for local_version on trydevpi.tryton.org
issue9928 diffstat: .drone.yml | 2 +- setup.py | 16 ++++++++++++---- tox.ini | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diffs (54 lines): diff -r 89d9c0d1e55d -r f11fd60a7c30 .drone.yml --- a/.drone.yml Mon Nov 02 16:09:48 2020 +0100 +++ b/.drone.yml Fri Dec 11 15:44:03 2020 +0100 @@ -12,7 +12,7 @@ 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 -r 89d9c0d1e55d -r f11fd60a7c30 setup.py --- a/setup.py Mon Nov 02 16:09:48 2020 +0100 +++ b/setup.py Fri Dec 11 15:44:03 2020 +0100 @@ -45,9 +45,15 @@ 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( name[8:], 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) @@ -60,7 +66,9 @@ tests_require = [get_require_version('proteus')] 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 89d9c0d1e55d -r f11fd60a7c30 tox.ini --- a/tox.ini Mon Nov 02 16:09:48 2020 +0100 +++ b/tox.ini Fri Dec 11 15:44:03 2020 +0100 @@ -12,4 +12,4 @@ postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} sqlite: DB_NAME={env:SQLITE_NAME::memory:} postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -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}