Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump piped from 05de4b9 to 551d016 #436

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
19 changes: 19 additions & 0 deletions .github/actions/setup-py/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Install Python"
description: "Install a specific Python version"
inputs:
python-version:
description: "Python version to install"
required: false
default: "3.11"
runs:
using: composite
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
id: install-py
with:
python-version: ${{ inputs.python-version }}

- name: Install Nox
run: pipx install uv nox[uv] --python "${{ steps.install-py.outputs.python-path }}"
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/freeze-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches:
- master
paths: ["piped", "pyproject.toml", "requirements.in", "dev-requirements/*.in", "!dev-requirements/constraints.in"]
paths: ["piped", "pyproject.toml"]

jobs:
freeze-pr-dep-changes:
Expand All @@ -19,23 +19,16 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Upgrade dependency locks
run: python -m nox -s freeze-locks bot-package-diff
run: nox -s freeze-locks bot-package-diff

- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: gogo.patch
path: gogo.patch

- name: Check diff file
run: python -m nox -s is-diff-file-empty
run: nox -s is-diff-file-empty
19 changes: 6 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,14 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Lint markup
run: python -m nox -s verify-markup
run: nox -s verify-markup

- name: Check spelling
run: python -m nox -s spell-check
run: nox -s spell-check

- name: Lint with flake8
run: python -m nox -s flake8
- name: Lint with Ruff
run: nox -s lint
15 changes: 4 additions & 11 deletions .github/workflows/reformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,16 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Reformat
run: python -m nox -s reformat bot-package-diff
run: nox -s reformat bot-package-diff

- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: gogo.patch
path: gogo.patch

- name: Check diff file
run: python -m nox -s is-diff-file-empty
run: nox -s is-diff-file-empty
15 changes: 4 additions & 11 deletions .github/workflows/resync-piped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,16 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Resync Piped
run: python -m nox -s copy-piped bot-package-diff
run: nox -s copy-piped bot-package-diff

- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: gogo.patch
path: gogo.patch

- name: Check diff file
run: python -m nox -s is-diff-file-empty
run: nox -s is-diff-file-empty
13 changes: 3 additions & 10 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Run type checker
run: python -m nox -s type-check
run: nox -s type-check
13 changes: 3 additions & 10 deletions .github/workflows/update-licence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Update licence
run: python -m nox -s update-licence
run: nox -s update-licence

- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/upgrade-locks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ jobs:
with:
submodules: "true"

- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.12"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Install Python
uses: ./.github/actions/setup-py

- name: Upgrade dependency locks
run: python -m nox -s freeze-locks
run: nox -s freeze-locks

- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/verify-locks.yml

This file was deleted.

34 changes: 22 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
FROM registry.access.redhat.com/ubi9/python-312@sha256:d1244378f7ab72506d8d91cadebbf94c893c2828300f9d44aee4678efec62db9 as gen_ref_indexes
FROM registry.access.redhat.com/ubi9/python-312@sha256:d1244378f7ab72506d8d91cadebbf94c893c2828300f9d44aee4678efec62db9 AS install

WORKDIR /code

COPY ./dev-requirements/references.txt ./references.txt
COPY ./pyproject.toml ./
COPY ./uv.lock ./

RUN pip install uv && \
uv sync --frozen --only-group main

FROM registry.access.redhat.com/ubi9/python-312@sha256:d1244378f7ab72506d8d91cadebbf94c893c2828300f9d44aee4678efec62db9 AS gen_ref_indexes

WORKDIR /code

COPY --from=install /code/.venv ./venv
COPY ./pyproject.toml ./
COPY ./uv.lock ./
COPY ./scripts/gen_ref_index.py ./gen_ref_index.py

RUN python -m pip install -r ./references.txt && \
python ./gen_ref_index.py default --out-dir ./indexes
RUN pip install uv && \
uv sync --frozen --group references && \
./venv/bin/python ./gen_ref_index.py default --out-dir ./indexes

FROM registry.access.redhat.com/ubi9/python-312@sha256:d1244378f7ab72506d8d91cadebbf94c893c2828300f9d44aee4678efec62db9

WORKDIR /reinhard

COPY --from=gen_ref_indexes /code/indexes ./indexes
COPY --from=install /code/.venv ./venv
COPY ./reinhard ./reinhard
COPY ./dev-requirements/constraints.txt ./requirements.txt
COPY ./main.py ./main.py
COPY --from=gen_ref_indexes /code/indexes ./indexes

ENV DOCKER_DEBUG=false
ENV REINHARD_INDEX_DIR=./indexes
RUN python -m pip install --no-cache-dir wheel && \
python -m pip install --no-cache-dir -r requirements.txt

ENTRYPOINT if ${DOCKER_DEBUG} == false; then python main.py; else python -O main.py; fi
ENV REINHARD_INDEX_DIR=/reinhard/indexes
ENTRYPOINT ["./venv/bin/python", "-O", "main.py"]
13 changes: 0 additions & 13 deletions dev-requirements/constraints.in

This file was deleted.

Loading
Loading