我应该在 travis-ci 测试中使用 pipenv 吗?最佳实践?
should I be using pipenv in my travis-ci tests? best practices?
当 运行 Travis-CI 中的一些预定义 Pipenv 脚本时,我收到以下消息,这让我想到以下问题:我应该在 Travis 环境中成为 运行 Pipenv 吗?它是否违背了 CI 测试的目的?
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
当您使用 Pipenv 进行开发并使用 Travis 进行开发时,最佳实践是什么 CI?我应该手动 运行 下面的脚本映射到 pipenv run unit_test
吗?请参阅下面我的 Pipfile
.
的一部分
.travis.yml
:
language: python
python:
- "3.6"
install:
- pip install pipenv
- pipenv install --dev
script:
- pipenv run unit_tests
- pipenv run linting
- pipenv run docs
Pipfile
:
[scripts]
deploy = "python ./deploy.py"
docs = "python ./docs.py"
linting = "pylint **/*.py"
unit_tests = "python -m pytest --cov=marian tests"
serve = "sh ./serve.sh"
因此 Travis 将 pipenv 本身用于虚拟环境。因此,除了通过 pipenv install --dev
安装之外似乎很尴尬。我删除了所有 Pipfile
脚本,并在 .travis.yml
中使用了以下脚本
install:
- pip install pipenv
- pipenv install --dev
script:
- pylint **/*.py
- python -m pytest --cov=marian
- python ./docs.py
当 运行 Travis-CI 中的一些预定义 Pipenv 脚本时,我收到以下消息,这让我想到以下问题:我应该在 Travis 环境中成为 运行 Pipenv 吗?它是否违背了 CI 测试的目的?
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
当您使用 Pipenv 进行开发并使用 Travis 进行开发时,最佳实践是什么 CI?我应该手动 运行 下面的脚本映射到 pipenv run unit_test
吗?请参阅下面我的 Pipfile
.
.travis.yml
:
language: python
python:
- "3.6"
install:
- pip install pipenv
- pipenv install --dev
script:
- pipenv run unit_tests
- pipenv run linting
- pipenv run docs
Pipfile
:
[scripts]
deploy = "python ./deploy.py"
docs = "python ./docs.py"
linting = "pylint **/*.py"
unit_tests = "python -m pytest --cov=marian tests"
serve = "sh ./serve.sh"
因此 Travis 将 pipenv 本身用于虚拟环境。因此,除了通过 pipenv install --dev
安装之外似乎很尴尬。我删除了所有 Pipfile
脚本,并在 .travis.yml
install:
- pip install pipenv
- pipenv install --dev
script:
- pylint **/*.py
- python -m pytest --cov=marian
- python ./docs.py