22
10

More than 1 year has passed since last update.

Poetry1.2 のリリースで個人的に重要であったこと、既存環境で加えた変更

Last updated at Posted at 2022-09-01

2022/08/31 に Poetry 1.2.0 がリリースされました。これまで動いていたものが動かなくなったという話も聞いたので、ドキュメントを読んで少し動かしてみました。その上で個人的に重要であったこと、既存環境で加えた変更をメモします。

個人的に重要だった変更

依存パッケージのグループ化ができるようになった

プラグインの機構が備わって、 poetry export はプラグインの機能になった

  • poetry export のプラグインは将来的に別途 install する必要がある
  • install 済みの pluginpoetry self show plugins で確認できる

Poetry 1.2 は 1.1 によって生成された lock file を理解し、Poetry 1.1 は 1.2 によって生成された lock file を理解する

poetry.lock と pyproject.toml の整合性をチェックする poetry lock --check option の追加

既存環境で加えた変更

poetry の設定ファイルの場所を変更 (Mac環境)

Configuration file exists at <my_home_dir>/Library/Application Support/pypoetry, reusing this directory.

Consider moving configuration to <my_home_dir>/Library/Preferences/pypoetry, as support for the legacy directory will be removed in an upcoming release.

上記のような警告がでるようになったので、config.tomlを移動した

$ mkdir -p ~/Library/Preferences/pypoetry
$ mv ~"/Library/Application Support/pypoetry/config.toml" ~/Library/Preferences/pypoetry/config.toml

pyproject.toml の tool.poetry.dev-dependencies を tool.poetry.group.dev.dependencies に変更

理由は https://python-poetry.org/blog/announcing-poetry-1.2.0/#dependency-groups に記載がある

関連リンク

https://python-poetry.org/blog/announcing-poetry-1.2.0
https://github.com/python-poetry/poetry
https://github.com/python-poetry/poetry-plugin-export
https://pypi.org/project/poetry-plugin-export/

22
10
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
22
10