|
1 | 1 | tox-pyenv
|
2 | 2 | =========
|
3 | 3 |
|
4 |
| -| |latest| |Circle CI| |
| 4 | +| |latest| |Circle CI| |
5 | 5 |
|
6 |
| -`tox <https://tox.readthedocs.org/en/latest/>`__ plugin that uses |
7 |
| -``pyenv which`` to `find python |
| 6 | +Plugin that tells `tox <https://tox.readthedocs.org/en/latest/>`__ to |
| 7 | +use `pyenv which <https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-which>`__ |
| 8 | +to `find python |
8 | 9 | executables <https://testrun.org/tox/latest/plugins.html#tox.hookspecs.tox_get_python_executable>`__
|
9 | 10 |
|
| 11 | +Your project's `circle.yml <https://circleci.com/docs/configuration>`__ |
| 12 | +######################################################################### |
| 13 | + |
| 14 | +In order for ``tox`` to have the versions of python you want available, |
| 15 | +set them using |
| 16 | +`pyenv local <https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-local>`__ |
| 17 | + |
| 18 | +.. code:: yaml |
| 19 | +
|
| 20 | + dependencies: |
| 21 | + override: |
| 22 | + - pip install tox tox-pyenv |
| 23 | + - pyenv local 2.7.9 3.4.3 3.5.0 |
| 24 | +
|
| 25 | +The versions passed to ``pyenv local`` must be |
| 26 | +`installed <https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-install>`__ |
| 27 | +for this to work. Check out the list of python versions that are |
| 28 | +pre-installed in the CircleCI build environment: |
| 29 | +https://circleci.com/docs/environment#python |
| 30 | + |
| 31 | +Corresponding `tox.ini <https://tox.readthedocs.org/en/latest/config.html>`__ |
| 32 | +############################################################################### |
| 33 | + |
| 34 | +.. code:: ini |
| 35 | +
|
| 36 | + [tox] |
| 37 | + envlist = py27,py34,py35 |
| 38 | +
|
| 39 | +The result of the setup above means running ``tox`` will run tests |
| 40 | +against python 2.7.9, python 3.4.3 and python 3.5.0, assuming those |
| 41 | +versions of python have been |
| 42 | +`pyenv install <https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-install>`__\ed. |
| 43 | + |
| 44 | +notes |
| 45 | +######## |
| 46 | + |
| 47 | +If you want tox to *exclusively* use ``pyenv which`` to find |
| 48 | +executables, you will need use the ``--tox-pyenv-no-fallback`` command |
| 49 | +line option, or set ``tox_pyenv_fallback=False`` in your tox.ini. By |
| 50 | +default, if ``tox-pyenv`` fails to find a python executable it will |
| 51 | +fallback to tox's built-in strategy. |
| 52 | + |
10 | 53 | .. |latest| image:: https://img.shields.io/pypi/v/tox-pyenv.svg
|
11 | 54 | :target: https://pypi.python.org/pypi/tox-pyenv
|
12 | 55 | .. |Circle CI| image:: https://circleci.com/gh/samstav/tox-pyenv/tree/master.svg?style=shield
|
13 | 56 | :target: https://circleci.com/gh/samstav/tox-pyenv/tree/master
|
| 57 | + |
0 commit comments