sqlalchemy / mako

Mako Templates for Python
https://www.makotemplates.org
MIT License
353 stars 60 forks source link

newest mako breaks python 3.7 #381

Closed wuillaum closed 10 months ago

wuillaum commented 10 months ago

It looks like the latest release of Mako is broken on 3.7

from mako import exceptions
20:38:44 /.../lib/python3.7/site-packages/mako/exceptions.py:12: in <module>
20:38:44     from mako import compat
20:38:44 /.../python3.7/site-packages/mako/compat.py:8: in <module>
20:38:44     from importlib import metadata as importlib_metadata
20:38:44 E   ImportError: cannot import name 'metadata' from 'importlib' (/.../lib/python3.7/importlib/__init__.py)

If possible, please set the minimum Python version to 3.8, thank you!

zzzeek commented 10 months ago

that's what it was supposed to do. Hm I forgot to change the min python version? (or maybe it's not there), moment

zzzeek commented 10 months ago

the min version is there: https://pypi.org/project/Mako/

image

https://github.com/sqlalchemy/mako/blob/dc66614a2b9ba19ee880c855471c37cd3307c22a/setup.cfg#L33

are you installing manually in some way? There's no issue on this end that I can see

zzzeek commented 10 months ago

Mako installs on python 3.7 without issue, version 1.2.4 gets pulled, so this is all correct

[jenkins@89f61f9cf1c0 tmp]$ /opt/python3.7/bin/python3 -m venv venv
[jenkins@89f61f9cf1c0 tmp]$ ./venv/bin/pip install mako
Collecting mako
  Using cached Mako-1.2.4-py3-none-any.whl (78 kB)
Collecting importlib-metadata
  Using cached importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Collecting MarkupSafe>=0.9.2
  Using cached MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting zipp>=0.5
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting typing-extensions>=3.6.4
  Using cached typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Installing collected packages: zipp, typing-extensions, MarkupSafe, importlib-metadata, mako
Successfully installed MarkupSafe-2.1.3 importlib-metadata-6.7.0 mako-1.2.4 typing-extensions-4.7.1 zipp-3.15.0
WARNING: You are using pip version 22.0.4; however, version 23.3.1 is available.
You should consider upgrading via the '/tmp/venv/bin/python3 -m pip install --upgrade pip' command.
[jenkins@89f61f9cf1c0 tmp]$ venv/bin/python
Python 3.7.16 (default, Jul  2 2023, 16:10:09) 
[GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mako
>>> 

closing this as cant reproduce, I think check how you are installing mako

wuillaum commented 10 months ago

I'm installing via conda, so I think there's a transient repo that's at fault here. https://github.com/conda-forge/mako-feedstock

https://github.com/conda-forge/mako-feedstock/blob/bdeda6bea4b9eea6cf43dbfe8ff83ec972a76a22/recipe/meta.yaml#L19-L29

zzzeek commented 10 months ago

can you post an issue with them?