zuul-jobs/roles/tox
Monty Taylor a99a73dca6 Uninstall and reinstall siblings one at a time
The current logic uninstalls all detected siblings first, then it
executes a single install with all of the detected sibling git repos.

If one sibling (A) depends on another sibling (B), then the commands:

  pip uninstall A
  pip uninstall B
  pip install ../A ../B

Will result in pip finding B in the requirements list for ../A and
re-installing the released version, then considering the requirement
satisfied when it gets to ../B and not installing it.

To solve that, do the uninstall and reinstall in a single-project loop
for each sibling. This results in:

  pip uninstall A
  pip install ../A

pip will find B in ../A's requirements, but B will already be installed
because it hasn't been uninstalled yet, so nothing will happen. Then:

  pip uninstall B
  pip install ../B

Which will result in both ../A and ../B being installed.

As if that wasn't enough, if A and B happen to appear in the opposite
order, doing:

  pip uninstall B
  pip install ../B
  pip uninstall A
  pip install ../A

Will wind up with pip uninstalling ../B and installing B if the version
requested for B is greater than the version reported by ../B (which is
the case for openstack projects operating from master after a release
but before the first release of the next cycle)

In order to combat that, do a second installation pass with --no-deps.
This way the first pass will be sure to get any transitive dependency
changes, but the second pass will ensure all the siblings are installed
instead of their non-git versions.

  pip uninstall B
  pip install ../B
  pip uninstall A
  pip install ../A
  pip install --no-deps ../B
  pip install --no-deps ../A

Change-Id: I060e188313391de7847adf851566468c4b032342
2018-03-20 16:01:09 +00:00
..
defaults Combine tox-siblings and tox roles 2017-11-29 15:34:08 -06:00
library Uninstall and reinstall siblings one at a time 2018-03-20 16:01:09 +00:00
tasks Convert back to zuul.projects 2017-12-01 15:02:20 +11:00
README.rst Combine tox-siblings and tox roles 2017-11-29 15:34:08 -06:00

Runs tox for a project

Role Variables

Environment variables to pass in to the tox run.

Path to a pip constraints file. Will be provided to tox via UPPER_CONSTRAINTS_FILE environment variable if it exists.