-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support python 3.6 #241
Comments
Awesome @gjvc I think there a few more steps to have a completely lxml-free version, but I think I got the parser working with the native The codegen tool is still using the default handler which is lxml, if you have managed to generate the models through another venv or if you are using custom models give it a try and let me know what you thin. from xsdata.formats.dataclass.parsers import XmlParser
from xsdata.formats.dataclass.parsers.handlers import SaxHandler
parser = XmlParser(handler=SaxHandler) # Native python
p.parse("some/file.xml", Books) I haven't checked xsdata with pypy, does lxml fail on the setup or during usage? |
Well. Good and bad news. It's late here, so I'm sorry if this is not crystal clear. I'm using pypy3 on Debian bullseye/sid. Looks like lxml and pypy3 are actually playing well with each other at installation/wheel build time and runtime, so please forget my comment above -- looks like the historic problems have been resolved. (Google for lxml and pypy3 to see the sort of problems people used to encounter.) Note that the latest cpython-equivalent version of pypy3 is "Python 3.6.9". This is not Python 3.7, so I have had to install the dataclasses module from https://pypi.org/project/dataclasses/ using pip. But, when I use version 0.7 of dataclasses I get lots of these warnings from xsdata:
where "ElementName" is a legitimate element name as per the grammar. I also get a lot of "object is not iterable" errrors with python 3.6 and dataclasses 0.7. (I was using python3.8 originally, with no problems.) This suggests there is a difference between the behaviours of dataclasses 0.7 from pypi and dataclasses from cpython 3.8. I'm a bit stuck right now with all this yak-shaving. I might see if there is an early 3.7 version of pypy I can use. The next thing to do is to test cpython 3.6, xsdata, and dataclasses 0.7 from pypi. I see from the front page of xsdata that you only support python 3.7 onwards. pypy is only at 3.6 right now, so bringing this issue back on-topic (finally), this problem reduces to xsdata supporting python 3.6 via dataclasses 0.7 from pypi (which you may not have any interest in doing, which is of course your prerogative :-)) whew. |
There is an issue with the typing module and See pr #242 |
This looks good. I will test some more and report back. Thanks once again :-) |
Well it has a drawback you can not use I am not sure how to proceed here I definitely don't want to offer a monkey patch... |
Notes: In py36 the typing module is flattening baseclasses in unions eg Union[int, bool] -> (int), there is no official workaround but from all my samples I 've only encountered this case in a few tests cases in the w3c test suite.
Notes: In py36 the typing module is flattening baseclasses in unions eg Union[int, bool] -> (int), there is no official workaround but from all my samples I 've only encountered this case in a few tests cases in the w3c test suite.
Thank you very much! |
I would like to be able to use xsdata with pypy. I can't right now, because pypy does not work with lxml. I see that you are making an effort to use less lxml. If you have a completely lxml-free version, I would be very happy to test it for you :-)
The text was updated successfully, but these errors were encountered: