Skip to content

Commit 11c3b41

Browse files
committed
Use custom image for precommit action
Signed-off-by: Anish Asthana <[email protected]>
1 parent 42d3672 commit 11c3b41

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

Diff for: .github/build/Containerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM registry.redhat.io/ubi9/python-39:latest
2+
3+
LABEL summary="Toolchain for running pre-commit hooks." \
4+
description="Toolchain for running pre-commit hooks" \
5+
io.k8s.display-name="Pre-Commit Toolchain"
6+
7+
USER root
8+
RUN dnf install nodejs
9+
USER $USERID
10+
11+
COPY requirements-dev.txt /tmp/requirements-dev.txt
12+
RUN python -m pip install -r /tmp/requirements-dev.txt
13+
14+
CMD bash

Diff for: .github/build/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Pre-Commit Build Artifacts
2+
3+
This directory contains the artifacts required to build the codeflare-sdk pre-commit image. As of right now, we will need to manually update `requirements-dev.txt` in this directory as well.

Diff for: .github/build/requirements-dev.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pre-commit
2+
poetry
3+
pytest
4+
pytest-mock
5+
coverage
6+
black==22.3.0

Diff for: .github/workflows/precommit.yaml

+2-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ jobs:
1212
precommit:
1313
runs-on: ubuntu-latest
1414
container:
15-
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
15+
image: quay.io/project-codeflare/codeflare-sdk-precommit:v0.0.1
1616
steps:
17-
- uses: actions/checkout@v2
18-
19-
- name: Activate cache
20-
uses: actions/cache@v2
21-
with:
22-
path: /cache
23-
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
17+
- uses: actions/checkout@v3
2418

2519
- name: Run pre-commit checks
2620
run: pre-commit run --all-files

Diff for: .pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ repos:
1212
rev: 23.3.0
1313
hooks:
1414
- id: black
15-
language_version: python3.8
15+
language_version: python3.9

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Can be installed via `pip`: `pip install codeflare-sdk`
1717

1818
### Prerequisites
1919

20-
We recommend using Python 3.8 for development.
20+
We recommend using Python 3.9 for development.
2121
Install development specific dependencies:
2222
`$ pip install -r requirements-dev.txt`
2323

0 commit comments

Comments
 (0)