Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ __pycache__
*.so
.venv
venv
.pdm-python
.pdm-build
.python-version

# Tests and dev
tests
Expand Down
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,8 @@ ipython_config.py
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/
# uv
# uv.lock should be committed to version control for reproducible builds.

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down
12 changes: 6 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ FROM registry.access.redhat.com/ubi9/python-312:latest AS builder

WORKDIR /app

# Install PDM in the builder only; not needed in the final image.
RUN pip install --no-cache-dir pdm
# Install uv in the builder only; not needed in the final image.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Copy dependency manifests and README first (build backend needs README.md).
# Dependency layer is reused when only application code changes.
COPY pyproject.toml pdm.lock README.md ./
RUN pdm install --prod --no-editable --frozen-lockfile
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev --no-editable --no-install-project

# Copy application code and install the package into the venv.
COPY src/ src/
RUN pdm install --prod --no-editable --frozen-lockfile
RUN uv sync --frozen --no-dev --no-editable

RUN curl -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.18/openshift-client-linux.tar.gz && \
tar xvf oc.tar.gz oc && \
chmod +x oc && \
rm oc.tar.gz

# Final stage: smaller image without PDM or build tools.
# Final stage: smaller image without uv or build tools.
FROM registry.access.redhat.com/ubi9/python-312:latest

LABEL com.redhat.component="rhos-ls-mcps" \
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ We assume the configuration file has already been created, for example `config.y
## From source code

```bash
pdm run rhos-ls-mcps
uv run rhos-ls-mcps
```

To run with environment variables (e.g. debug mode):

```bash
DEBUG=1 uv run rhos-ls-mcps
```

## Container Image
Expand Down
2,126 changes: 0 additions & 2,126 deletions pdm.lock

This file was deleted.

14 changes: 2 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,8 @@ readme = "README.md"
license = {text = "Apache-2.0"}

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.pdm]
distribution = true
requires = ["uv_build>=0.11.16,<0.12"]
build-backend = "uv_build"

[project.scripts]
rhos-ls-mcps = "rhos_ls_mcps.main:main"

#[project.scriptspdm.scripts.rhos-ls-mcps]
#env = { DEBUG = "1" }
#cmd = "python -m rhos_ls_mcps.main"
#cmd = ["python", "-m", "rhos_ls_mcps.main"]
# env = { TYPE = "dev", PORT = "5000" }
# rhos-ls-mcps = { call = "rhos_ls_mcps.main" }
2,011 changes: 2,011 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading