Skip to content

Migrate project from Poetry to uv for dependency management#52

Open
kodzonko wants to merge 5 commits into
RichardAtCT:mainfrom
kodzonko:chore/replace-poetry-with-uv
Open

Migrate project from Poetry to uv for dependency management#52
kodzonko wants to merge 5 commits into
RichardAtCT:mainfrom
kodzonko:chore/replace-poetry-with-uv

Conversation

@kodzonko

@kodzonko kodzonko commented Jun 4, 2026

Copy link
Copy Markdown

Similar to what PR #9 offered but I believe that one was abandoned (no changes in response to author's code review in several months)

Migrate the project from Poetry to uv for dependency management and environment handling. This includes updating the build system, configuration files, and CI/CD workflows.

  • Replace pyproject.toml Poetry configuration with PEP 621 [project] and PEP 735 [dependency-groups] metadata.
  • Update Dockerfile to use uv for installing dependencies.
  • Update GitHub Actions workflow to use astral-sh/setup-uv.
  • Update documentation (README, MIGRATION_STATUS, UPGRADE_PLAN) to reflect uv sync and uv run commands.
  • Update all test scripts, examples, and internal error messages to use uv instead of poetry.
  • Switch build backend from poetry-core to hatchling.

Migrate the project from Poetry to uv for dependency management and
environment handling. This includes updating the build system,
configuration files, and CI/CD workflows.

- Replace `pyproject.toml` Poetry configuration with PEP 621 `[project]`
  and PEP 735 `[dependency-groups]` metadata.
- Update `Dockerfile` to use `uv` for installing dependencies.
- Update GitHub Actions workflow to use `astral-sh/setup-uv`.
- Update documentation (README, MIGRATION_STATUS, UPGRADE_PLAN) to
  reflect `uv sync` and `uv run` commands.
- Update all test scripts, examples, and internal error messages to
  use `uv` instead of `poetry`.
- Switch build backend from `poetry-core` to `hatchling`.
Copilot AI review requested due to automatic review settings June 4, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Migrates the project’s packaging, tooling, and developer docs from Poetry to uv, updating CI/Docker and user-facing instructions accordingly.

Changes:

  • Replaced Poetry configuration with PEP 621 [project] metadata, PEP 735 dependency groups, and Hatchling build backend.
  • Updated Dockerfile and GitHub Actions CI workflow to install/sync/run via uv.
  • Updated tests, examples, and docs to reference uv commands instead of poetry.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_session_continuity.py Updates server-start guidance message to uv run ....
tests/test_parameter_mapping.py Updates docstring and runtime guidance to use uv.
tests/test_docker_workspace.sh Switches docker test invocations from poetry run to uv run.
tests/conftest.py Updates skip reason message to reference uv.
src/main.py Updates run_server docstring and port error hint to uv.
pyproject.toml Migrates from Poetry config to PEP 621 + PEP 735 + Hatchling.
examples/session_continuity.py Updates runtime guidance message to use uv.
docs/UPGRADE_PLAN.md Updates migration commands from Poetry to uv.
docs/MIGRATION_STATUS.md Updates migration status instructions to uv.
README.md Updates install/run/testing instructions from Poetry to uv; adjusts formatting.
Dockerfile Replaces Poetry install with pinned uv binaries and uv sync; uses uv run CMD.
.github/workflows/ci.yml Replaces Poetry-based CI steps with uv install/sync/run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.py Outdated
Comment thread tests/conftest.py Outdated
Comment thread README.md
Comment on lines +387 to +390
| Variable | Description | Default |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
| `PORT` | Server port | `8000` |
| `MAX_TIMEOUT` | Request timeout (seconds) | `300` |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive (or I'm blind)

Comment thread .github/workflows/ci.yml
kodzonko added 3 commits June 4, 2026 02:36
Remove the explicit `uv python install` step from the CI workflow as
`uv sync` handles the Python version requirement automatically when
using the `--python` flag.
Pin the `uv` version to `0.11.19` in both the GitHub Actions workflow
and the Dockerfile to ensure consistent lockfile resolution and
identical environments between CI and container builds.
Update documentation, examples, and test instructions to use the new
`claude-wrapper` entry point instead of direct python module
invocation. This aligns the project with the recent migration from
Poetry to `uv` and standardizes the CLI usage pattern.
@kodzonko kodzonko requested a review from Copilot June 4, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ci.yml
Comment on lines +19 to +28
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
# Keep in sync with the uv version pinned in the Dockerfile so lockfile
# resolution behaves identically in CI and Docker builds.
version: "0.11.19"
enable-cache: true

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction
run: uv sync --locked --python ${{ matrix.python-version }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv sync pulls required python version on its own. Doesn't need to be available on the host.

Comment thread Dockerfile Outdated

# Run the app with Uvicorn (development mode with reload; switch to --no-reload for prod)
CMD ["poetry", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] No newline at end of file
CMD ["uv", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the original code so I'm not changing this

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this suggestion is beneficial, see here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, pushed a fix

@kodzonko

Copy link
Copy Markdown
Author

@RichardAtCT are you open to contributions to this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants