Skip to content

Commit 6624eeb

Browse files
authored
chore(ci): Fix linting in the seldon_core Python package(mainly) (#7015)
* Fix 1 lint error * Fix more lint errors * Remove old conda version dev dep in python folder * Add git diff to understand why diffing the licensing fails * Disable otherworkflows white investingating * Add pwd and ls * Make licenses for python * Tweak makefile to correctly point to git repo root * Attempt to make the git folder discoverable after checkout in container * Add 'and' operator for all commands in make lint * notebooks lint * make lint: run black only * make lint: run isort only * make lint: run flake8 only * make lint: run nbqa black only * make lint: run nbqa isort only * make lint: run git diff only * Print git version in workflow * lint workflow: downgrade checkout action from 4 to 2 * Set fetch-depth to 0 when cloning repo * Resolve repo root in a different way * add steps for the workflow to commit changes in licenses * Mark dir as safe * Add git push * resolve branch * push if push event * Turn on the rest of the workflows * Manually commit licenses
1 parent 906a750 commit 6624eeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+241
-136
lines changed

.github/workflows/python_lint.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,55 @@ name: V1 Python Lint
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- release-1.19.0-prep
68
pull_request:
79
# TODO revert before merge to master
8-
branches: [ release-1.19.0-prep ]
10+
branches: [ master, release-1.19.0-prep ]
911
workflow_dispatch:
1012

13+
env:
14+
GITHUB_USER: seldondev
15+
1116
jobs:
1217
python-lint:
13-
1418
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
1521
container: seldonio/python-builder:0.9
1622

1723
steps:
18-
- uses: actions/checkout@v2
19-
- name: lint-python
24+
- name: Resolve branch
25+
run: |
26+
if [ "${{ github.event_name }}" = "push" ]; then
27+
echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
28+
else
29+
echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
30+
fi
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
ref: ${{ env.BRANCH }}
35+
fetch-depth: '0'
36+
37+
- name: Install dev deps
38+
run: make -C python install_dev update_package install
39+
40+
- name: Lint
41+
run: make -C python lint
42+
43+
- name: Make licenses
44+
run: make -C python licenses
45+
46+
- name: Configure git user
47+
run: |
48+
git config --global user.name "${GITHUB_USER}"
49+
git config --global user.email "${GITHUB_USER}@users.noreply.github.com"
50+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
51+
52+
- name: Commit changes in licensing
53+
if: github.event_name == 'push'
2054
run: |
21-
make -C python install_dev lint
55+
git add python/ && git commit -m "chore: automatically push the changed licenses files" || echo "Nothing to commit"
56+
git push

.github/workflows/python_tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: V1 Python Tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- release-1.19.0-prep
68
pull_request:
79
# TODO revert before merge to master
8-
branches: [ release-1.19.0-prep ]
10+
branches: [ master, release-1.19.0-prep ]
911
workflow_dispatch:
1012

1113
jobs:

.github/workflows/security_code_tests_v1.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: V1 Security code Tests
22

33
on:
44
push:
5-
branches: [ master ]
6-
pull_request:
7-
# TODO remove release-1.19.0-prep before merge to master
85
branches:
96
- master
107
- release-1.19.0-prep
8+
pull_request:
9+
# TODO revert before merge to master
10+
branches: [ master, release-1.19.0-prep ]
1111
workflow_dispatch:
1212

1313
jobs:

.github/workflows/security_tests_go_v1.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: V1 Security Tests Go Images
22

33
on:
44
push:
5-
branches: [ master ]
6-
pull_request:
7-
# TODO remove release-1.19.0-prep before merge to master
85
branches:
96
- master
107
- release-1.19.0-prep
8+
pull_request:
9+
# TODO revert before merge to master
10+
branches: [ master, release-1.19.0-prep ]
1111
workflow_dispatch:
1212

1313
jobs:

.github/workflows/security_tests_python_v1.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ name: V1 Security Tests Python Images
22

33
on:
44
push:
5-
branches: [ master ]
6-
pull_request:
7-
# TODO remove release-1.19.0-prep before merge to master
85
branches:
96
- master
107
- release-1.19.0-prep
8+
pull_request:
9+
# TODO revert before merge to master
10+
branches: [ master, release-1.19.0-prep ]
1111
workflow_dispatch:
12+
1213
jobs:
1314
build-upload-scan-base-images:
1415
runs-on: ubuntu-latest

.github/workflows/test-executor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
---
21
name: V1 Executor Lint & Tests
32

43
on:
54
push:
6-
branches: [ master ]
5+
branches:
6+
- master
7+
- release-1.19.0-prep
78
pull_request:
89
# TODO revert before merge to master
9-
branches: [release-1.19.0-prep]
10-
10+
branches: [ master, release-1.19.0-prep ]
1111
workflow_dispatch:
1212

1313
env:

.github/workflows/test-operator.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
---
21
name: V1 Operator Lint & Tests
32

43
on:
54
push:
6-
branches: [master]
5+
branches:
6+
- master
7+
- release-1.19.0-prep
78
pull_request:
89
# TODO revert before merge to master
9-
branches: [release-1.19.0-prep]
10-
10+
branches: [ master, release-1.19.0-prep ]
1111
workflow_dispatch:
1212

1313
env:

components/drift-detection/_DEPRECATED_nvidia-triton-cifar10/cifar10_driftlv3behsm_nbqa_ipynb.py

Whitespace-only changes.

components/drift-detection/cifar10/cifar10_drift0eifs5lf_nbqa_ipynb.py

Whitespace-only changes.

components/outlier-detection/cifar10/cifar10_outlierhyyoq_0p_nbqa_ipynb.py

Whitespace-only changes.

0 commit comments

Comments
 (0)