0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

poetryからuvへの移行方法(Ubuntu)

Last updated at Posted at 2025-03-10

まえがき

poetryとuvはいずれもPythonの依存関係を管理するためのツールです。
uvはpoetryに比べ速度が早く、シンプルです。そのため、移行することで、開発フローがよりスムーズになる可能性があります。
以降、poetryからuvへの移行方法を説明します。

poetryからuvへの移行方法

uvのインストール

ubuntu上で以下のコマンドを実行しuvをインストールします。

$ sudo snap install astral-uv --classic

(他にもpip install uvとかの方法もあります。)
以下のコマンドを実行し、正常にuvがインストールされていることを確認します。

$ uv --version

最後にpoetry.lockが存在するディレクトリで以下のコマンドを実行します。

$ uvx migrate-to-uv

以上でpoetryからuvへの移行は完了です。

移行の確認

移行が成功していれば以下の3点が満たされているはずです。

  • 元あったpoetry.lockファイルは削除されている
  • uv.lockファイルが生成されている
  • pyproject.toml内のtool.poetryの部分がtool.uvに置き換わっている

これらを満たしていることが確認できれば正常に移行出来ていると思います。

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?