Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPy python 3.10 pip install pycapnp failed #364

Open
yzard opened this issue Aug 25, 2024 · 1 comment
Open

PyPy python 3.10 pip install pycapnp failed #364

yzard opened this issue Aug 25, 2024 · 1 comment

Comments

@yzard
Copy link

yzard commented Aug 25, 2024

The pypy version is PyPy 7.3.16 for python 3.10, pip version is 24.2

I did some experiments and find following:

Problems:

  1. _custom_build is not in tarball, so pyproject.toml cannot import it
  2. even previous problem get resolved by git clone and do python -m build . will failed to build wheel

python setup.py bdist_wheel will work as expected and I think setup,py is still the valid way to building wheel, but user even do pip install --no-use-pep517 pycapnp will still not work. so user with any python will need git clone and compile and build wheel by themselves.

Below is the error log for problem 1, select a python version that doesn't have wheel and upgrade to latest pip, and do below:

$ pip download pycapnp
Collecting pycapnp
  Using cached pycapnp-2.0.0.tar.gz (574 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/home/foobar/pypy310/lib/pypy3.10/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
  ...
  File "/home/foobar/pypy310/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "/home/foobar/pypy310/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "/home/foobar/pypy310/lib/pypy3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
  File "/home/zyin/.pyenv/versions/pypy3.10-7.3.16/lib/pypy3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'backend'

Below is the error log when git clone and do python -m build .

  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/command/bdist_wheel.py", line 384, in run
    self.run_command("build")
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/dist.py", line 948, in run_command
    super().run_command(command)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
    cmd_obj.run()
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/dist.py", line 948, in run_command
    super().run_command(command)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
    cmd_obj.run()
  File "<string>", line 187, in run
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
    self.build_extensions()
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
    self._build_extensions_serial()
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
    self.build_extension(ext)
  File "<string>", line 115, in build_extension
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 581, in build_extension
    self.compiler.link_shared_object(
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/ccompiler.py", line 757, in link_shared_object
    self.link(
  File "/tmp/build-env-wruaa2sp/lib/pypy3.10/site-packages/setuptools/_distutils/unixccompiler.py", line 268, in link
    linker = (
TypeError: 'NoneType' object is not subscriptable (key slice(None, None, None))

Here is the error log when doing pip install --no-use-pep517 pycapnp:

$ pip install --no-use-pep517 pycapnp
Collecting pycapnp
  Using cached pycapnp-2.0.0.tar.gz (574 kB)
ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of backend in pyproject.toml
kvelicka added a commit to kvelicka/pycapnp that referenced this issue Sep 24, 2024
This fixes build issues for installations that cannot use wheels
published on PyPI. Issue capnproto#364 would be fixed by this.

Python build tools like `python -m build` first build a source
distribuiton (sdist) and then use it (and only it) to build a binary
wheel from. This doesn't work if one of the build scripts isn't in the
sdist however, which was the case prior to this patch.
haata pushed a commit that referenced this issue Sep 25, 2024
This fixes build issues for installations that cannot use wheels
published on PyPI. Issue #364 would be fixed by this.

Python build tools like `python -m build` first build a source
distribuiton (sdist) and then use it (and only it) to build a binary
wheel from. This doesn't work if one of the build scripts isn't in the
sdist however, which was the case prior to this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@yzard and others