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

Migration command/guide? #9737

Open
samuelcolvin opened this issue Dec 9, 2024 · 3 comments
Open

Migration command/guide? #9737

samuelcolvin opened this issue Dec 9, 2024 · 3 comments
Labels
question Asking for clarification or support

Comments

@samuelcolvin
Copy link

Is there any command or migration guide for converting an existing project to using uv?

uv init doesn't work, and I'm a bit unclear on the steps required.

(I maintain too many packages, I'm excited about uv making that maintenance easier, not looking forward to the overhead of migration)

@samuelcolvin
Copy link
Author

from samuelcolvin/rtoml#85 it seems like the process is:

  • create a .python-version file if you don't want to use 3.13 by default
  • start adding dev dependencies uv add --dev ...

That's kind of all, then you need to update all the places you used your old build system, but no command could help with that.

I think a short section in the docs is all that's needed.

@AlexWaygood AlexWaygood added the documentation Improvements or additions to documentation label Dec 9, 2024
@zanieb
Copy link
Member

zanieb commented Dec 9, 2024

Docs work is tracked in #5200

There was a proposed change adding uv add -r pyproject.toml support but it never got finished due to concerns about expectations around what would be copied.. can't find it right now. Perhaps 9fec29d

There's also #6374 which is similar.

I'd like uv init to "work" with an existing pyproject.toml, but I'm not sure what the behaviors should be yet.

@zanieb zanieb added question Asking for clarification or support and removed documentation Improvements or additions to documentation labels Dec 9, 2024
@rbavery
Copy link

rbavery commented Dec 12, 2024

I've been following the steps here for three projects and they have worked well. I also make changes to make uv's integration with pytorch sources work.

torchgpu = [
    "torch==2.5.1+cu121",
    "torchvision==0.20.1+cu121",
]

[[tool.poetry.source]]
name = "pytorch-gpu"
url = "https://download.pytorch.org/whl/cu121"
verify_ssl = true

becomes

torchgpu = [
    "torch==2.5.1",
    "torchvision==0.20.1",
]

[[tool.uv.index]]
name = "pytorch-cu121"
url = "https://download.pytorch.org/whl/cu121"
explicit = true

[tool.uv.sources]
torch = [
  { index = "pytorch-cu121", marker = "platform_system != 'Darwin'"},
]
torchvision = [
  { index = "pytorch-cu121", marker = "platform_system != 'Darwin'"},
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

4 participants