繁体   English   中英

尝试 gitlab ci 运行 flake8 返回错误:pipenv run flake8

[英]trying gitlab ci running flake8 returns error: pipenv run flake8

尝试 gitlab ci 集成,并在尝试运行 flake8 检查时遇到此问题

配置

image: "python:3.9"

before_script:
  - python --version
  - pip install pipenv
  - pipenv install

stages:
  - Static Analysis

flake8:
  stage: Static Analysis
  script:
    - pipenv run flake8 --max-line-length=120 sample/*.py
$ pipenv run flake8 --max-line-length=120 sample/*.py
Error: the command flake8 could not be found within PATH or Pipfile's [scripts].

通过使用解决

pipenv install --deploy --dev

最后

image: "python:3.9"

before_script:
  - python --version
  - pip install pipenv
  - pipenv install --deploy --dev

stages:
  - Static Analysis

flake8:
  stage: Static Analysis
  script:
    - pipenv run flake8 --max-line-length=120 sample/*.py

暂无
暂无

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

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