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

[pre-commit] Error: Getting requirements to build wheel failed due to AttributeError: cython_sources #2506

Closed
benjaminmah opened this issue Oct 16, 2024 · 4 comments · Fixed by #2508
Assignees
Labels

Comments

@benjaminmah
Copy link
Contributor

Steps to reproduce:

  • Python 3.12.3
  • Install requirements.txt
  • Install requirements-test.txt
  • git add <filename>
  • git commit

The following error is encountered:

Getting requirements to build wheel: finished with status 'error'
stderr:
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [54 lines of output]
          running egg_info
          writing lib/PyYAML.egg-info/PKG-INFO
          writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
          writing top-level names to lib/PyYAML.egg-info/top_level.txt
          Traceback (most recent call last):
            File "/Users/bmah/.cache/pre-commit/repo4o958tkq/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
              main()
            File "/Users/bmah/.cache/pre-commit/repo4o958tkq/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/Users/bmah/.cache/pre-commit/repo4o958tkq/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
              return hook(config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
              return self._get_build_requires(config_settings, requirements=[])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
              self.run_setup()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
              exec(code, locals())
            File "<string>", line 288, in <module>
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
              return distutils.core.setup(**attrs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 183, in setup
              return run_commands(dist)
                     ^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
              dist.run_commands()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
              self.run_command(cmd)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 991, in run_command
              super().run_command(command)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
              cmd_obj.run()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 315, in run
              self.find_sources()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 323, in find_sources
              mm.run()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 544, in run
              self.add_defaults()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 582, in add_defaults
              sdist.add_defaults(self)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 108, in add_defaults
              super().add_defaults()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 238, in add_defaults
              self._add_defaults_ext()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 323, in _add_defaults_ext
              self.filelist.extend(build_ext.get_source_files())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "<string>", line 204, in get_source_files
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-q3y20csu/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
              raise AttributeError(attr)
          AttributeError: cython_sources
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
Check the log at /Users/bmah/.cache/pre-commit/pre-commit.log
@suhaibmujahid
Copy link
Member

@benjaminmah could you revert the change in 86b3768 and see if that fixes it for you?

@benjaminmah
Copy link
Contributor Author

@benjaminmah could you revert the change in 86b3768 and see if that fixes it for you?

Yes! Reverting this change seemed to fix the problem on my end.

@suhaibmujahid
Copy link
Member

@benjaminmah does it work if you remove types-PyYAML?

- types-PyYAML==6.0.8

@benjaminmah
Copy link
Contributor Author

@benjaminmah does it work if you remove types-PyYAML?

- types-PyYAML==6.0.8

Unfortunately no, I get an error:

An unexpected error has occurred: CalledProcessError: command: ('/Users/bmah/.cache/pre-commit/repolkayvwjh/py_env-python3.12/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing /Users/bmah/.cache/pre-commit/repolkayvwjh
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    Collecting json-e==4.5.2 (from taskcluster_yml_validator==0.0.10)
      Using cached json_e-4.5.2-py3-none-any.whl.metadata (482 bytes)
    Collecting jsonschema==4.17.3 (from taskcluster_yml_validator==0.0.10)
      Using cached jsonschema-4.17.3-py3-none-any.whl.metadata (7.9 kB)
    Collecting pyyaml==6.0 (from taskcluster_yml_validator==0.0.10)
      Using cached PyYAML-6.0.tar.gz (124 kB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'error'
stderr:
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [54 lines of output]
          running egg_info
          writing lib/PyYAML.egg-info/PKG-INFO
          writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
          writing top-level names to lib/PyYAML.egg-info/top_level.txt
          Traceback (most recent call last):
            File "/Users/bmah/.cache/pre-commit/repolkayvwjh/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
              main()
            File "/Users/bmah/.cache/pre-commit/repolkayvwjh/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/Users/bmah/.cache/pre-commit/repolkayvwjh/py_env-python3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
              return hook(config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
              return self._get_build_requires(config_settings, requirements=[])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
              self.run_setup()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
              exec(code, locals())
            File "<string>", line 288, in <module>
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
              return distutils.core.setup(**attrs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 183, in setup
              return run_commands(dist)
                     ^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
              dist.run_commands()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
              self.run_command(cmd)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 991, in run_command
              super().run_command(command)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
              cmd_obj.run()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 315, in run
              self.find_sources()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 323, in find_sources
              mm.run()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 544, in run
              self.add_defaults()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 582, in add_defaults
              sdist.add_defaults(self)
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 108, in add_defaults
              super().add_defaults()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 238, in add_defaults
              self._add_defaults_ext()
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 323, in _add_defaults_ext
              self.filelist.extend(build_ext.get_source_files())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "<string>", line 204, in get_source_files
            File "/private/var/folders/mw/kxsnfh6d29s5z9hsmm8n6ffr0000gn/T/pip-build-env-vnl9l3bl/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
              raise AttributeError(attr)
          AttributeError: cython_sources
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants