Skip to content

Latest version of markdown breaks chalice deployments in github workflows #1196

Closed

Description

@apfromiit

Sample Repo with workflow to reproduce the issue:
https://github.com/apfromiit/markdown-github-workflow

Workflow fails with markdown==3.3.5
Workflow runs successfully with markdown==3.3.4

Latest version of markdown breaks chalice deployment in github actions

Workflow: https://github.com/apfromiit/markdown-github-workflow/blob/master/.github/workflows/chalice-deploy.yml

Result: https://github.com/apfromiit/markdown-github-workflow/runs/4229057005?check_suite_focus=true

Refer the workflow in .github/workflows/

Steps to reproduce:

  • Fork the repo
  • Add AWS secrets to forked repo
  • Modify Readme (to make some trivial changes to create dummy commit)
  • git commit and push to master branch
  • Check Github Actions in repo.

Github workflow fails with below logs during chalice deploy step.

Logs:

Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/cli/__init__.py", line 636, in main
    return cli(obj={})
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/cli/__init__.py", line 189, in deploy
    deployed_values = d.deploy(config, chalice_stage_name=stage)
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/deploy/deployer.py", line 376, in deploy
    return self._deploy(config, chalice_stage_name)
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/deploy/deployer.py", line 382, in _deploy
    self._validate_config(config)
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/deploy/deployer.py", line 408, in _validate_config
    validate_configuration(config)
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/deploy/validate.py", line 41, in validate_configuration
    routes = config.chalice_app.routes
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/config.py", line 141, in chalice_app
    app = v()
  File "/home/runner/.local/lib/python3.8/site-packages/chalice/cli/factory.py", line 277, in load_chalice_app
    app = importlib.import_module('app')
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/runner/work/markdown-github-workflow/markdown-github-workflow/app.py", line 2, in <module>
    from markdown import markdown
  File "/home/runner/.local/lib/python3.8/site-packages/markdown/__init__.py", line 29, in <module>
    from .core import Markdown, markdown, markdownFromFile  # noqa: E402
  File "/home/runner/.local/lib/python3.8/site-packages/markdown/core.py", line 26, in <module>
    from . import util
  File "/home/runner/.local/lib/python3.8/site-packages/markdown/util.py", line 88, in <module>
    INSTALLED_EXTENSIONS = metadata.entry_points(group='markdown.extensions')
TypeError: entry_points() got an unexpected keyword argument 'group'

Error: Process completed with exit code 2.

Activity

  1. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    I'm not sure what chalice is, but I assume that the new requirement isn't installed? install_requires=["importlib-metadata>='4.4';python_version<'3.10'"],. It is difficult to tell without seeing the dependencies from your current failing process.

  2. liu-ziyang commented on Nov 16, 2021

    @liu-ziyang
    Contributor

    I can confirm this issue (not using charlice)

     File "/home/runner/.local/lib/python3.8/site-packages/markdown/__init__.py", line 29, in <module>
        from .core import Markdown, markdown, markdownFromFile  # noqa: E402
      File "/home/runner/.local/lib/python3.8/site-packages/markdown/core.py", line 26, in <module>
        from . import util
      File "/home/runner/.local/lib/python3.8/site-packages/markdown/util.py", line 88, in <module>
        INSTALLED_EXTENSIONS = metadata.entry_points(group='markdown.extensions')
    TypeError: entry_points() got an unexpected keyword argument 'group'
    

    while the pip install reports:

    Requirement already satisfied: importlib-metadata>='4.4'; python_version < "3.10" in /usr/lib/python3/dist-packages (from markdown->-r napari-hub/backend/requirements.txt (line 8)) (1.5.0)
    

    this is reproduced from github action using ubuntu-latest runner, which should have python 3.8

  3. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    I'm confused, what version is it using? It seems to suggest 1.5.0, not 4.4. Can you post the version that is being used?

  4. liu-ziyang commented on Nov 16, 2021

    @liu-ziyang
    Contributor

    I'm confused, what version is it using? It seems to suggest 1.5.0, not 4.4. Can you post the version that is being used?

    likewise, I think the version installed is 1.5.0, but pip takes that as a pass for version check.

    I am not a pip expert but could it be the quote in the requirement being problematic in the version matching, should we change it to without quote like the below?

    install_requires=["importlib-metadata>=4.4;python_version<3.10"],
    
  5. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    Hmm, maybe. I don't usually use the quotes, so I'm don't quite sure why it's being used in setup like that. Maybe create a branch with the change and see if you include that git branch as your Markdown dependency if the issue goes away.

    markdown @ git+https://github.com/My-Fork/markdown.git@somebranch
    
  6. liu-ziyang commented on Nov 16, 2021

    @liu-ziyang
    Contributor

    Hmm, maybe. I don't usually use the quotes, so I'm don't quite sure why it's being used in setup like that. Maybe create a branch with the change and see if you include that git branch as your Markdown dependency if the issue goes away.

    markdown @ git+https://github.com/My-Fork/markdown.git@somebranch
    

    I tried out on my fork, and pip correctly install a later version of importlib-metadata when quotes are dropped: #1197

  7. justinmerrell commented on Nov 16, 2021

    @justinmerrell

    I ran into the same problem today, it appears to be a Python 3.8.x issue, I was able to successfully run actions with 3.10.x

  8. liu-ziyang commented on Nov 16, 2021

    @liu-ziyang
    Contributor

    I ran into the same problem today, it appears to be a Python 3.8.x issue, I was able to successfully run actions with 3.10.x

    according to the import
    the util for 3.10 would use the latest importlib instead, so it would not run into the dependency issue indeed

  9. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    I tried out on my fork, and pip correctly install a later version of importlib-metadata when quotes are dropped: #1197

    Perfect, then a PR would be great.

  10. liu-ziyang commented on Nov 16, 2021

    @liu-ziyang
    Contributor

    I tried out on my fork, and pip correctly install a later version of importlib-metadata when quotes are dropped: #1197

    Perfect, then a PR would be great.

    opened #1197 already, not sure what is the process since I am first time contributing to this repo, it seems someone need to grant permission to the workflow run 😄

  11. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    I gave it permission to run. I'll let @waylan take a look and decide the next steps.

  12. apfromiit commented on Nov 16, 2021

    @apfromiit
    Author

    I'm not sure what chalice is, but I assume that the new requirement isn't installed? install_requires=["importlib-metadata>='4.4';python_version<'3.10'"],. It is difficult to tell without seeing the dependencies from your current failing process.

    Log from failing workflow:

    Requirement already satisfied: importlib-metadata>='4.4'; python_version < "3.10" in /usr/lib/python3/dist-packages (from markdown==3.3.5->-r requirements.txt (line 2)) (1.5.0)

  13. facelessuser commented on Nov 16, 2021

    @facelessuser
    Collaborator

    @apfromiit, yeah, that is the same as @potating-potato's results. It is possible that #1197 will fix it.

  14. daneeesh commented on Nov 16, 2021

    @daneeesh

    just chiming in here - the latest version also broke Airflow 2.0.2 (the version supported by MWAA) if the Markdown version wasn't fixed to 3.3.4

  15. rouilj commented on Nov 17, 2021

    @rouilj

    Seeing similar breakage for 3.10 and 3.6 python versions when testing Roundup Issue Tracker. Tests pass with python 3.9 and 3.8.

  16. facelessuser commented on Nov 17, 2021

    @facelessuser
    Collaborator

    @rouilj There shouldn't be any kind of breakage for 3.10 as it will use the default, built-in importlib.meta, or it at least should. I would test the current PR branch to see if it fixes your issue (#1197). If we don't get any testing, we can't fix anything for your use case.

  17. apfromiit commented on Nov 17, 2021

    @apfromiit
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions