tedivm / paracelsus

Visualize SQLAlchemy Databases using Mermaid or Dot Diagrams.
https://pypi.org/project/paracelsus/
MIT License
94 stars 10 forks source link

Current typing format blocks python < 3.10.x #12

Closed jacobeatsspam closed 6 months ago

jacobeatsspam commented 6 months ago

There is some type hinting in pyproject.py that uses the | operand, which wasn't introduced until 3.10.

Traceback (most recent call last):
  File "/redacted/bin/paracelsus", line 5, in <module>
    from paracelsus.cli import app
  File "/redacted/lib/python3.8/site-packages/paracelsus/cli.py", line 11, in <module>
    from .pyproject import get_pyproject_settings
  File "/redacted/lib/python3.8/site-packages/paracelsus/pyproject.py", line 11, in <module>
    def get_pyproject_settings(dir: Path = Path(os.getcwd())) -> Dict[str, Any] | None:
TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'
tedivm commented 6 months ago

For this one I'm going to set the minimum version to 3.10 for the project so it throws an error when it gets installed on older versions.