Skip to content

Use uv to install pytest environment #470

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

amilcarlucas
Copy link
Collaborator

This pull request updates the workflow configuration in .github/workflows/pytest.yml to integrate with the uv tool for managing Python environments, replacing the previous actions/setup-python step. This change simplifies environment setup and dependency installation.

Workflow updates for Python environment setup:

  • Replaced actions/setup-python with astral-sh/setup-uv to manage Python environments, enabling the activate-environment option for seamless integration.
  • Updated the dependency installation process to use uv pip install instead of directly invoking pip, aligning with the uv tool's workflow.

@Copilot Copilot AI review requested due to automatic review settings May 5, 2025 12:09
Copy link
Contributor

@Copilot 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 updates the GitHub Actions workflow for setting up a Python environment by replacing the previous setup step with the uv tool for environment management and dependency installation.

  • Replaced actions/setup-python with astral-sh/setup-uv.
  • Updated dependency installation to use uv pip install.
Comments suppressed due to low confidence (2)

.github/workflows/pytest.yml:52

  • Confirm that removing the explicit pip version installation is intentional, as it may impact environment consistency if pip updates lead to compatibility issues.
uv pip install .[dev]

.github/workflows/pytest.yml:48

  • [nitpick] Double-check that the 'activate-environment: true' flag is still required and correctly configured according to the latest uv documentation.
activate-environment: true

Copy link
Contributor

github-actions bot commented May 5, 2025

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 896277b.

♻️ This comment has been updated with latest results.

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 2 times, most recently from f1910db to b2c7135 Compare May 5, 2025 13:25
@amilcarlucas amilcarlucas requested a review from Copilot May 5, 2025 13:49
Copy link
Contributor

@Copilot 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 pull request updates the GitHub Actions workflow for Python environment setup by replacing the previous setup step with the uv tool.

  • Replaces actions/setup-python with astral-sh/setup-uv including the addition of the activate-environment option.
  • Consolidates dependency installation commands to use the uv pip command.

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 3 times, most recently from b1ac2e8 to 4718bf6 Compare May 24, 2025 18:27
@amilcarlucas amilcarlucas requested a review from Copilot May 24, 2025 18:27
Copilot

This comment was marked as outdated.

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 3 times, most recently from 7146684 to 83516df Compare May 26, 2025 10:19
@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 5 times, most recently from cb9ccfc to a8fa708 Compare June 15, 2025 23:49
Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Minor comments.

@amilcarlucas
Copy link
Collaborator Author

pip works fine here and all the tests do pass.

But I wanted to speed it up.
uv is one full minute faster, so I wanted to switch to it. But uv has issues, the tests no longer pass, it crashes at some GUI test :(
I tried to disable pip installation to see if that fixes the failing test, but it does not :(

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 2 times, most recently from 58b0bb8 to fd513d8 Compare June 19, 2025 13:35
@amilcarlucas amilcarlucas requested a review from Copilot June 19, 2025 13:44
Copy link
Contributor

@Copilot 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 replaces the existing actions/setup-python step in the pytest workflow with astral-sh/setup-uv to streamline environment management and aligns dependency installation with the uv tool.

  • Swapped out actions/setup-python for astral-sh/setup-uv and enabled activate-environment
  • Changed dependency installation from plain pip install to uv pip install
Comments suppressed due to low confidence (3)

.github/workflows/pytest.yml:45

  • Pinning to a specific commit can make upgrades harder and obscure version history. Consider using the official semver tag (e.g., v6.2.1) instead of a raw SHA for clarity and easier maintenance.
        uses: astral-sh/setup-uv@a02a550bdd3185dba2ebb6aa98d77047ce54ad21 # v6.2.1

.github/workflows/pytest.yml:52

  • [nitpick] This note is a bit vague—linking to an issue or briefly explaining the underlying failure would help future maintainers understand why the workaround is necessary.
          # pip causes unit tests to crash when combined with uv, so avoid installing it

.github/workflows/pytest.yml:53

  • [nitpick] The commented-out install command adds noise to the workflow file. If it’s no longer needed, consider removing it to keep the CI config clean.
          # uv pip install 'pip==25.1.1'

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 4 times, most recently from f6a0cc3 to 6673b1e Compare June 23, 2025 08:50
@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch from 6673b1e to eb3cb06 Compare June 25, 2025 13:32
@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch from eb3cb06 to 9429341 Compare July 18, 2025 10:21
@cclauss
Copy link
Contributor

cclauss commented Jul 18, 2025

uv v0.8... was released in the past 24 hours.

@amilcarlucas
Copy link
Collaborator Author

I just updated it to 6.4.1

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch from 095ed55 to a55c3d0 Compare July 19, 2025 17:03
@amilcarlucas
Copy link
Collaborator Author

I hope to have fixed this with commit 9469e1b

@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch 2 times, most recently from 6cac765 to 5014589 Compare July 25, 2025 21:27
@amilcarlucas amilcarlucas force-pushed the use_uv_on_pytest_job branch from 5014589 to 67bfecc Compare July 28, 2025 11:21
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.

2 participants