python - 尝试运行 flake8 的 gitlab ci 返回错误:pipenv run flake8
问题描述
尝试 gitlab ci 集成,并在尝试运行 flake8 check 时遇到此问题
配置
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
推荐阅读
- reactjs - 如何在 VS Code 调试器中命中 React 钩子断点?
- 3d - 如何在着色器文件中将在 xyz 轴上移动对象和调整大小合并为一个?
- vim - 在 Vim 中,如何对多个文件重复多次替换?
- tensorflow - 使用 tf.keras.models.load_model 重新加载后保存的模型请求不同的输入形状 -> 未跟踪的函数(embeddings_layer)
- sql - 如何获取达到最后一个意图的表的行(基于时间戳)
- php - 列出第三张表的所有记录,但第二张表是数据透视表 - MySQL Laravel
- go - Golang Cloud Function Build 失败:函数的 go.mod 中的模块路径必须在斜杠之前的第一个路径元素中包含一个点
- javascript - 点击事件显示和删除所有覆盖而不是单独 - JavaScript
- javascript - 将嵌套对象数组转换为另一个嵌套索引对象
- pycharm - 如何通过使用 pycharm 安装 cvxpy 来解决此错误?