0
0

More than 1 year has passed since last update.

Pipfileで対象ファイルのhashの変更を無視する

Posted at

背景

  • 自作のpythonパッケージ(tar.gz)を別プロジェクトでpipenv installして使いたい
  • パッケージをビルドし直す度に、ファイルのhashが変わるためPipfile.lockに記載されているhashと不一致になるためpipenv installでエラーになる
  • Pipfileにパラメータを追加するなどして回避したい

結果

  • Pipfileのパラメータでは対応できなかった
  • 回避策として、pipenv installする際に、--skip-lockパラメータを使うようにした

pipenv install --skip-lock

参考:https://pipenv-ja.readthedocs.io/ja/translate-ja/basics.html#pipenv-install

--skip-lock — Pipfile.lock を無視し、 Pipfile を使ってインストールします。 それに加えて、 Pipfile の変更部分を Pipfile.lock へは反映しません。
動作としては、
- Pipfile.lockが存在しなければ作成しない
- Pipfile.lockが存在しても記載されている内容は無視される。また、変更部分の反映もされない。
Pipfile.lockが存在する状態で--skip-lockを使用すると、実態とPipfile.lockが乖離してしまうのでよろしくないと思いました。
Pipfile.lockが無くても困らないのであれば有効かと思います。

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