Skip to content

add uv.lock support #1425

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 30 commits into
base: main
Choose a base branch
from
Open

add uv.lock support #1425

wants to merge 30 commits into from

Conversation

cataggar
Copy link
Member

@cataggar cataggar commented Jun 6, 2025

This is an attempt to get uv support started by adding a UvLockComponentDetector.

Hopefully, I am on the right track. Let me know.

uv is gaining adoption within Microsoft. I have been moving Python projects for Azure that I help manage to it. Relevant sections from a Makefile look like this:

venv:
	# create a virtual environment and download the locked dependencies
	uv sync --locked 2>&1

test:
	# run unit tests
	uv run -m pytest tests
	# check dependencies
	uv run -m deptry . 2>&1

test-coverage:
	# run unit tests along with the code coverage
	uv run -m pytest --cov --cov-config=.coveragerc --cov-report=xml:report.xml
	# check dependencies
	uv run -m deptry . 2>&1

clean:
	rm -rf .venv

lock:
	# updates uv.lock
	uv sync
	# updates requirements.txt for component-detection
	uv pip compile --python-platform linux pyproject.toml -o requirements.txt

The lock target exports a requirements.txt so that this tool can detect security vulnerabilities. See https://docs.astral.sh/uv/concepts/projects/sync/ . This feature would allow us to skip that workaround. It also will allow additional details to be added in follow-up pull requests.

@cataggar cataggar requested a review from a team as a code owner June 6, 2025 16:52
@cataggar cataggar requested a review from FernandoRojo June 6, 2025 16:52
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.9%. Comparing base (2a41d42) to head (98d6def).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1425     +/-   ##
=======================================
+ Coverage   89.7%   89.9%   +0.1%     
=======================================
  Files        407     413      +6     
  Lines      32379   32886    +507     
  Branches    2000    2026     +26     
=======================================
+ Hits       29072   29580    +508     
  Misses      2881    2881             
+ Partials     426     425      -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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