setup-sam: Error: Getting requirements to build wheel did not run successfully

The setup-sam@v2 build action is failing all our pipelines

the error message is- Getting requirements to build wheel did not run successfully

I get the following stack trace

exit code: 1 ╰─> [68 lines of output] /tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg` !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib3/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/_temp/setup-sam-ga5CTW/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1[234](https://github.com/CloudCall-Engineering/syncconnectors-bullhorn/actions/runs/5577482690/jobs/10190902096#step:4:238), in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
      self.find_sources()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
      mm.run()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
      self.add_defaults()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
      super().add_defaults()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line [251](https://github.com/CloudCall-Engineering/syncconnectors-bullhorn/actions/runs/5577482690/jobs/10190902096#step:4:255), in add_defaults
      self._add_defaults_ext()
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "/tmp/pip-build-env-w2zxlt4k/overlay/lib/python3.11/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. Error: The process ‘/home/runner/work/_temp/setup-sam-ga5CTW/.venv/bin/python’ failed with exit code 1`

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 35
  • Comments: 29 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same problem, enabling use-installer made it work for me:

      - uses: aws-actions/setup-sam@v2
        with:
            use-installer: true

https://github.com/aws-actions/setup-sam/pull/83 is merged and should now work. v2 points to https://github.com/aws-actions/setup-sam/commit/d388945c16af7a5b3da65436576e1c2be088f040.

Also could someone for who https://github.com/aws-actions/setup-sam/issues/82#issuecomment-1638483497 did not work provide some more information:

Also could someone that has use-installer: true post what is the error message and at what step does it happen? use-installer doesn’t use PyPI or pip at all, so it’s not clear to me why it wouldn’t work.

We haven’t been able to reproduce, so that information could help us improve.

@hoffa However, I don’t fully understand - Can customer specify which Python version to use in this GH Action? AFAIK, it’s only breaking when Python version is 3.10+

If using the recommended use-installer: true, it uses the native installers, skipping the separate Python interpreter and PyPI altogether.

Without it, the Python interpreter can be specified with the python option.

Sam here!

Still Not Working

@hamzashabbir11 Please elaborate, it’s difficult to help without more information.

  1. What exact workflow snippet is not working?

  2. What is the exact error logs that you observe?

  3. What is the error when you try using the example below?

      - uses: aws-actions/setup-sam@v2
        with:
            use-installer: true
    

Note also that you should be using v2, not v1, which hasn’t been updated for nearly 2 years.

I was already running with the use-installer parameter set to true - so I can confirm that at least for me, that is not a fix.

I had the same problem, enabling use-installer made it work for me:

      - uses: aws-actions/setup-sam@v2
        with:
            use-installer: true

image

Install the PyYAML 5.3.1 and then run pip install rasa. That works currently solving the PyYAML-5.4.1.tar.gz error until they update at Rasa.

Just run: pip install PyYAML==5.3.1 pip install rasa

Thanks for confirming and for your patience, closing now. If any issues persist, please open a new issue.


All, please make sure you’re using v2.

Also, I highly recommend adding use-installer: true going forward:

  - uses: aws-actions/setup-sam@v2
    with:
        use-installer: true

It will make installation a lot faster, it doesn’t use PyPI (hence not impacted by sudden transient dependency changes such as this), and doesn’t require a separate Python installation (i.e. you can get rid of actions/setup-python if you only used it for aws-actions/setup-sam).

Use https://github.com/aws-actions/setup-sam/issues/82#issuecomment-1638483497 as workaround. It’s the recommended approach in any case, and provides faster installation.

FYI if you’re not using use-installer, you can override PyPI dependency versions with e.g. https://github.com/aws-actions/setup-sam/issues/64#issuecomment-1368755583 or https://github.com/aws-actions/setup-sam/issues/64#issuecomment-1369724002. So something like this (from https://github.com/yaml/pyyaml/issues/724#issuecomment-1638636728) might also work (untested):

      - name: Hotfix for https://github.com/aws-actions/setup-sam/issues/82
        run: |
          $(dirname $(readlink $(which sam)))/pip install "cython<3.0.0"
          $(dirname $(readlink $(which sam)))/pip install --no-build-isolation pyyaml==5.4.1

Also could someone that has use-installer: true post what is the error message and at what step does it happen? use-installer doesn’t use PyPI or pip at all, so it’s not clear to me why it wouldn’t work.