aws-powertools / powertools-lambda-python

A developer toolkit to implement Serverless best practices and increase developer velocity.
https://docs.powertools.aws.dev/lambda/python/latest/
MIT No Attribution
2.72k stars 377 forks source link

Maintenance: Fix error when creating a developer environment in Gitpod #4530

Closed leandrodamascena closed 2 weeks ago

leandrodamascena commented 3 weeks ago

Why is this needed?

When trying to run make dev-gitpod we get this error

- Installing poetry-bumpversion (0.0.0 315fe33): Failed

  ChefInstallError

  Failed to install poetry-core.

  Output:
  Updating dependencies
  Resolving dependencies...

  Package operations: 1 install, 0 updates, 0 removals

    - Installing poetry-core (1.9.0)

    CalledProcessError

    Command '['/tmp/tmp2m752m6b/.venv/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n    "packaging", Path(r"/workspace/.pyenv_mirror/user/3.9.13/lib/python3.9/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n    "packaging.tags", Path(r"/workspace/.pyenv_mirror/user/3.9.13/lib/python3.9/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n    json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n']' returned non-zero exit status 1.

    at ~/.pyenv/versions/3.9.13/lib/python3.9/subprocess.py:528 in run
         524│             # We don't call process.wait() as .__exit__ does that for us.
         525│             raise
         526│         retcode = process.poll()
         527│         if check and retcode:
      →  528│             raise CalledProcessError(retcode, process.args,
         529│                                      output=stdout, stderr=stderr)
         530│     return CompletedProcess(process.args, retcode, stdout, stderr)
         531│ 
         532│ 

  The following error occurred when trying to handle this error:

    EnvCommandError

    Command ['/tmp/tmp2m752m6b/.venv/bin/python', '-I', '-W', 'ignore', '-c', '\nimport importlib.util\nimport json\nimport sys\n\nfrom pathlib import Path\n\nspec = importlib.util.spec_from_file_location(\n    "packaging", Path(r"/workspace/.pyenv_mirror/user/3.9.13/lib/python3.9/site-packages/packaging/__init__.py")\n)\npackaging = importlib.util.module_from_spec(spec)\nsys.modules[spec.name] = packaging\n\nspec = importlib.util.spec_from_file_location(\n    "packaging.tags", Path(r"/workspace/.pyenv_mirror/user/3.9.13/lib/python3.9/site-packages/packaging/tags.py")\n)\npackaging_tags = importlib.util.module_from_spec(spec)\nspec.loader.exec_module(packaging_tags)\n\nprint(\n    json.dumps([(t.interpreter, t.abi, t.platform) for t in packaging_tags.sys_tags()])\n)\n'] errored with the following return code 1

    Error output:
    Traceback (most recent call last):
      File "<string>", line 18, in <module>
      File "<frozen importlib._bootstrap_external>", line 846, in exec_module
      File "<frozen importlib._bootstrap_external>", line 982, in get_code
      File "<frozen importlib._bootstrap_external>", line 1039, in get_data
    FileNotFoundError: [Errno 2] No such file or directory: '/workspace/.pyenv_mirror/user/3.9.13/lib/python3.9/site-packages/packaging/tags.py'

    at ~/.pyenv/versions/3.9.13/lib/python3.9/site-packages/poetry/utils/env/base_env.py:342 in _run
        338│                 output = subprocess.check_output(
        339│                     cmd, stderr=stderr, env=env, text=True, **kwargs
        340│                 )
        341│         except CalledProcessError as e:
      → 342│             raise EnvCommandError(e)
        343│ 
        344│         return output
        345│ 
        346│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

  Cannot install poetry-core.

  Error:

  at ~/.pyenv/versions/3.9.13/lib/python3.9/site-packages/poetry/installation/chef.py:102 in install
       98│             InstalledRepository.load(self._env),
       99│         )
      100│         installer.update(True)
      101│         if installer.run() != 0:
    → 102│             raise ChefInstallError(requirements, io.fetch_output(), io.fetch_error())
      103│ 
      104│ 
      105│ class Chef:
      106│     def __init__(

Cannot install build-system.requires for poetry-bumpversion.

make[1]: *** [Makefile:117: dev-version-plugin] Error 1
make[1]: Leaving directory '/workspace/powertools-lambda-python'
make: *** [Makefile:10: dev] Error 2
gitpod /workspace/powertools-lambda-python (develop) $ 

Which area does this relate to?

Automation

Solution

No response

Acknowledgment

github-actions[bot] commented 2 weeks ago

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

heitorlessa commented 1 week ago

removed triage label

github-actions[bot] commented 1 week ago

This is now released under 2.40.0 version!