Skip to content

Commit 2fbfbac

Browse files
authored
Merge branch 'main' into file_ut
2 parents 881920c + 0adaff9 commit 2fbfbac

File tree

21 files changed

+8005
-2243
lines changed

21 files changed

+8005
-2243
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Setup Python and uv'
2+
description: 'Configures a Python version and uv'
3+
inputs:
4+
python-version:
5+
type: string
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
- uses: actions/setup-python@v6
11+
with:
12+
python-version: ${{ inputs.python-version }}
13+
- name: Setup Python with UV
14+
uses: astral-sh/setup-uv@v7
15+
with:
16+
python-version: ${{ inputs.python-version }}
17+
enable-cache: "true"

.github/actions/run-tox/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Run tox with environment'
2-
description: 'Runs tox with pdm as the package manager'
2+
description: 'Runs tox with uv as the package manager'
33
inputs:
44
python-version:
55
type: string
@@ -13,8 +13,8 @@ inputs:
1313
runs:
1414
using: "composite"
1515
steps:
16-
- name: Setup Python with PDM
17-
uses: pdm-project/setup-pdm@v4
16+
- name: Setup Python with UV
17+
uses: ./.github/actions/python-uv
1818
with:
1919
python-version: ${{ inputs.python-version }}
2020
- name: Install system dependencies
@@ -23,11 +23,11 @@ runs:
2323
shell: bash
2424
- name: Install dependencies
2525
run: |
26-
pip install tox tox-pdm
26+
uv pip install --system tox tox-uv
2727
shell: bash
2828
- name: Run tox
2929
run: |
30-
tox run -e "${{ inputs.tox-env }}" -- ${{ inputs.tox-args }} || ret=$?
30+
tox run --runner uv-venv-lock-runner -e "${{ inputs.tox-env }}" -- ${{ inputs.tox-args }} || ret=$?
3131
# errno 5 means all tests were filtered out, ignore
3232
[[ "${ret:=0}" -eq 5 ]] && exit 0; exit $ret
3333
shell: bash

.github/workflows/nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
32-
- name: Set up Python
33-
uses: pdm-project/setup-pdm@v4
32+
- name: Setup Python with UV
33+
uses: ./.github/actions/python-uv
3434
with:
3535
python-version: ${{ matrix.python }}
3636
- name: Install dependencies
3737
run: |
38-
pip install tox tox-pdm
38+
uv pip install --system tox tox-pdm
3939
- name: Build the package
4040
run: |
4141
export GUIDELLM_BUILD_TYPE=nightly

.github/workflows/release-candidate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0
31-
- name: Set up Python
32-
uses: pdm-project/setup-pdm@v4
31+
- name: Setup Python with UV
32+
uses: ./.github/actions/python-uv
3333
with:
3434
python-version: ${{ matrix.python }}
3535
- name: Install dependencies
3636
run: |
37-
pip install tox tox-pdm
37+
uv pip install --system tox tox-pdm
3838
- name: Build the package
3939
run: |
4040
export GUIDELLM_BUILD_TYPE=candidate

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
30-
- name: Set up Python
31-
uses: pdm-project/setup-pdm@v4
30+
- name: Setup Python with UV
31+
uses: ./.github/actions/python-uv
3232
with:
3333
python-version: ${{ matrix.python }}
3434
- name: Install dependencies
3535
run: |
36-
pip install tox tox-pdm
36+
uv pip install --system tox tox-pdm
3737
- name: Build the package
3838
run: |
3939
export GUIDELLM_BUILD_TYPE=release

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ipython_config.py
9595
# pyenv
9696
# For a library or package, you might want to ignore these files since the code is
9797
# intended to run in multiple environments; otherwise, check them in:
98-
# .python-version
98+
.python-version
9999

100100
# pipenv
101101
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.

.pre-commit-config.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ repos:
66
exclude: ^tests/?.*/assets/.+
77
- id: end-of-file-fixer
88
exclude: ^tests/?.*/assets/.+
9-
- repo: https://github.com/pdm-project/pdm
10-
rev: 2.25.6
9+
- repo: https://github.com/astral-sh/uv-pre-commit
10+
rev: 0.9.15
1111
hooks:
12-
- id: pdm-lock-check
13-
name: check lock file matches pyproject
14-
entry: sh -c "pdm lock -v --check || pdm lock --update-reuse"
12+
- id: uv-lock
13+
name: check uv.lock file matches pyproject
14+
- id: uv-export
15+
name: Update pylock to match uv.lock
16+
# NOTE: Arguments should match ./scripts/generate_pylock.sh
17+
args:
18+
- "--frozen"
19+
- "--all-groups"
20+
- "--all-extras"
21+
- "--format=pylock.toml"
22+
- "--output-file=pylock.toml"
23+
- "--quiet"
1524
- repo: https://github.com/astral-sh/ruff-pre-commit
1625
rev: v0.11.7
1726
hooks:

Containerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# TODO: Update to official python-3.13-minimal image when available
21
ARG BASE_IMAGE=quay.io/fedora/python-313-minimal:latest
32

43
# Use a multi-stage build to create a lightweight production image
@@ -16,22 +15,23 @@ USER root
1615

1716
# Install build tooling
1817
RUN dnf install -y git \
19-
&& /usr/bin/python3 -m venv /tmp/pdm \
20-
&& /tmp/pdm/bin/pip install --no-cache-dir -U pdm \
21-
&& ln -s /tmp/pdm/bin/pdm /usr/local/bin/pdm
18+
&& /usr/bin/python3 -m venv /tmp/uv \
19+
&& /tmp/uv/bin/pip install --no-cache-dir -U uv \
20+
&& ln -s /tmp/uv/bin/uv /usr/local/bin/uv
2221

23-
# Disable pdm update check
22+
# Set the default venv for uv
23+
# Copy instead of link files with uv
2424
# Set correct build type for versioning
25-
ENV PDM_CHECK_UPDATE=false \
25+
ENV VIRTUAL_ENV=/opt/app-root \
26+
UV_LINK_MODE="copy" \
2627
GUIDELLM_BUILD_TYPE=$GUIDELLM_BUILD_TYPE
2728

2829
# Copy repository files
2930
# Do this as late as possible to leverage layer caching
3031
COPY / /src
3132

3233
# Install guidellm and locked dependencies
33-
RUN pdm use -p /src -f /opt/app-root \
34-
&& pdm install -p /src -G all --check --prod --no-editable
34+
RUN uv sync --active --project /src --frozen --no-dev --extra all --no-editable
3535

3636
# Prod image
3737
FROM $BASE_IMAGE
@@ -51,7 +51,7 @@ USER 1001:0
5151
# Add guidellm bin to PATH
5252
# Argument defaults can be set with GUIDELLM_<ARG>
5353
ENV HOME="/home/guidellm" \
54-
GUIDELLM_OUTPUT_PATH="/results/benchmarks.json"
54+
GUIDELLM_OUTPUT_DIR="/results"
5555

5656
# Create the user home dir
5757
WORKDIR $HOME

0 commit comments

Comments
 (0)