0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Python】hatchでPyPIの二要素認証を解決する

Posted at

hatchとは

hatchはPythonのプロジェクトマネージャーです。プロジェクト管理用の便利なコマンドが揃っているという長所と、検索するとmatplotlibの引数のhatch=が引っ掛かってしまうという短所があります。
日本語の記事ではこちらなど参考になります。

PyPIの二要素認証

PyPIアカウントを二要素認証にしないとダメになりました。

それ自体はいいんですが、トークンをhatchに教える必要があります。でないとhatch publishが使えなくなります (403エラーが出る)。

どうすればよいか

以下のコマンドを叩きます。

$ hatch publish --user __token__

すると

Credentials:

みたいなのが求められるので、pypi-*****みたいなとても長いトークンをコピペすればOKです。

(ちなみにPowerShellでやったらペーストしても何も文字が増えず、ペーストが禁止されているのかと思って絶望しましたが、単に文字が表示されない仕様でした)

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?