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

PyXB Deprecated #10

Open
TomHanra opened this issue Jun 10, 2022 · 2 comments
Open

PyXB Deprecated #10

TomHanra opened this issue Jun 10, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@TomHanra
Copy link

I attempted to follow the instructions to get the ppv16 module set up (i.e. run pyxbgen --schema-root=ppv16 --module PPv16 rttiPPTSchema_v16.xsd ) but neither pyxb or Pyxb-x (a successor) work with python 3.10.

@poggs
Copy link
Member

poggs commented Aug 22, 2022

This doesn't seem to be an issue for me on Python 3.10:

(venv) pwh@angel:~/PycharmProjects/stomp-client-python$ pyxbgen --schema-root=ppv16 --module PPv16 rttiPPTSchema_v16.xsd
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/Alarms/v1}RTTIAlarm.{http://www.thalesgroup.com/rtti/PushPort/Alarms/v1}set renamed to set_
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/Forecasts/v3}TSLocation.{http://www.thalesgroup.com/rtti/PushPort/Forecasts/v3}pass renamed to pass_
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/TrainOrder/v1}TrainOrder.{http://www.thalesgroup.com/rtti/PushPort/TrainOrder/v1}set renamed to set_
Python for http://www.thalesgroup.com/rtti/PushPort/v16 requires 16 modules
(venv) pwh@angel:~/PycharmProjects/stomp-client-python$ python -V
Python 3.8.10

Which version of pyxb are you using? I've recently updated the codebase to be specific on versions of dependencies, and it's fine with v1.2.6, at least here.

@poggs poggs added the question Further information is requested label Aug 22, 2022
@poggs poggs self-assigned this Aug 22, 2022
@mneedham
Copy link

mneedham commented Mar 7, 2023

For me, it complains about a missing attribute:

$ pyxbgen --schema-root=ppv16 --module PPv16 rttiPPTSchema_v16.xsd
Traceback (most recent call last):
  File "/Users/markhneedham/projects/stomp-client-python/.venv/bin/pyxbgen", line 4, in <module>
    import pyxb.xmlschema
  File "/Users/markhneedham/projects/stomp-client-python/.venv/lib/python3.10/site-packages/pyxb/xmlschema/__init__.py", line 12, in <module>
    from pyxb.xmlschema.structures import Schema as schema
  File "/Users/markhneedham/projects/stomp-client-python/.venv/lib/python3.10/site-packages/pyxb/xmlschema/structures.py", line 47, in <module>
    from pyxb.binding import basis, datatypes, facets
  File "/Users/markhneedham/projects/stomp-client-python/.venv/lib/python3.10/site-packages/pyxb/binding/__init__.py", line 8, in <module>
    from . import datatypes
  File "/Users/markhneedham/projects/stomp-client-python/.venv/lib/python3.10/site-packages/pyxb/binding/datatypes.py", line 1266, in <module>
    from . import content
  File "/Users/markhneedham/projects/stomp-client-python/.venv/lib/python3.10/site-packages/pyxb/binding/content.py", line 807, in <module>
    class _PluralBinding (collections.MutableSequence):
AttributeError: module 'collections' has no attribute 'MutableSequence'

$ python -V
Python 3.10.9

Update: It does work if I use pip install Pyxb-x:

$ pip install Pyxb-x
Collecting Pyxb-x
  Downloading PyXB_X-1.2.6.1-py3-none-any.whl (309 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 310.0/310.0 kB 2.8 MB/s eta 0:00:00
Installing collected packages: Pyxb-x
Successfully installed Pyxb-x-1.2.6.1

$ pyxbgen --schema-root=ppv16 --module PPv16 rttiPPTSchema_v16.xsd
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/Alarms/v1}RTTIAlarm.{http://www.thalesgroup.com/rtti/PushPort/Alarms/v1}set renamed to set_
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/Forecasts/v3}TSLocation.{http://www.thalesgroup.com/rtti/PushPort/Forecasts/v3}pass renamed to pass_
WARNING:pyxb.binding.generate:Element use {http://www.thalesgroup.com/rtti/PushPort/TrainOrder/v1}TrainOrder.{http://www.thalesgroup.com/rtti/PushPort/TrainOrder/v1}set renamed to set_
Python for http://www.thalesgroup.com/rtti/PushPort/v16 requires 16 modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants