aws-actions / setup-sam

Action to set up AWS SAM CLI and add it to the PATH
Apache License 2.0
151 stars 23 forks source link

Error: Getting requirements to build wheel did not run successfully #82

Closed cc-simon closed 1 year ago

cc-simon commented 1 year ago

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 insetup.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`

justinwb commented 1 year ago

Can also confirm that I'm now seeing the same behavior

hiramhuang commented 1 year ago

Same issue here

CesarCarrillo91 commented 1 year ago

Same here.

cortex commented 1 year ago

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

      - uses: aws-actions/setup-sam@v2
        with:
            use-installer: true
justinwb commented 1 year ago

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
cc-simon commented 1 year ago

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

Same I tried this too, it didn't help

gastonsilva commented 1 year ago

https://github.com/yaml/pyyaml/issues/724 https://github.com/yaml/pyyaml/issues/601

arantesxyz commented 1 year ago

Sam here!

DanskySantos commented 1 year ago
$ pip install awscli
Collecting awscli
  Obtaining dependency information for awscli from https://files.pythonhosted.org/packages/43/9c/bf16d97f5de8aa4f9171c6c82bad0b[41](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L41)79921ddca5066ba980358da0e9a5/awscli-1.29.3-py3-none-any.whl.metadata
  Downloading awscli-1.29.3-py3-none-any.whl.metadata (11 kB)
Collecting botocore==1.31.3 (from awscli)
  Obtaining dependency information for botocore==1.31.3 from https://files.pythonhosted.org/packages/b0/f0/5755508b3305534cd4cf2a8a82bbbe[42](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L42)ee9d66fd2688be5ff3dfb85e9a99/botocore-1.31.3-py3-none-any.whl.metadata
  Downloading botocore-1.31.3-py3-none-any.whl.metadata (5.9 kB)
Collecting docutils<0.17,>=0.10 (from awscli)
  Downloading docutils-0.16-py2.py3-none-any.whl (5[48](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L48) kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 548.2/548.2 kB 9.5 MB/s eta 0:00:00
Collecting s3transfer<0.7.0,>=0.6.0 (from awscli)
  Downloading s3transfer-0.6.1-py3-none-any.whl (79 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.8/79.8 kB 10.5 MB/s eta 0:00:00
Collecting PyYAML<5.5,>=3.10 (from awscli)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 24.9 MB/s eta 0:00:00
  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'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [68 lines of output]
      /tmp/pip-build-env-isnoxeh9/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 "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/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 "/usr/local/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-isnoxeh9/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-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-isnoxeh9/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-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
          self.find_sources()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
          mm.run()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 5[51](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L51), in run
          self.add_defaults()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line [58](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L58)9, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-isnoxeh9/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-isnoxeh9/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line [107](https://gitlab.com/blue-tech/crediblue-api/-/jobs/4671359200#L107), 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.
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
hoffa commented 1 year ago

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.

hawflau commented 1 year ago

As for the workaround, please pin PyYAML to 5.4.1, because of the requirements of SAM CLI and its dependencies.

@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+

hoffa commented 1 year ago

@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.

hamzashabbir11 commented 1 year ago

Tried all the Above Fixes. None of them Worked for me. I am using sam@v1 - uses: aws-actions/setup-sam@v2

KhanjanMarthak commented 1 year ago

I am having the same issue. Above Fixes are not working.

jay-patel-simformsolutions commented 1 year ago

+1, Need help

mik3fly commented 1 year ago

pLeAsE HeLp

hoffa commented 1 year ago

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.

hamzashabbir11 commented 1 year ago

Still Not Working

hoffa commented 1 year ago

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.

hamzashabbir11 commented 1 year ago
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v1
      - uses: aws-actions/configure-aws-credentials@v1
image

This is my Error and Code Snippet for Pipeline. Okay so I am using v1. Let me upgrade it to v2.

mik3fly commented 1 year ago

working on aws-actions/setup-sam@main and @v2 for me

KhanjanMarthak commented 1 year ago

Working with v2. Code has been Updated 2hours ago.

hoffa commented 1 year ago

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).

hamzashabbir11 commented 1 year ago

Error: PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations : ['/opt/hostedtoolcache/Python/3.7.17/x64/bin/python', '/opt/hostedtoolcache/Python/3.7.17/x64/python', '/usr/bin/python', '/bin/python', '/opt/hostedtoolcache/Python/3.7.17/x64/bin/python3', '/usr/bin/python3', '/bin/python3'] which did not satisfy constraints for runtime: python3.8. Do you have python for runtime: python3.8 on your PATH?

Getting this Error.

hoffa commented 1 year ago

@hamzashabbir11 Make sure you have Python 3.8 installed.

aron-radvanyi commented 1 year ago

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

pererasu commented 1 year ago

Reverting back to pyyaml 5.4.1 worked for me. Was trying to go to 6.0.1.

jenilkeavdiya commented 10 months ago

after installing PyYAML and rasa, still getting same subprocess error

Jonaid97 commented 10 months ago

I've also got the same error while pip pulse2percept. Can anyone also encounters the same error please help how to resolve it?