pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.11k stars 143 forks source link

version 0.11 is not compatible with python 3.7 #445

Closed b02laire closed 3 weeks ago

b02laire commented 3 weeks ago

Version 0.11 of pdoc3 is not compatible with python 3.7 (despite the pypi page stipulating it is compatible with version >= 3.7), due to the use of typing.Literal which was added in python 3.8

Expected Behavior

calling pdoc3 --html -o ./my_documentation/html /path/to/package should generate an html documentation.

Actual Behavior

The command will throw an error:

Traceback (most recent call last):
  File "/home/user/path/to/venv/bin/pdoc3", line 5, in <module>
    from pdoc.cli import main
  File "/home/user/path/to/venv/lib/python3.7/site-packages/pdoc/__init__.py", line 25, in <module>
    from typing import (  # noqa: F401
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

Note than forcing pip to install version 0.10 will fix the issue.

Steps to Reproduce

  1. Create a venv using python 3.7 as interpreter
  2. Install pdoc3 version 0.11
  3. Call pdoc3 to generate documentation: pdoc3 --html -o ./my_documentation/html /path/to/package

Additional info

kernc commented 3 weeks ago

Well, Python v3.7 is in Debian oldoldstable, and it has been EOL'd already last year. Is there a good reason for you to postpone updating? Ubuntu 22.04 generally has Python 3.10 available!

I'm leaning to bumping minimum Python version to 3.9 or 3.11 by policy, as corresponded by CI already.

But if one mere Literal is in question, we can also revert ...

b02laire commented 3 weeks ago

Currently we're unable to migrate our infrastructure to a newer version of Debian, but capping our version of pdoc3 to 0.10 should be enough for our usage.

No need to revert anything, I just wanted to let you know the minium Python version should be bumped :slightly_smiling_face: