ryanfox / sphinx-markdown-tables

A markdown table plugin for Sphinx
GNU General Public License v3.0
59 stars 15 forks source link

Latest version should declare dependency on markdown>=3.4 #38

Closed tsibley closed 2 years ago

tsibley commented 2 years ago

The dependency on markdown in setup.py:

https://github.com/ryanfox/sphinx-markdown-tables/blob/645071762c06ca6d0cb99d717b52403ea1d63244/setup.py#L31

should be updated to markdown>=3.4 to avoid runtime errors when an older version of markdown is installed.

As it stands now, everyone who worked around https://github.com/ryanfox/sphinx-markdown-tables/issues/36 by pinning markdown<3.4 now needs to revert that because now it ensures breakage. Folks likely wanted to revert those workarounds anyhow, but this incorrect dep issue also affects new installs of sphinx-markdown-tables where an older markdown is already installed, e.g.:

$ pip install 'markdown<3.4'
Collecting markdown<3.4
  Using cached Markdown-3.3.7-py3-none-any.whl (97 kB)
Collecting importlib-metadata>=4.4
  Using cached importlib_metadata-4.8.3-py3-none-any.whl (17 kB)
Collecting typing-extensions>=3.6.4
  Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting zipp>=0.5
  Using cached zipp-3.6.0-py3-none-any.whl (5.3 kB)
Installing collected packages: zipp, typing-extensions, importlib-metadata, markdown
Successfully installed importlib-metadata-4.8.3 markdown-3.3.7 typing-extensions-4.1.1 zipp-3.6.0

$ pip install sphinx-markdown-tables
Collecting sphinx-markdown-tables
  Downloading sphinx_markdown_tables-0.0.16-py3-none-any.whl (28 kB)
Requirement already satisfied: markdown>=3.0.1 in ./.venv/lib/python3.6/site-packages (from sphinx-markdown-tables) (3.3.7)
Requirement already satisfied: importlib-metadata>=4.4 in ./.venv/lib/python3.6/site-packages (from markdown>=3.0.1->sphinx-markdown-tables) (4.8.3)
Requirement already satisfied: typing-extensions>=3.6.4 in ./.venv/lib/python3.6/site-packages (from importlib-metadata>=4.4->markdown>=3.0.1->sphinx-markdown-tables) (4.1.1)
Requirement already satisfied: zipp>=0.5 in ./.venv/lib/python3.6/site-packages (from importlib-metadata>=4.4->markdown>=3.0.1->sphinx-markdown-tables) (3.6.0)
Installing collected packages: sphinx-markdown-tables
Successfully installed sphinx-markdown-tables-0.0.16

$ python -c 'import sphinx_markdown_tables; sphinx_markdown_tables.process_tables(None, None, None)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "…/lib/python3.6/site-packages/sphinx_markdown_tables/__init__.py", line 24, in process_tables
    table_processor = markdown.extensions.tables.TableProcessor(md.parser, {})
TypeError: __init__() takes 2 positional arguments but 3 were given
ryanfox commented 2 years ago

New version is available on PyPI. Thank you for the contribution.