Skip to content

build: switch test setup from pip to uv#323

Merged
MaStr merged 1 commit into
MaStr:mainfrom
filiplajszczak:uv-test-setup-cleanup
Apr 14, 2026
Merged

build: switch test setup from pip to uv#323
MaStr merged 1 commit into
MaStr:mainfrom
filiplajszczak:uv-test-setup-cleanup

Conversation

@filiplajszczak
Copy link
Copy Markdown
Contributor

Switch the pytest workflow and test helper scripts from pip to uv, update the README examples, and relax the minimum uv version.

Leave the Dockerfile unchanged for now; container build migration can follow separately.

MaStr
MaStr previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates local test scripts and the GitHub Actions pytest workflow from pip to uv, aligning test/developer setup around pyproject.toml extras and standardizing commands across environments.

Changes:

  • Switch run_tests.sh / run_tests.ps1 to uv pip install and uv run pytest.
  • Update the GitHub Actions pytest workflow to use astral-sh/setup-uv and run tests via uv.
  • Relax [tool.uv].required-version and update README installation/testing examples to uv.

Reviewed changes

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

Show a summary per file
File Description
run_tests.sh Uses uv for editable install and running pytest.
run_tests.ps1 Uses uv for editable install and running pytest on Windows.
pyproject.toml Relaxes minimum uv version requirement.
README.MD Updates local install/test/docs to uv-based commands.
.github/workflows/pytest.yml Switches CI setup from setup-python/pip to setup-uv/uv.

Comment thread run_tests.sh
Comment thread .github/workflows/pytest.yml
Comment thread README.MD
Comment thread README.MD Outdated
@filiplajszczak
Copy link
Copy Markdown
Contributor Author

I addressed the actionable ones:

  • removed the old manual venv activation from run_tests.sh so it now just uses uv
  • fixed the broken Markdown code fence in the install section
  • fixed the development purposes typo

I left the workflow indentation unchanged, since the YAML there is valid as-is and the workflow was already parsing/running correctly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread run_tests.ps1
MaStr
MaStr previously approved these changes Apr 14, 2026
@MaStr
Copy link
Copy Markdown
Owner

MaStr commented Apr 14, 2026

Looks good, let’s give the copilot another round

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread run_tests.sh Outdated
Comment thread run_tests.sh Outdated
Comment thread run_tests.ps1 Outdated
Comment thread pyproject.toml
@MaStr
Copy link
Copy Markdown
Owner

MaStr commented Apr 14, 2026

@filiplajszczak Sorry to come back to this with run_tests.sh

I just setup a new environment. When I run run_tests.sh twice, I get:

Using CPython 3.13.11
Creating virtual environment at: .venv
? A virtual environment already exists at `.venv`. Do you want to replace it? [y/n] › yes

hint: Use the `--clear` flag or set `UV_VENV_CLEAR=1` to skip this prompt

This is a problem, because the script is intended to run without manual interaction. I would set UV_VENV_CLEAR=1 to skip the prompt. It seems uv fullfills the needed packages based on a cahce.

What do you suggest?

@filiplajszczak
Copy link
Copy Markdown
Contributor Author

filiplajszczak commented Apr 14, 2026

I just setup a new environment. When I run run_tests.sh twice, I get:

Using CPython 3.13.11
Creating virtual environment at: .venv
? A virtual environment already exists at `.venv`. Do you want to replace it? [y/n] › yes

hint: Use the `--clear` flag or set `UV_VENV_CLEAR=1` to skip this prompt

This is a problem, because the script is intended to run without manual interaction. I would set UV_VENV_CLEAR=1 to skip the prompt. It seems uv fullfills the needed packages based on a cahce.

What do you suggest?

Good catch. I’d use --allow-existing here instead of UV_VENV_CLEAR=1.

--clear would make the script non-interactive, but it would also recreate .venv on every run. --allow-existing keeps it non-interactive while preserving the existing environment. uv pip install -e '.[test]' would reconcile the environment against the requested requirements.

Copy link
Copy Markdown
Owner

@MaStr MaStr left a comment

Choose a reason for hiding this comment

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

That looks good, thank your very much!

@MaStr MaStr merged commit 3aa9b34 into MaStr:main Apr 14, 2026
10 checks passed
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