Skip to content
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

Switch to uv python tool #579

Merged
merged 39 commits into from
Jan 20, 2025
Merged

Switch to uv python tool #579

merged 39 commits into from
Jan 20, 2025

Conversation

jeremyestein
Copy link
Contributor

@jeremyestein jeremyestein commented Dec 16, 2024

Description

Switch to using the uv Python package manager in all places: docker builds, GHA, and dev instructions.

Known TODOs:

  • documentation still refers to pip
  • explicitly copying all pyproject.toml files in the Dockerfiles is a bit ugly, but can't find a better way
  • The base branch needs some work (see PR comment)
  • uv sync --all-extras --all-packages is currently needed to get pytest. I'd expect just extras to be needed. Do I need to add extras section to root pyproject and link to workspace extras?
  • Do we need a mechanism to ensure that changes to pyproject.toml files are reflected in the uv.lock file so it can be committed too?
  • Why do we need to specify setuptools in pixl_dcmd just for the sake of pydicom? Shouldn't it be responsible for its own dependencies?
  • Do we need to make use of dependency groups?

Type of change

Please delete options accordingly to the description.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Suggested Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have passed on my local host device. (see further details at the CONTRIBUTING document)
  • Make sure your branch is up-to-date with main branch. See CONTRIBUTING for a general example to syncronise your branch with the main branch.
  • I have requested review to this PR.
  • I have addressed and marked as resolved all the review comments in my PR.
  • Finally, I have selected squash and merge

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.41%. Comparing base (dca65ca) to head (be5f8fb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pixl_core/src/core/patient_queue/subscriber.py 0.00% 1 Missing ⚠️
pytest-pixl/src/pytest_pixl/helpers.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #579   +/-   ##
=======================================
  Coverage   87.41%   87.41%           
=======================================
  Files          76       76           
  Lines        3425     3425           
=======================================
  Hits         2994     2994           
  Misses        431      431           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jeremyestein jeremyestein changed the base branch from main to jeremy/refactor-dockerfiles December 21, 2024 12:33
@jeremyestein jeremyestein marked this pull request as ready for review December 21, 2024 12:36
Base automatically changed from jeremy/refactor-dockerfiles to main January 6, 2025 17:50
Copy link
Contributor

@p-j-smith p-j-smith left a comment

Choose a reason for hiding this comment

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

this is looking really good - will be nice to switch to uv. Just a couple of comments at the minute, plus:

Do we need a mechanism to ensure that changes to pyproject.toml files are reflected in the uv.lock file so it can be committed too?

renovate should update both the pyproject.toml and uv.lock files at the same time

.github/workflows/main.yml Outdated Show resolved Hide resolved
pixl_dcmd/pyproject.toml Show resolved Hide resolved
@jeremyestein
Copy link
Contributor Author

jeremyestein commented Jan 8, 2025

this is looking really good - will be nice to switch to uv. Just a couple of comments at the minute, plus:

Do we need a mechanism to ensure that changes to pyproject.toml files are reflected in the uv.lock file so it can be committed too?

renovate should update both the pyproject.toml and uv.lock files at the same time

(Recording our earlier discussion) I was talking was about developer-initiated changes to pyproject.toml. This has been solved by adding a pre-commit check that runs uv lock which brings the lock file up to date.

@jeremyestein
Copy link
Contributor Author

I have changed all the pip install commands in the docs to basically a uv sync. I wasn't always sure of the intent of the docs that I changed, but fixing that is a separate task ( #591 ).

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

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

Chef's kiss. Some suggestions, happy for you to merge without another review after you've addressed them to your satisfaction

docker/pixl-python/Dockerfile Outdated Show resolved Hide resolved
docs/setup/developer.md Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@p-j-smith p-j-smith left a comment

Choose a reason for hiding this comment

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

looking great. One minor suggestion around specifying the python version with uv. Alternatively, we could add a .python-version file that uv will detect. Happy with whatever you decide

docs/setup/developer.md Outdated Show resolved Hide resolved
docs/setup/developer.md Outdated Show resolved Hide resolved
@jeremyestein jeremyestein merged commit 4afca8a into main Jan 20, 2025
10 of 11 checks passed
@jeremyestein jeremyestein deleted the jeremy/uv-python branch January 20, 2025 17:12
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