简体   繁体   English

从 python 中找不到 Travis 环境变量

[英]Travis environment variables not found from python

This guide tells that several environment variable are available to all builds on Travis. 本指南介绍了几个环境变量可用于 Travis 上的所有构建。

However my build fails because the lack of the TRAVIS environment variable.但是我的构建失败了,因为缺少TRAVIS环境变量。 (I have printed out the available variables and there is no TRAVIS in them.) (我已经打印出可用的变量,其中没有 TRAVIS。)

Here is my travis config .这是我的 travis 配置

What do I wrong?我怎么了?

The problem roots in tox.问题根源于毒性。 Tox clears environment variables. Tox 清除环境变量。 Use passenv=TRAVIS* to pass the Travis-related environment variables.使用passenv=TRAVIS*传递 Travis 相关的环境变量。

passenv : 通行证

passenv(SPACE-SEPARATED-GLOBNAMES) passenv(SPACE-SPARATED-GLOBNAMES)

New in version 2.0. 2.0 版中的新功能。

A list of wildcard environment variable names which shall be copied from the tox invocation environment to the test environment when executing test commands.执行测试命令时,应从 tox 调用环境复制到测试环境的通配符环境变量名称列表。 If a specified environment variable doesn't exist in the tox invocation environment it is ignored.如果指定的环境变量在 tox 调用环境中不存在,则会被忽略。 You can use * and ?您可以使用 * 和 ? to match multiple environment variables with one name.将多个环境变量与一个名称匹配。

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

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