changeset 1ee01b952050 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=1ee01b952050
description:
Manage local version in tox and do not set local_version when no CI
issue9928
diffstat:
.drone.yml | 2 +-
setup.py | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diffs (45 lines):
diff -r ce0db69ea4d6 -r 1ee01b952050 .drone.yml
--- a/.drone.yml Fri Dec 11 11:57:10 2020 +0100
+++ b/.drone.yml Fri Dec 11 13:51:54 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 ce0db69ea4d6 -r 1ee01b952050 setup.py
--- a/setup.py Fri Dec 11 11:57:10 2020 +0100
+++ b/setup.py Fri Dec 11 13:51:54 2020 +0100
@@ -58,10 +58,20 @@
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/?local_version='
+ + '.'.join(local_version))
+
if platform.python_implementation() == 'PyPy':
pg_require = ['psycopg2cffi >= 2.5.4']
else:
@@ -161,6 +171,7 @@
'weasyprint': ['weasyprint'],
'coroutine': ['gevent>=1.1'],
},
+ dependency_links=dependency_links,
zip_safe=False,
test_suite='trytond.tests',
test_loader='trytond.test_loader:Loader',