changeset eca220a19a36 in modules/sale_secondary_unit:default
details:
https://hg.tryton.org/modules/sale_secondary_unit?cmd=changeset;node=eca220a19a36
description:
Manage local version in tox and do not set local_version when no CI
issue9928
diffstat:
.drone.yml | 2 +-
setup.py | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r 2f230ff0410d -r eca220a19a36 .drone.yml
--- a/.drone.yml Thu Dec 10 23:05:57 2020 +0100
+++ b/.drone.yml Fri Dec 11 13:51:53 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 2f230ff0410d -r eca220a19a36 setup.py
--- a/setup.py Thu Dec 10 23:05:57 2020 +0100
+++ b/setup.py Fri Dec 11 13:51:53 2020 +0100
@@ -49,7 +49,11 @@
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)
@@ -65,7 +69,9 @@
get_require_version('trytond_sale_product_customer')]
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,