funkybob / gilbert

A simple static site generator.
https://gilbert.readthedocs.io/en/latest/
MIT License
10 stars 4 forks source link

gilbert init crash #19

Closed Alysha-94 closed 5 years ago

Alysha-94 commented 5 years ago

When I try to run gilbert init I get this

gilbert init
Traceback (most recent call last):
  File "C:\Users\HP\Documents\CPS\digital_site\venv\Scripts\gilbert-script.py", line 11, in <module>
    load_entry_point('gilbert==0.3.3', 'console_scripts', 'gilbert')()
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\pkg_resources\__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\pkg_resources\__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\pkg_resources\__init__.py", line 2434, in load
    return self.resolve()
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\pkg_resources\__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\__init__.py", line 1, in <module>
    from .site import Site  # NOQA
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\site.py", line 8, in <module>
    from .collection import Collection
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\collection.py", line 3, in <module>
    from .content import Content
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\content.py", line 13, in <module>
    class Content(Schema):
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\schema.py", line 146, in __new__
    _type = validator_for(_type)
  File "c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\gilbert\schema.py", line 85, in validator_for
    if isinstance(_type, typing._GenericAlias):
AttributeError: module 'typing' has no attribute '_GenericAlias'

Here's my python and pip version info

(venv) C:\Users\HP\Documents\CPS\digital_site>python --version
Python 3.7.0a2

(venv) C:\Users\HP\Documents\CPS\digital_site>pip --version
pip 19.1.1 from c:\users\hp\documents\cps\digital_site\venv\lib\site-packages\pip (python 3.7)
Alysha-94 commented 5 years ago

I updated to python3.7.3 and the command works now

funkybob commented 5 years ago

Ah, this could be a problem if we want to continue support for 3.6.

Truth is, the typing module made it very difficult to find a clean way to detect typing classes.

funkybob commented 5 years ago

It turns out the typing module went through quite a significant overhaul between 3.6 and 3.7... being compatible with both would take some effort right now.

shuttle1987 commented 5 years ago

For our purposes Python >=3.7 is fine, we can set up containers/VMs with the right version to generate the files.