Skip to content

Commit

Permalink
Issue 7 (#9)
Browse files Browse the repository at this point in the history
* general update to support 3.12

Some critical packages that were being used since Python 2.x were removed in Python 3.12., So, had to make some sweeping updates.

Ditches six.moves and uses just sal now. It is more limited but super simplified to support just the items used by pyxb instead of a more general 2 to 3 tool. In the process, ditched support for 2.x anyway since it has been dropped by the Python folks. left the sal for Python 4.x.

All unit tests pass (python setup test) in Python 3.10 and 3.12.
  • Loading branch information
al-niessner authored Jul 22, 2024
1 parent 0a283f6 commit e9af3e4
Show file tree
Hide file tree
Showing 101 changed files with 243 additions and 1,009 deletions.
2 changes: 1 addition & 1 deletion examples/dictionary/define.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
import dict
from pyxb.utils.six.moves.urllib.request import urlopen
from pyxb.utils.sal import urlopen
import sys
from pyxb.utils import domutils

Expand Down
2 changes: 1 addition & 1 deletion examples/dictionary/showdict.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
import sys
import dict
from pyxb.utils.six.moves.urllib.request import urlopen
from pyxb.utils.sal import urlopen
import pyxb.utils.domutils as domutils
from xml.dom import minidom

Expand Down
2 changes: 1 addition & 1 deletion examples/geocoder/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
import sys
from pyxb.utils.six.moves.urllib import request as urllib_request
from pyxb.utils.sal import urllib_request
import GeoCoder
from pyxb import BIND
from pyxb.utils import domutils
Expand Down
2 changes: 1 addition & 1 deletion examples/ndfd/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import DWML
import datetime
import pyxb.binding.datatypes as xsd
from pyxb.utils.six.moves.urllib.request import urlopen
from pyxb.utils.sal import urlopen
import time
import collections
import sys
Expand Down
4 changes: 2 additions & 2 deletions examples/ndfd/latlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import DWML
import datetime
import pyxb
from pyxb.utils import domutils, six
from pyxb.utils.six.moves.urllib import request as urllib_request
from pyxb.utils import domutils, sal as six
from pyxb.utils.sal import urllib_request
import pyxb.binding.datatypes as xsd
import pyxb.bundles.wssplat.soap11 as soapenv

Expand Down
2 changes: 1 addition & 1 deletion examples/ndfd/showreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import xml.dom
import xml.dom.minidom
import pyxb.utils.domutils
from pyxb.utils import six
from pyxb.utils import sal as six
import pyxb.namespace

# Structure
Expand Down
2 changes: 1 addition & 1 deletion examples/ucum/showunits.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ucum
import pyxb
import sys
from pyxb.utils import six
from pyxb.utils import sal as six

def ucumHTML (u):
"""Convert mixed content to UCUM's version of HTML"""
Expand Down
2 changes: 1 addition & 1 deletion examples/weather/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function
import sys
import time
from pyxb.utils.six.moves.urllib import request as urllib_request
from pyxb.utils.sal import urllib_request
import pyxb.bundles.wssplat.soap11 as soapenv
import weather

Expand Down
2 changes: 1 addition & 1 deletion examples/weather/client_get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
import time
from pyxb.utils.six.moves.urllib import request as urllib_request
from pyxb.utils.sal import urllib_request
import weather # Bindings generated by PyXB
import pyxb.utils.domutils as domutils

Expand Down
2 changes: 1 addition & 1 deletion examples/xsdprimer/ipo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bring everything in
from raw.ipo import *
from pyxb.utils import six
from pyxb.utils import sal as six

# Provide a way to reference the raw bindings that we're going to override
import raw.ipo as raw_ipo
Expand Down
4 changes: 2 additions & 2 deletions maintainer/buildUnicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from __future__ import print_function
import textwrap
import re
from pyxb.utils import six
from pyxb.utils.six.moves import xrange
from pyxb.utils import sal as six
from pyxb.utils.sal import xrange

def countCodepoints (codepoints):
count = 0
Expand Down
2 changes: 1 addition & 1 deletion pyxb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

import logging
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ submodules:
"""

import logging
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/binding/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import collections.abc
import xml.dom
import pyxb
from pyxb.utils import domutils, utility, six
from pyxb.utils import domutils, utility, sal as six
import pyxb.namespace
from pyxb.namespace.builtin import XMLSchema_instance as XSI
import decimal
Expand Down
2 changes: 1 addition & 1 deletion pyxb/binding/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import pyxb.utils.fac
from pyxb.binding import basis
import pyxb.utils.utility
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/binding/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
from pyxb.exceptions_ import *
import pyxb.namespace
import pyxb.utils.unicode
from pyxb.utils import six
from pyxb.utils import sal as six
from . import basis

_log = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion pyxb/binding/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import pyxb
from . import datatypes
from . import basis
from pyxb.utils import utility, six
from pyxb.utils import utility, sal as six

_log = logging.getLogger(__name__)

Expand Down
7 changes: 4 additions & 3 deletions pyxb/binding/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

import pyxb
import pyxb.xmlschema as xs
from pyxb.utils import utility, templates, six
from pyxb.utils import utility, templates
from pyxb.utils import sal as six
from pyxb.utils.utility import repr2to3
from pyxb.binding import basis, datatypes, facets

Expand Down Expand Up @@ -1671,7 +1672,7 @@ def _finalizeModuleContents_vx (self, template_map):
import pyxb.utils.utility
import pyxb.utils.domutils
import sys
import pyxb.utils.six as _six
import pyxb.utils.sal as _six
''')
self.bindingIO().appendPrologBoilerplate(template_map)
self.bindingIO().prolog().append(self.bindingIO().expand('''
Expand Down Expand Up @@ -1794,7 +1795,7 @@ def _finalizeModuleContents_vx (self, template_map):
import pyxb
import pyxb.binding
import pyxb.utils.utility
import pyxb.utils.six as _six
import pyxb.utils.sal as _six
''')
self.bindingIO().appendPrologBoilerplate(template_map)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/binding/xml_.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import pyxb.binding
import pyxb.utils.utility
import pyxb.utils.domutils
from pyxb.utils import six
from pyxb.utils import sal as six

# Unique identifier for bindings created at the same time
_GenerationUID = pyxb.namespace.builtin.BuiltInObjectUID
Expand Down
2 changes: 1 addition & 1 deletion pyxb/bundles/wssplat/wsdl11.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pyxb.bundles.wssplat.raw.wsdl11 as raw_wsdl11

import pyxb.namespace
from pyxb.utils import domutils, six
from pyxb.utils import domutils, sal as six
import xml.dom

def ImportRelatedNamespaces ():
Expand Down
2 changes: 1 addition & 1 deletion pyxb/exceptions_.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"""

import pyxb
from pyxb.utils import six
from pyxb.utils import sal as six

class PyXBException (Exception):
"""Base class for exceptions that indicate a problem that the user should fix."""
Expand Down
2 changes: 1 addition & 1 deletion pyxb/namespace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import pyxb
import pyxb.utils.utility
from pyxb.utils import six
from pyxb.utils import sal as six
import xml.dom
import logging

Expand Down
4 changes: 2 additions & 2 deletions pyxb/namespace/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import os.path
import pyxb
import pyxb.utils.utility
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand All @@ -45,7 +45,7 @@ def GetArchivePath ():
return os.environ.get(PathEnvironmentVariable)

# Stuff required for pickling
from pyxb.utils.six.moves import cPickle as pickle
from pyxb.utils.sal import cPickle as pickle
import re

class NamespaceArchive (object):
Expand Down
2 changes: 1 addition & 1 deletion pyxb/namespace/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import logging
import pyxb
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/namespace/resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pyxb
import pyxb.utils.utility
from pyxb.namespace import archive, utility
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyxb/namespace/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import logging
import pyxb
import pyxb.namespace
from pyxb.utils import six
from pyxb.utils import sal as six

_log = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions pyxb/utils/domutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import pyxb.namespace.resolution
import pyxb.utils.saxutils
import pyxb.utils.saxdom
from pyxb.utils import six
from pyxb.utils.six.moves import xrange
from pyxb.utils import sal as six
from pyxb.utils.sal import xrange

_log = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions pyxb/utils/fac.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
import operator
import functools
import logging
from pyxb.utils import six
from pyxb.utils.six.moves import xrange
from pyxb.utils import sal as six
from pyxb.utils.sal import xrange

log_ = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit e9af3e4

Please sign in to comment.