suned / pfun

Functional, composable, asynchronous, type-safe Python.

Home Page:https://pfun.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR: Could not build wheels for pfun, which is required to install pyproject.toml-based projects

cjwcommuny opened this issue · comments

commented

Try to install pfun, but got this error:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pfun
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ca/0c/fe5994e374e651195455176a703b903590d55067c6b9ad8b1637fbd5e271/pfun-0.13.0.tar.gz (411 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 411.2/411.2 KB 995.5 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting typing-extensions<4.0.0.0,>=3.10.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting dill<0.4.0,>=0.3.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/c3/973676ceb86b60835bb3978c6db67a5dc06be6cfdbd14ef0f5a13e3fc9fd/dill-0.3.4-py2.py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.9/86.9 KB 1.4 MB/s eta 0:00:00
Building wheels for collected packages: pfun
  Building wheel for pfun (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pfun (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]
      A setup.py file already exists. Using it.
      running build
      running build_py
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/functions.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/immutable.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/logging.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/console.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/files.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/either.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/lens.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/list.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/protocols.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/subprocess.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/clock.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/functor.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/operator.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/hypothesis_strategies.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/__init__.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/monad.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/maybe.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/random.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/mypy_plugin.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/http.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/dict.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/schedule.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/sql.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/aio_trampoline.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/trampoline.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/state.py -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/effect.c -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/effect.pyx -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/py.typed -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      copying src/pfun/effect.pyi -> /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/lib.macosx-11.0-arm64-3.10/pfun
      running build_ext
      building 'pfun.effect' extension
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/temp.macosx-11.0-arm64-3.10
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/temp.macosx-11.0-arm64-3.10/src
      creating /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/temp.macosx-11.0-arm64-3.10/src/pfun
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/py310/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/envs/py310/include -arch arm64 -I/opt/homebrew/Caskroom/miniforge/base/envs/py310/include/python3.10 -c src/pfun/effect.c -o /private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build/temp.macosx-11.0-arm64-3.10/src/pfun/effect.o
      src/pfun/effect.c:99766:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                        ^
      src/pfun/effect.c:99766:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
                  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/pfun/effect.c:99771:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                        ^
      src/pfun/effect.c:99771:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
                  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/pfun/effect.c:99854:19: error: implicit declaration of function '_PyGen_Send' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                  ret = _PyGen_Send((PyGenObject*)yf, NULL);
                        ^
      src/pfun/effect.c:99854:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
                  ret = _PyGen_Send((PyGenObject*)yf, NULL);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      3 warnings and 3 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      Traceback (most recent call last):
        File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-build-env-u0rxq0ki/overlay/lib/python3.10/site-packages/poetry/core/masonry/api.py", line 68, in build_wheel
          return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory)))
        File "/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-build-env-u0rxq0ki/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 78, in make_in
          wb.build()
        File "/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-build-env-u0rxq0ki/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 110, in build
          self._build(zip_file)
        File "/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-build-env-u0rxq0ki/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 162, in _build
          self._run_build_command(setup)
        File "/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-build-env-u0rxq0ki/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 190, in _run_build_command
          subprocess.check_call(
        File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/homebrew/Caskroom/miniforge/base/envs/py310/bin/python3.10', '/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/setup.py', 'build', '-b', '/private/var/folders/c2/g2sfnqts07l89jtmgz0jrtlr0000gn/T/pip-install-awoxy_eh/pfun_1b12f692690344c9aaaf31bd2515e210/build']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pfun
Failed to build pfun
ERROR: Could not build wheels for pfun, which is required to install pyproject.toml-based projects

Environment

python=3.10.2
platform: Apple Silicon

Hi! Thanks for the report. I can reproduce the error with a python 3.10 venv on an x86 machine, so I'm guessing its not related to compiling for apple arm architecture. Looking into it 👍

Hi again, thanks for the patience! I tracked down the issue to illegal code generation with Cython in Python 3.10. Fixed by simply bumping the alpha of Cython in #101. In addition I've added publishing a wheel to the CI/CD which may enable installing without building from src in python 3.10. Not sure if this works on apple silicon though. I see that ARM based macos is not yet supported on github actions (actions/runner-images#2187), and I suspect I will need that environment for you to take advantage of the wheel. But for anyone else using pfun on x86 architecture on macos or linux, you should be able to install from the wheel.

I'll release the fix shortly as version 0.13.1