Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: invalid syntax #1

Open
mr-shorten opened this issue Jul 27, 2023 · 3 comments
Open

SyntaxError: invalid syntax #1

mr-shorten opened this issue Jul 27, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mr-shorten
Copy link

Getting the following error when trying to make a diagram from Example web-services-on-premise.yaml
Pip v23.2.1
Python v3.9.0
GraphViz v8.1.0

diagrams-as-code web-services-on-premise.yaml
Traceback (most recent call last):
 File "c:\users\matt\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
   return _run_code(code, main_globals, None,
 File "c:\users\matt\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
   exec(code, run_globals)
 File "C:\Users\Matt\AppData\Local\Programs\Python\Python39\Scripts\diagrams-as-code.exe\__main__.py", line 4, in <module>
 File "c:\users\matt\appdata\local\programs\python\python39\lib\site-packages\diagrams_as_code\entrypoint.py", line 16, in <module>
   from diagrams_as_code.enums import (
 File "c:\users\matt\appdata\local\programs\python\python39\lib\site-packages\diagrams_as_code\enums.py", line 44
   match self.value:
@dmytrostriletskyi
Copy link
Owner

Thank you for the issue! 👍

As specified, you should have at least Python 3.10, you have 3.9. Can you use 3.10 and tell me if it works for you?

@mr-shorten
Copy link
Author

Upgraded to 3.10 and got the following error.

Traceback (most recent call last):
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\Scripts\diagrams-as-code.exe\__main__.py", line 4, in <module>
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\diagrams_as_code\entrypoint.py", line 21, in <module>
    from diagrams_as_code.schema import (
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\diagrams_as_code\schema.py", line 15, in <module>
    class YamlDiagramStyle(BaseModel):
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\_internal\_model_construction.py", line 173, in __new__
    set_model_fields(cls, bases, config_wrapper, types_namespace)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\_internal\_model_construction.py", line 372, in set_model_fields
    fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\_internal\_fields.py", line 97, in collect_model_fields
    type_hints = get_cls_type_hints_lenient(cls, types_namespace)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\_internal\_typing_extra.py", line 212, in get_cls_type_hints_lenient
    hints[name] = eval_type_lenient(value, globalns, localns)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\_internal\_typing_extra.py", line 221, in eval_type_lenient
    value = _make_forward_ref(value, is_argument=False, is_class=True)
TypeError: ForwardRef.__init__() got an unexpected keyword argument 'is_class'

@dmytrostriletskyi
Copy link
Owner

@mr-shorten, hm, interesting. Can I ask you to try 3.11 as well? Just to double-check. Please! 🙏

@dmytrostriletskyi dmytrostriletskyi added the bug Something isn't working label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants