Skip to content

chore: use uv for dep management#4221

Closed
Xuanwo wants to merge 21 commits intolance-format:mainfrom
Xuanwo:use-uv-instead
Closed

chore: use uv for dep management#4221
Xuanwo wants to merge 21 commits intolance-format:mainfrom
Xuanwo:use-uv-instead

Conversation

@Xuanwo
Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo commented Jul 14, 2025

Close #4138

This PR only introduces uv, and in subsequent ones, we will gather any missing dependencies in pyconfig.toml like uv pip install --system -r docs/requirements.txt.

Xuanwo added 2 commits July 14, 2025 16:43
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@github-actions
Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@Xuanwo Xuanwo changed the title chore(python): use uv for dep management chore: use uv for dep management Jul 14, 2025
@Xuanwo Xuanwo changed the title chore: use uv for dep management chore: use uv for dep management Jul 14, 2025
Xuanwo added 2 commits July 14, 2025 17:30
@Xuanwo Xuanwo marked this pull request as draft July 14, 2025 14:55
Comment thread python/DEVELOPMENT.md
Comment thread python/Makefile
Comment thread .gitignore
Copy link
Copy Markdown

@PsiACE PsiACE left a comment

Choose a reason for hiding this comment

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

Using [dependency-groups] in pyproject.toml for uv to manage development, documentation, and test dependencies is a great idea.

for big project, use uv workspace

@Xuanwo
Copy link
Copy Markdown
Collaborator Author

Xuanwo commented Jul 17, 2025

Thank you, will take a look over uv workspace

@jackye1995
Copy link
Copy Markdown
Contributor

@Xuanwo I just moved to use uv workspace for lance namespace: https://github.com/lancedb/lance-namespace

It works pretty well with a shared uv.lock, everything is installed with a single uv sync --all-packages, seems pretty nice so far.

Xuanwo added 2 commits August 7, 2025 17:29
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo marked this pull request as ready for review August 7, 2025 10:44
Xuanwo added 2 commits August 7, 2025 18:46
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo
Copy link
Copy Markdown
Collaborator Author

Xuanwo commented Aug 7, 2025

cc @jackye1995 to take another look

Signed-off-by: Xuanwo <github@xuanwo.io>
Comment thread python/pyproject.toml
Comment on lines +94 to +95
# Optional heavy dependencies
ray = ["ray[data]<2.38; python_version<'3.12'"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hope eventually we can put tensorflow, duckdb, polars and others over here. I think our "core test dependencies" really should just by pytest and pytest-benchmark.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what would be the difference? When we run a test that involves one of these dependencies, we still would need to install it. Do you expect we also separate out those tests agaisnt tensorflow, duckdb, etc. so normal pytest only tests core functionalities?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I think it would be nice to have test just cover all core tests.

Then an integration-tests dependency list to install heavy depencies like tensorflow and torch.

It's pretty easy in pytest to skip a test if a dependency is not found using pytest.importorskip(): https://docs.pytest.org/en/stable/how-to/skipping.html#skipping-on-a-missing-import-dependency

Xuanwo added 2 commits August 8, 2025 14:24
Signed-off-by: Xuanwo <github@xuanwo.io>
Xuanwo added 7 commits August 8, 2025 17:15
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

This looks great!

Comment thread python/pyproject.toml
Comment on lines +94 to +95
# Optional heavy dependencies
ray = ["ray[data]<2.38; python_version<'3.12'"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I think it would be nice to have test just cover all core tests.

Then an integration-tests dependency list to install heavy depencies like tensorflow and torch.

It's pretty easy in pytest to skip a test if a dependency is not found using pytest.importorskip(): https://docs.pytest.org/en/stable/how-to/skipping.html#skipping-on-a-missing-import-dependency

@Xuanwo
Copy link
Copy Markdown
Collaborator Author

Xuanwo commented Nov 10, 2025

Will work on a new one.

@Xuanwo Xuanwo closed this Nov 10, 2025
Xuanwo added a commit that referenced this pull request Mar 30, 2026
This updates the Python contributor docs to prefer `uv` for local
environment initialization and day-to-day command execution, while
keeping the documented `Makefile` targets unchanged.

I intentionally did not migrate CI in this PR. We have already tried
broader `uv` rollouts in #4221 and are still carrying a larger CI
refactor in #5210; the current Python workflows still have materially
different dependency shapes across lint, wheel-install test, benchmark,
and optional Torch / TensorFlow / Ray paths, so I don't see a single
environment definition we can switch to safely without a dedicated CI
pass.

This keeps the local guidance moving in the right direction without
pretending the CI environment has already been unified. No tests were
run because this is a docs-only change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate our python workflow to uv

4 participants