Skip to content

Commit

Permalink
Added support for Python 3.7
Browse files Browse the repository at this point in the history
Details:

- Added Python 3.7 to setup.cfg, .travis.yml, and appveyor.xml.
  In .travis.yml, specified distro: xenial for Python 3.7, because of Travis
  issue #9069 (travis-ci/travis-ci#9069).
  In .travis.yml, now running py34 latest and py37 minimum.

- Changed Python version support statement in docs/intro.rst to
  "... 3.4, and higher", to avoid a long list of Python 3.x versions.

- Added support to CIMInt (superclass of Uint32, etc.) to accept
  a keyword argument named 'x' for the value, and to pass it
  on as a positional argument. Reason is that Python 3.7 removed
  support for passing the value to int() as a keyword argument
  named 'x'.

- Fixed test case "Dict from keyword args" in `test_NocaseDict_init()`
  to expect a UserWarning only before Python 3.7. Fixed the version
  that is mentioned in the message of the UserWarning in
  `NocaseDict.__init__()`, and made the check there consistent with
  the message.

- Increased minimum version of the `PyYAML` package from 3.12 to 3.13,
  in order to pick up its Python 3.7 support. That version also declares
  3.7 as supported on Pypi. For details, see PyYAML issue #126
  (yaml/pyyaml#126).

- Increased minimum version of the `lxml` package from 4.0.0 to 4.2.4,
  in order to pick up its Python 3.7 support.
  Starting with 4.2.0, lxml declares 3.7 as supported on Pypi, but we
  need 4.2.4 in order to fix an issue with missing libxml2 on Windows.

- Increased minimum version of the `pyzmq` package from 16.0.2 to 16.0.4,
  in order to pick up its Python 3.7 support. Note that while 16.0.4
  works for us, only 17.0.0 declares Python 3.6(!) support on Pypi,
  and Python 3.7 support is not officially declared on Pypi yet for this
  package.

- Increased minimum version of the `httpretty` package from 0.8.14 to 0.9.5
  in order to pick up its Python 3.7 support, but only for Python > 2.6.
  The 0.9.5 version also declares 3.7 as supported on Pypi.
  For Python == 2.6, the minimum httpretty version remains 0.8.14 because
  starting with 0.9, httpretty removed Python 2.6 support.i

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Aug 20, 2018
1 parent 4856729 commit 8cb4f46
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 23 deletions.
28 changes: 20 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ matrix:
python: "2.7"
env:
- PACKAGE_LEVEL=latest
- os: linux
language: python
python: "3.4"
env:
- PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.4"
# env:
# - PACKAGE_LEVEL=latest
# - PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "3.4"
env:
- PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.5"
Expand All @@ -75,11 +75,23 @@ matrix:
# python: "3.6"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.6"
# env:
# - PACKAGE_LEVEL=latest
- os: linux
language: python
python: "3.6"
python: "3.7"
dist: xenial
env:
- PACKAGE_LEVEL=latest
- PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.7"
# dist: xenial
# env:
# - PACKAGE_LEVEL=latest
# Note: pywbem does not install on pypy, because M2Crypto does not install.
# - os: linux
# language: python
Expand Down
3 changes: 2 additions & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: pywbem
Version: 0.12.1.dev59
Version: 0.12.1.dev70
Summary: pywbem - A WBEM client
Home-page: http://pywbem.github.io/pywbem/
Author: Tim Potter
Expand Down Expand Up @@ -44,5 +44,6 @@ Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
10 changes: 8 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ environment:
# - PYTHON_VERSION: 3.6
# PYTHON_ARCH: 32
# PYTHON_HOME: C:\Python36
- PYTHON_VERSION: 3.6
# - PYTHON_VERSION: 3.6
# PYTHON_ARCH: 64
# PYTHON_HOME: C:\Python36-x64
# - PYTHON_VERSION: 3.7
# PYTHON_ARCH: 32
# PYTHON_HOME: C:\Python37
- PYTHON_VERSION: 3.7
PYTHON_ARCH: 64
PYTHON_HOME: C:\Python36-x64
PYTHON_HOME: C:\Python37-x64

configuration:
# These values will become the values of the PACKAGE_LEVEL env.var.
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pytest>=3.3.0; python_version > '2.6'
# testfixtures 6.0.0 no longer supports py26 and fails on py26 with syntax error
testfixtures>=4.3.3,<6.0.0
httpretty>=0.8.14,<0.9.1; python_version == '2.6'
httpretty>=0.8.14; python_version > '2.6'
lxml>=4.0.0
httpretty>=0.9.5; python_version > '2.6'
lxml>=4.2.4
requests>=2.12.4
decorator>=4.0.11
yamlordereddictloader>=0.4.0
Expand Down
6 changes: 6 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ This version contains all fixes up to pywbem 0.12.4.
according to DSP0004, return equal WBEM URI strings.
See issue #1323.

* Added support for Python 3.7, which was released 2018-06-27.

**Cleanup:**

* Added connection information to all pywbem exceptions. This is done via a
Expand Down Expand Up @@ -266,6 +268,10 @@ This version contains all fixes up to pywbem 0.12.4.
CIM_Namespace, CIM_ObjectManager existing in the mocked server. See issue
#1250

* Needed to upgrade PyYAML version from >=3.12 to >=3.13 due to an issue
in PyYAML on Python 3.7, that was fixed in PyYAML 3.13.
See issue #1337.

**Known issues:**

* See `list of open issues`_.
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Pywbem is supported in these environments:
* Operating Systems: Linux, Windows (native, and with UNIX-like environments),
OS-X

* Python: 2.6, 2.7, 3.4, 3.5, 3.6 and higher
* Python: 2.6, 2.7, 3.4, and higher

* WBEM servers: Any WBEM server that conforms to the DMTF specifications listed
in :ref:`Standards conformance`. WBEM servers supporting older versions of
Expand Down
9 changes: 5 additions & 4 deletions minimum-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ wheel===0.29.0
pbr===1.10.0
six===1.10.0
ply===3.10
PyYAML===3.12
PyYAML===3.13
M2Crypto===0.30.1
ordereddict===1.1

Expand All @@ -63,8 +63,9 @@ pytest===3.0.7; python_version == '2.6'
pytest===3.3.0; python_version > '2.6'
testfixtures===4.3.3
mock===2.0.0
httpretty===0.8.14
lxml===4.0.0
httpretty===0.8.14; python_version == '2.6'
httpretty===0.9.5; python_version > '2.6'
lxml===4.2.4
requests===2.12.4
decorator===4.0.11
yamlordereddictloader===0.4.0
Expand Down Expand Up @@ -148,7 +149,7 @@ py===1.4.32; python_version == '2.6'
py===1.5.1; python_version > '2.6'
Pygments===2.1.3
pytz===2016.10
pyzmq===16.0.2
pyzmq===16.0.4
qtconsole===4.2.1
requests===2.12.4
requests-toolbelt===0.7.0
Expand Down
4 changes: 2 additions & 2 deletions pywbem/_nocasedict.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def __init__(self, *args, **kwargs):
"%s (1 allowed)" % len(args))

# Step 2: Add any keyword arguments
if len(kwargs) > 1 and sys.version_info[0:2] <= (3, 6):
if len(kwargs) > 1 and sys.version_info[0:2] < (3, 7):
warnings.warn("Initializing a pywbem.NocaseDict object from "
"keyword arguments before Python 3.6 will not "
"keyword arguments before Python 3.7 will not "
"preserve order of items",
UserWarning,
stacklevel=_stacklevel_above_module(__name__))
Expand Down
10 changes: 10 additions & 0 deletions pywbem/cim_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,16 @@ class (e.g. :class:`~pywbem.Uint8`) is created. Values outside of the
maxvalue = None

def __new__(cls, *args, **kwargs):

# Python 3.7 removed support for passing the value for int() as a
# keyword argument named 'x'. It now needs to be passed as a positional
# argument. The testclient test case definitions rely on a keyword
# argument, so we now transform the keyword arg into a positional
# arg.
if 'x' in kwargs:
args = list(*args) # args is passed as a tuple
args.append(kwargs.pop('x'))

value = _Longint(*args, **kwargs)
if ENFORCE_INTEGER_RANGE:
if value > cls.maxvalue or value < cls.minvalue:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
pbr>=1.10.0
six>=1.10.0
ply>=3.10
PyYAML>=3.12 # yaml package
PyYAML>=3.13 # yaml package
# On Windows, M2Crypto must be installed via pywbem_os_setup.bat
M2Crypto>=0.30.1; python_version < '3.0' and sys_platform != 'win32'
ordereddict>=1.1; python_version == '2.6'
Expand Down
2 changes: 1 addition & 1 deletion rtd-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pbr>=1.10.0
six>=1.10.0
ply>=3.8
PyYAML>=3.12
PyYAML>=3.13
# M2Crypto>=0.30.1 # we cannot install M2Crypto because RTD does not have Swig
Sphinx>=1.4.9
sphinx-git>=10.0.0
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ classifier =
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Software Development :: Libraries :: Python Modules
Topic :: System :: Systems Administration

Expand Down
3 changes: 2 additions & 1 deletion testsuite/test_nocasedict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import absolute_import

import sys
import re
import six
try:
Expand Down Expand Up @@ -149,7 +150,7 @@ def __hash__(self):
exp_dict=OrderedDict([('Dog', 'Cat'), ('Budgie', 'Fish')]),
verify_order=False,
),
None, UserWarning, True
None, UserWarning if sys.version_info[0:2] < (3, 7) else None, True
),
(
"Dict from list as positional arg and keyword args",
Expand Down

0 comments on commit 8cb4f46

Please sign in to comment.