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

feat/uv support #284

Merged
merged 7 commits into from
Sep 1, 2024
Merged

feat/uv support #284

merged 7 commits into from
Sep 1, 2024

Conversation

blast-hardcheese
Copy link
Collaborator

Why

Resolve #244

What changed

  • Adding python3-uv backend

Test plan

CI, manual testing

@blast-hardcheese blast-hardcheese requested a review from a team as a code owner August 30, 2024 20:49
@blast-hardcheese blast-hardcheese requested review from ryantm and removed request for a team August 30, 2024 20:49
@blast-hardcheese blast-hardcheese changed the title Dstewart/feat/uv support feat/uv support Aug 30, 2024
Base automatically changed from dstewart/chore/reflow-test-populator to main August 30, 2024 21:07
Copy link
Collaborator

@ryantm ryantm left a comment

Choose a reason for hiding this comment

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

Yay uv. We'll only use it for hatchling.build for now, so this seems safe and looks good to me!

@blast-hardcheese blast-hardcheese enabled auto-merge (squash) August 30, 2024 21:26
@blast-hardcheese blast-hardcheese added the enhancement New feature or request label Aug 30, 2024
@blast-hardcheese blast-hardcheese force-pushed the dstewart/feat/uv-support branch 3 times, most recently from a40da7e to 2e14ea3 Compare September 1, 2024 03:29
@blast-hardcheese
Copy link
Collaborator Author

I relaxed the requirement for hatchling.build as uv apparently only uses it as the default, there are CLI flags to override it. I altered it to "so long as Poetry is not configured", since we only support the three currently.

@blast-hardcheese blast-hardcheese merged commit e95ee42 into main Sep 1, 2024
3 checks passed
@blast-hardcheese blast-hardcheese deleted the dstewart/feat/uv-support branch September 1, 2024 03:59
@AYA-123
Copy link

AYA-123 commented Sep 2, 2024

When installing python packages, will the default method of installation be via uv?

@AYA-123
Copy link

AYA-123 commented Sep 2, 2024

And using https://github.com/astral-sh/ruff for linting and code formatting (by the creators of uv), would also yield similarly fast and beneficial results.

@blast-hardcheese
Copy link
Collaborator Author

We're gradually rolling uv out to new Repls, starting with the agent. If you'd like to use it today, the easiest way is in a new repl:

  1. Make sure you have a python nixmodule installed (Either fork the Python template, run python at the shell and type Y to add the module, or use the Configuration pane to select a version of Python to use).
  2. upm add -l python3-uv add flask will create a new uv project, including making .pythonlibs a full virtualenv, and install flask. Subsequent operations inside Replit will correctly detect uv and use it.
  3. Occasionally, after rebuilding your Repl environment (for instance when changing nix channels), you'll notice that uv will delete and recreate your .pythonlibs directory.
    This is because the nix store path for the python executable may have been removed in the upgrade.

You can run replit-fsck after an upgrade to check whether any links or shebangs need to be patched, which should maintain your .pythonlibs even through an upgrade. This'll eventually be part of the full flow before we take uv GA.

Thanks for the interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for rye/ uv
3 participants