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

Migrate from Poetry to UV #9501

Closed
lluisCM opened this issue Nov 28, 2024 · 5 comments
Closed

Migrate from Poetry to UV #9501

lluisCM opened this issue Nov 28, 2024 · 5 comments
Labels
question Asking for clarification or support

Comments

@lluisCM
Copy link

lluisCM commented Nov 28, 2024

Hello, I'm not sure if this is the place to post a question, but I would like to get some feedback/experience on relation of replacing poetry to uv.

I'm looking to migrate from Poetry to UV. But my only concern is that UV seems to not provide a build backend, so what is the recommended way to structure the pyproject.toml file? Should I still install poetry, pdm or hatchling as a build systems? In that case, isn't a better option to just use poetry (for example) to manage the project and uv for venv etc... but not for the pyproject.toml file?

I'm specifically referring to this section:

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Thank you.

@FishAlchemist
Copy link
Contributor

FishAlchemist commented Nov 28, 2024

UV currently doesn't have a backend built, so it should be difficult to handle functions that require a backend.

However, besides build backend, there are still many replaceable functions, so it depends on whether the functions you need require a backend.

@lluisCM
Copy link
Author

lluisCM commented Nov 28, 2024

Be able to generate the .whl file, building and install the current project and probably prepare it to publish to PyPi requires a backend, right?
So what is the recommended way to proceed? which backend is recommended/supported to use?
Thank you.

@konstin
Copy link
Member

konstin commented Nov 28, 2024

Until uv has its own backend, you can use hatchling or the pdm backend:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

uv works with all of them, you can use the backend you like best. For new projects, uv init has a --build-backend option, the default is hatchling, which should cover most use cases (also coming from poetry).

@konstin konstin added the question Asking for clarification or support label Nov 28, 2024
@laudmt
Copy link

laudmt commented Nov 29, 2024

Having personally passed a few projects from poetry to uv, I encountered an issue with hatchling, which had trouble to find the correct compiler.

Adding this fixed it:

export CC=gcc 
export AR=ar

I believe it is related to this issue : #8429

@lluisCM
Copy link
Author

lluisCM commented Dec 2, 2024

Until uv has its own backend, you can use hatchling or the pdm backend:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
uv works with all of them, you can use the backend you like best. For new projects, uv init has a --build-backend option, the default is hatchling, which should cover most use cases (also coming from poetry).

Thank you for the clarification.

@zanieb zanieb closed this as completed Dec 2, 2024
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

5 participants