Open
Description
I am trying to use this module inside an Ansible inventory script to retrieve hosts from a SharePoint list. This works well in a recent (3.11) Python version, but unfortunately I need to rely on Python 3.6 in another environment. There the script fails right away in line 1:
from office365.sharepoint.client_context import ClientContext
# [...] Authentication code like in this example: https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/sharepoint/connect_with_client_certificate.py
The SyntaxError thrown is this:
Traceback (most recent call last):
File "inventory-from-spo.py", line 1, in <module>
from office365.sharepoint.client_context import ClientContext
File "/home/me/.local/lib/python3.6/site-packages/office365/sharepoint/client_context.py", line 16, in <module>
from office365.runtime.odata.request import ODataRequest
File "/home/me/.local/lib/python3.6/site-packages/office365/runtime/odata/request.py", line 6, in <module>
from office365.runtime.client_object import ClientObject
File "/home/me/.local/lib/python3.6/site-packages/office365/runtime/client_object.py", line 1
from __future__ import annotations
^
SyntaxError: future feature annotations is not defined
Is there some kind of compatibility layer one needs to activate?