python - CircleCI 和 Config.yml 的问题没有找到 requirements.txt 和 dev_requirements.txt
问题描述
我正在尝试为一个小项目设置 circleci,并且我有以下配置 yml 文件:
version: 2.1
orbs:
python: circleci/python@0.2.1
jobs:
build-and-test:
docker:
- image: circleci/python:3.7.9
executor: python/default
steps:
- checkout
- python/load-cache
- run:
command: pip install -r src/requirements.txt
name: Install Deps
- python/save-cache
- run:
command: ./manage.py test
name: Test
workflows:
main:
jobs:
- build-and-test
在我的 github 项目中,我的requirements.txt
和dev_requirements.txt
文件位于一个名为src
.
在仪表板上,我收到以下错误:
error computing cache key: template: cacheKey:1:7: executing "cacheKey" at <checksum "requirements.txt">: error calling checksum: open /home/circleci/project/requirements.txt: no such file or directory
我该如何解决这个问题?
谢谢
解决方案
这个 Python orb 有点过时了,但是对于旧的和当前的 orb,答案是一样的。指定需求文件的位置,这是 Circle 创建校验和所需要的,用于确定需求是否已更新(是否需要 d/l 新的或使用缓存)。这两个命令代替python/load-cache
and python/save-cache
:
- restore_cache:
keys:
- v1-dependencies-{{ checksum "YOURPATH/requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "YOURPATH/requirements.txt" }}
推荐阅读
- c# - C# - EPPlus 库,使用响应创建 Excel
- javascript - Vue: default value for prop function
- unity3d - Gradle构建在unity2018中失败
- angular - 尝试从父组件中的 mat-dialog 角度接收文件
- python - 如何在 Y 轴的不同高度上绘制列表列表?
- angular - Angular 7 Firebase 电子邮件登录身份验证不起作用
- python-3.x - 将来自 HIVE 和 Hbase 的数据公开为 REST API - Hadoop Datalake - Python Pyspark
- javascript - 为什么这个 vue 组件在 Laravel 中不起作用
- c++ - 我的结构是一个单词列表,之后必须输出。但是输出格式不对
- html - 添加四个带有迷你边框线的块