Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

support pep517 builds - poetry install on Mac fails

オープン
#133 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

README の回避策から始め、Homebrew で Snappy をインストールした macOS 上で、pip wheel --no-cache-dir --use-pep517 "python-snappy (==0.6.1)" と Poetry を使って失敗を再現します。PEP 517 のビルドバックエンドとパッケージング設定を追跡します。poetry install で CPPFLAGS を手動設定せずに python-snappy をビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

On MacOS 14.3, python 3.11.7, in a project that needs python-snappy as a dependency of another library (in this case, localstack). After installing snappy with brew, the attempt to build python-snappy fails with:

 • Installing python-snappy (0.6.1): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel
  
  /private/var/folders/s1/ls1zsdv57yj_hxx0ldh9h6jh0000gn/T/tmp2shjyr97/.venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'cffi_modules'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-14-x86_64-cpython-311
  creating build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/snappy.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/snappy_cffi.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/__init__.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/hadoop_snappy.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/snappy_formats.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/__main__.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  copying src/snappy/snappy_cffi_builder.py -> build/lib.macosx-14-x86_64-cpython-311/snappy
  running build_ext
  building 'snappy._snappy' extension
  creating build/temp.macosx-14-x86_64-cpython-311
  creating build/temp.macosx-14-x86_64-cpython-311/src
  creating build/temp.macosx-14-x86_64-cpython-311/src/snappy
  clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/private/var/folders/s1/ls1zsdv57yj_hxx0ldh9h6jh0000gn/T/tmp2shjyr97/.venv/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/snappy/crc32c.c -o build/temp.macosx-14-x86_64-cpython-311/src/snappy/crc32c.o
  clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/private/var/folders/s1/ls1zsdv57yj_hxx0ldh9h6jh0000gn/T/tmp2shjyr97/.venv/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/snappy/snappymodule.cc -o build/temp.macosx-14-x86_64-cpython-311/src/snappy/snappymodule.o
  src/snappy/snappymodule.cc:33:10: fatal error: 'snappy-c.h' file not found
  #include <snappy-c.h>
           ^~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  

  at /usr/local/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with python-snappy (0.6.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "python-snappy (==0.6.1)"'.

I can manually cause python-snappy to be built with pip, outside of the pep517 / poetry infrastructure, with a workaround command such as the one in the README, e.g. for me:

CPPFLAGS="-I$(brew --prefix)/include -L$(brew --prefix)/lib" poetry run pip install python-snappy

This works but is really frustrating - I see there are quite a lot of MacOS-related build issues already, and am trying to avoid raising a duplicate.

Obviously I'd prefer that the build script just worked entirely, but even if I had to manually set CPPFLAGS it would be a big improvement if python-snappy were to support PEP 517 builds directly.

主要言語
Python
スター
490
フォーク
104
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intake/python-snappy のほかの issue

intake/python-snappy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。