astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
12.08k stars 425 forks source link

Unable to install `playsound` with rye, but works with pip (Python 3.12) #1131

Closed asmith26 closed 4 weeks ago

asmith26 commented 4 weeks ago

Steps to Reproduce

$ rye init hello
$ cd hello
$ rye add playsound

Expected Result

It to successfully install. In particular, if I instead install it via pip, it works:

$ rye add pip

Added pip>=24.0 as regular dependency
Reusing already existing virtualenv
Generating production lockfile: /tmp/hello/requirements.lock
Generating dev lockfile: /tmp/hello/requirements-dev.lock
Installing dependencies
   Built file:///tmp/hello                                                Built 1 editable in 313ms
Uninstalled 1 package in 1ms
Installed 2 packages in 124ms
 - hello==0.1.0 (from file:///tmp/hello)
 + hello==0.1.0 (from file:///tmp/hello)
 + pip==24.0
Done!

$ rye run pip install playsound

Collecting playsound
  Using cached playsound-1.3.0-py3-none-any.whl
Installing collected packages: playsound
Successfully installed playsound-1.3.0

Actual Result

error: Failed to run uv compile error: Failed to download and build `playsound==1.3.0`
  Caused by: Failed to build: `playsound==1.3.0`
  Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
--- stdout:

--- stderr:
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "~/.cache/uv/.tmprdaGgF/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.cache/uv/.tmprdaGgF/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "~/.cache/uv/.tmprdaGgF/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
    super().run_setup(setup_script=setup_script)
  File "~/.cache/uv/.tmprdaGgF/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 6, in <module>
  File "~/.rye/py/cpython@3.12.3/lib/python3.12/inspect.py", line 1278, in getsource
    lines, lnum = getsourcelines(object)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "~/.rye/py/cpython@3.12.3/lib/python3.12/inspect.py", line 1260, in getsourcelines
    lines, lnum = findsource(object)
                  ^^^^^^^^^^^^^^^^^^
  File "~/.rye/py/cpython@3.12.3/lib/python3.12/inspect.py", line 1089, in findsource
    raise OSError('could not get source code')
OSError: could not get source code
---
. uv exited with status: exit status: 2

Version Info

$ rye --version

rye 0.34.0
commit: 0.34.0 (d31340178 2024-05-20)
platform: linux (x86_64)
self-python: cpython@3.12.3
symlink support: true
uv enabled: true

Many thanks for any help!

charliermarsh commented 4 weeks ago

Unfortunately playsound is not PEP 517 compatible -- it also fails with pip install --use-pep517: https://github.com/astral-sh/uv/issues/2252#issuecomment-1981973117

asmith26 commented 4 weeks ago

Thanks for the clarification @charliermarsh. I'll close this in favour of https://github.com/astral-sh/uv/issues/2252#issuecomment-1981973117

charliermarsh commented 4 weeks ago

Thanks!