![](/img/trans.png)
[英]Create conda environment: "Found conflicts!" when solving environment and "Finding shortest conflict path" running forever
[英]pytest not found when running from a conda environment in GitHub Actions
我正在嘗試使用 GitHub Actions 測試我的包,其中該包在conda
環境中運行。 在本地一切正常。 但是在 GitHub Actions 上,它說pytest: command not found
with this workflow file :
name: Build and Test [Python 3.6, 3.7]
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: microdf
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Build
shell: bash -l {0}
run: |
pip install -e .
- name: Run tests
run: |
pytest
我試圖消除pytest
從conda
環境, 而不是運行pip install pytest
運行前pytest
,但給了一個不同的錯誤: error: invalid command 'bdist_wheel'
。
您需要指定shell
,如Build
步驟中所示:
- name: Run tests
shell: bash -l {0}
run: pytest
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.