Skip to content

Markdown TypeError with Ford (markdown 3.4.1 related?) #437

@mathomp4

Description

@mathomp4

First, let me say this might not be a Ford error, but I figured I'd start here. So this morning I did a sync up of my repo where I'm playing with Ford (see #431 and all the other issues that @ZedThree has helped me with), and with that sync, my "Run Ford" GitHub Action sprang into action...and failed. The error I got was:

Run ford Ford/docs.md
  ford Ford/docs.md
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.5/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.5/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.5/x64
    Python[2](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:3).10.5/x6[4](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:4)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.[5](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:5)/x[6](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:6)4
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.5/x64/lib
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.5/x64/bin/ford", line [8](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:8), in <module>
    sys.exit(run())
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/ford/__init__.py", line 633, in run
    proj_data, proj_docs, md = initialize()
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/ford/__init__.py", line 236, in initialize
    return parse_arguments(vars(args), proj_docs, directory)
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/ford/__init__.py", line 406, in parse_arguments
    md = markdown.Markdown(
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/markdown/core.py", line [9](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:9)6, in __init__
    self.registerExtensions(extensions=kwargs.get('extensions', []),
  File "/opt/hostedtoolcache/Python/3.[10](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:10).5/x64/lib/python3.10/site-packages/markdown/core.py", line [12](https://github.com/mathomp4/MAPL/runs/7389886008?check_suite_focus=true#step:8:13)5, in registerExtensions
    ext.extendMarkdown(self)
TypeError: MarkdownInclude.extendMarkdown() missing 1 required positional argument: 'md_globals'
Error: Process completed with exit code 1.

This very well could be due to my Ford config file as I am still fiddling around, but then I was looking at the Python Markdown repo and saw in the v3.4 changelog:

In addition, the md_globals parameter of Markdown.extensions.Extension.extendMarkdown() is no longer recognized as a valid parameter and will raise an error if provided.

and GitHub did get Markdown 3.4.1:

Collecting markdown
  Downloading Markdown-3.4.1-py3-none-any.whl (93 kB)

As I said, I'm not sure if this is a Ford issue, or a Python-Markdown issue, or a me issue. I mean I added this:

md_extensions: markdown.extensions.toc
               markdown.extensions.smarty

to my Ford config file mainly because I saw other people using it in theirs. 😄

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