Skip to content

Commit 9c6ecbd

Browse files
authored
Add pip_break parameter to lint job for system package installation (#256)
Adds a new `pip_break` boolean parameter to the lint job that allows users to pass the `--break-system-packages` flag to pip install when needed. The parameter defaults to false to maintain backward compatibility.
1 parent 6742400 commit 9c6ecbd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/jobs/lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ parameters:
1919
description: Enables jobs to go through a set of well-defined IP address ranges.
2020
type: boolean
2121
default: false
22+
pip_break:
23+
description: Put --break-system-packages flag on pip install
24+
type: boolean
25+
default: false
2226

2327
executor: << parameters.executor >>
2428

@@ -34,3 +38,4 @@ steps:
3438
command: <<include(scripts/lint.sh)>>
3539
environment:
3640
ORB_VAL_SOURCE_DIR: << parameters.source_dir >>
41+
PIP_BREAK: << parameters.pip_break >>

src/scripts/lint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ if [ ! -d "$ORB_VAL_SOURCE_DIR" ]; then
55
printf "https://circleci.com/docs/orbs/author/orb-development-kit/\n"
66
exit 1
77
fi
8-
pip install --user yamllint
8+
if [ "$PIP_BREAK" = true ]; then
9+
pip install --user --break-system-packages yamllint
10+
else
11+
pip install --user yamllint
12+
fi
913
yamllint "$ORB_VAL_SOURCE_DIR"

0 commit comments

Comments
 (0)