Closed sebalix closed 6 years ago
@sebalix yes indeed one of the successful jobs does the upload to pypi and the other fail. Travis is a bit rudimentary in that respect :) It also means, if, say, the python 2.7 test suceeds but one of the python 3 fails, the upload to pypi will be done anyway. It usually works because we make sure tests pass before tagging.
Travis now has a (beta?) feature that adds build stages, similar to gitlab. I experimented that in click-odoo-contrib and in works well, so deploy is done only when the test stage is successful (example).
BTW, you may want to upload a wheel in addition to the sdist (example)
@sbidoul thank you for these pointers, really nice, I think I'll go for the build stages feature, I prefer to have a dedicated upload job. I suppose its mandatory to declare all the build possibilities one by one? Or is there a better way to declare these stages as it's done currently (matrix):
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "pypy"
env:
- ORPC_TEST_VERSION=8.0"
- ORPC_TEST_VERSION=9.0"
- ORPC_TEST_VERSION=10.0"
- ORPC_TEST_VERSION=11.0"
is there a better way
I don't know actually, I found the travis syntax a bit hard to grasp, to be honest :)
Okay, I'll test and see by myself :)
@sbidoul FYI matrix syntax seems to work with Build Stages: https://travis-ci.org/OCA/odoorpc/builds/421622221 Except that I don't figure out what is the last job (21) running with Python 2.7, but it's a good start!
Fixed.
Travis is unable to upload a new release to PyPI: https://travis-ci.org/OCA/odoorpc/jobs/421480647#L1082
The problem was surely the use of
distutils
instead ofsetuptools
.TestPyPI link: https://test.pypi.org/project/OdooRPC/
Regarding Travis, I'm not sure how multiple jobs are dealing with the deploy/upload part. The first which finishes upload the package and the others simply fail or exit without any error? @sbidoul maybe you know how it works? I was reading about conditional release https://docs.travis-ci.com/user/deployment#conditional-releases-with-on and also check how you were dealing with this in https://github.com/acsone/click-odoo/blob/master/.travis.yml