简体   繁体   English

tox:如何指定python micro版本

[英]tox: how to specify python micro version

In the example below, the python version is 2.7.6. 在下面的示例中,python版本是2.7.6。

  • Why is it 2.7.6, and not the latest 2.7.15? 为什么是2.7.6,而不是最新的2.7.15?
  • How do I specify 2.7.15? 如何指定2.7.15?

Set up 设定

$ tox --version
2.7.0 imported from /home/obk/anaconda3/lib/python3.6/site-packages/tox/__init__.py

$ ls
tox.ini

$ cat tox.ini
[tox]
envlist = py27
skipsdist = True

[testenv]
commands = python -V

Running it: 运行它:

$ tox -r
py27 recreate: /home/obk/repos/test/.tox/py27
py27 installed:
py27 runtests: PYTHONHASHSEED='4191112007'
py27 runtests: commands[0] | python -V
Python 2.7.6
___________________________________ summary ___________________________________________
  py27: commands succeeded
  congratulations :)

The reason why I want the latest 2.7.15 is because my project has a dependency ( my_foo -> nbconvert -> tornado ) that is now using ssl.create_default_context which was added in 2.7.9 . 为什么我想要最新的2.7.15的原因是因为我的项目具有相关性( my_foo - > nbconvert > - tornado ),其现在使用ssl.create_default_context这是在2.7.9中加入

Why is it 2.7.6, and not the latest 2.7.15? 为什么是2.7.6,而不是最新的2.7.15?

Because the version of Python 2.7 on your computer is 2.7.6. 因为您计算机上的Python 2.7版本是2.7.6。

How do I specify 2.7.15? 如何指定2.7.15?

Specify basepython = /path/to/python2.7.15 under [testenv] , where /path/to/python2.7.15 is a path to a local copy of exactly version 2.7.15. [testenv]下指定basepython = /path/to/python2.7.15 ,其中/path/to/python2.7.15是精确到版本2.7.15的本地副本的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM