Repository navigation
Latest version of markdown breaks chalice deployments in github workflows #1196
Copy link
Copy link
Closed
Description
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
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
facelessuser commentedon Nov 16, 2021
I'm not sure what
chaliceis, 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.liu-ziyang commentedon Nov 16, 2021
I can confirm this issue (not using charlice)
while the pip install reports:
this is reproduced from github action using ubuntu-latest runner, which should have python 3.8
facelessuser commentedon Nov 16, 2021
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?
liu-ziyang commentedon Nov 16, 2021
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?
facelessuser commentedon Nov 16, 2021
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.
liu-ziyang commentedon Nov 16, 2021
I tried out on my fork, and pip correctly install a later version of importlib-metadata when quotes are dropped: #1197
justinmerrell commentedon Nov 16, 2021
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
liu-ziyang commentedon Nov 16, 2021
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
facelessuser commentedon Nov 16, 2021
Perfect, then a PR would be great.
liu-ziyang commentedon Nov 16, 2021
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 😄
facelessuser commentedon Nov 16, 2021
I gave it permission to run. I'll let @waylan take a look and decide the next steps.
apfromiit commentedon Nov 16, 2021
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)facelessuser commentedon Nov 16, 2021
@apfromiit, yeah, that is the same as @potating-potato's results. It is possible that #1197 will fix it.
daneeesh commentedon Nov 16, 2021
just chiming in here - the latest version also broke Airflow 2.0.2 (the version supported by MWAA) if the
Markdownversion wasn't fixed to 3.3.4rouilj commentedon Nov 17, 2021
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.
release 3.3.5 of Markdown broken. Pin to 3.3.4 to get test to pass.
facelessuser commentedon Nov 17, 2021
@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.apfromiit commentedon Nov 17, 2021
https://github.com/apfromiit/markdown-github-workflow/commit/88f83457525dfd957302ce8315b779174404e824
https://github.com/apfromiit/markdown-github-workflow/actions/runs/1473009857
Workflow runs successfully with new version 3.3.6
Thanks everyone for quick resolution!
test: resolve issue issue metadata.entry_points Python-Markdown/markd…