From 6131504c91e374f1205cf19f8c297499c4b5eba9 Mon Sep 17 00:00:00 2001 From: alexyr Date: Mon, 23 Jan 2017 11:24:58 +0200 Subject: [PATCH 1/5] Remove unneeded 'self' from callInfoFromWSDL function --- wstools/WSDLTools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wstools/WSDLTools.py b/wstools/WSDLTools.py index 38069a2..615a339 100644 --- a/wstools/WSDLTools.py +++ b/wstools/WSDLTools.py @@ -1614,7 +1614,7 @@ def __init__(self, name, type, namespace, element_type=None): actor = None -def callInfoFromWSDL(self, port, name): +def callInfoFromWSDL(port, name): logger = logging.getLogger(__name__) """Return a SOAPCallInfo given a WSDL port and operation name.""" wsdl = port.getService().getWSDL() From 79c276843454fb21d31ec37cfcd55740f0ed80c8 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 23 Jan 2017 10:18:42 +0000 Subject: [PATCH 2/5] Fixed linting --- tests/test_wstools_net.py | 1 + wstools/Namespaces.py | 3 +++ wstools/Utility.py | 10 ++++++---- wstools/WSDLTools.py | 10 ++++++---- wstools/XMLSchema.py | 21 ++++++++++++++------- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/tests/test_wstools_net.py b/tests/test_wstools_net.py index a91900f..3923a11 100644 --- a/tests/test_wstools_net.py +++ b/tests/test_wstools_net.py @@ -18,5 +18,6 @@ def test_runner(): runner = unittest.TextTestRunner() runner.run(makeTestSuite()) + if __name__ == "__main__": test_runner() diff --git a/wstools/Namespaces.py b/wstools/Namespaces.py index 31c662f..dced3e2 100644 --- a/wstools/Namespaces.py +++ b/wstools/Namespaces.py @@ -131,6 +131,7 @@ class BASEFAULTS: # WSDL_LIST = (WSDL_DRAFT1, WSDL_DRAFT3) XSD_LIST = (XSD_DRAFT1, XSD_DRAFT3) + WSRF = WSRF_V1_2 WSRFLIST = (WSRF_V1_2,) @@ -230,6 +231,7 @@ class _WSAW(str): """ ADDRESS = property(lambda s: s) + WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl") WSAW_LIST = (WSAW200605,) @@ -250,4 +252,5 @@ class GLOBUS: SIG = "http://www.globus.org/2002/04/xmlenc#gssapi-sign" TOKEN = "http://www.globus.org/ws/2004/09/security/sc#GSSAPI_GSI_TOKEN" + ZSI_SCHEMA_URI = 'http://www.zolera.com/schemas/ZSI/' diff --git a/wstools/Utility.py b/wstools/Utility.py index 241b505..c1ccd65 100644 --- a/wstools/Utility.py +++ b/wstools/Utility.py @@ -733,6 +733,7 @@ def loadFromURL(self, url): file.close() return result + DOM = DOM() @@ -1226,7 +1227,8 @@ def isEmpty(self): class Collection(UserDict): """Helper class for maintaining ordered named collections.""" - default = lambda self, k: k.name + def default(self, k): + return k.name def __init__(self, parent, key=None): UserDict.__init__(self) @@ -1260,7 +1262,8 @@ class CollectionNS(UserDict): """Helper class for maintaining ordered named collections.""" - default = lambda self, k: k.name + def default(self, k): + return k.name def __init__(self, parent, key=None): UserDict.__init__(self) @@ -1288,8 +1291,7 @@ def __setitem__(self, key, item): self.data[targetNamespace][key] = item def __isSequence(self, key): - return (isinstance(key, (tuple, list)) - and len(key) == 2) + return (isinstance(key, (tuple, list)) and len(key) == 2) def keys(self): keys = [] diff --git a/wstools/WSDLTools.py b/wstools/WSDLTools.py index 38069a2..f2684e5 100644 --- a/wstools/WSDLTools.py +++ b/wstools/WSDLTools.py @@ -431,7 +431,9 @@ def toDom(self): class Types(Collection): - default = lambda self, k: k.targetNamespace + + def default(self, k): + return k.targetNamespace def __init__(self, parent): Collection.__init__(self, parent) @@ -1485,9 +1487,9 @@ def FindExtensions(object, kind, t_type=type(())): # result = [] namespaceURI, name = kind return [item for item in object.extensions - if hasattr(item, 'nodeType') - and DOM.nsUriMatch(namespaceURI, item.namespaceURI) - and item.name == name] + if hasattr(item, 'nodeType') and + DOM.nsUriMatch(namespaceURI, item.namespaceURI) and + item.name == name] return [item for item in object.extensions if isinstance(item, kind)] diff --git a/wstools/XMLSchema.py b/wstools/XMLSchema.py index 93f8fbd..8d52902 100755 --- a/wstools/XMLSchema.py +++ b/wstools/XMLSchema.py @@ -595,10 +595,10 @@ def __init__(self, parent=None): if self._parent: self._parent = weakref.ref(parent) - if not self.__class__ == XMLSchemaComponent\ - and not (isinstance(self.__class__.required, type(XMLSchemaComponent.required)) - and isinstance(self.__class__.attributes, type(XMLSchemaComponent.attributes)) - and isinstance(self.__class__.contents, type(XMLSchemaComponent.contents))): + if (not self.__class__ == XMLSchemaComponent and + not (isinstance(self.__class__.required, type(XMLSchemaComponent.required)) and + isinstance(self.__class__.attributes, type(XMLSchemaComponent.attributes)) and + isinstance(self.__class__.contents, type(XMLSchemaComponent.contents)))): raise RuntimeError( 'Bad type for a class variable in %s' % self.__class__) @@ -1142,9 +1142,16 @@ def __init__(self, parent=None, logger=None): self.__node = None self.targetNamespace = None XMLSchemaComponent.__init__(self, parent) - f = lambda k: k.attributes['name'] - ns = lambda k: k.attributes['namespace'] - sl = lambda k: k.attributes['schemaLocation'] + + def f(k): + return k.attributes['name'] + + def ns(k): + return k.attributes['namespace'] + + def sl(k): + return k.attributes['schemaLocation'] + self.includes = Collection(self, key=sl) self.imports = Collection(self, key=ns) self.elements = Collection(self, key=f) From 3432b8bc3e3bf60c327f38beb1f44b9895a8af8c Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 23 Jan 2017 12:05:06 +0000 Subject: [PATCH 3/5] Migrated packaging to pbr Sem-Ver: bugfix --- .gitignore | 2 + .mailmap | 4 ++ .travis.yml | 67 +++++--------------- CHANGES.txt | 24 ------- MANIFEST.in | 6 -- Makefile | 5 ++ pytest.ini | 11 +--- release.sh | 53 ---------------- requirements-dev.txt | 8 ++- requirements.txt | 2 +- setup.cfg | 52 ++++++++++++++- setup.py | 148 ++----------------------------------------- tox.ini | 20 +++--- wstools/__init__.py | 12 ++++ wstools/version.py | 1 - 15 files changed, 117 insertions(+), 298 deletions(-) create mode 100644 .mailmap delete mode 100644 CHANGES.txt delete mode 100644 MANIFEST.in delete mode 100755 release.sh delete mode 100644 wstools/version.py diff --git a/.gitignore b/.gitignore index 0514dd0..6e0feb2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ build/ /.idea/modules.xml /.cache /.eggs +/ChangeLog +/AUTHORS diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..f19bb46 --- /dev/null +++ b/.mailmap @@ -0,0 +1,4 @@ +Sorin Sbarnea Sorin Sbarnea +Sorin Sbarnea Sorin Sbarnea +Sorin Sbarnea Sorin Sbarnea +Sorin Sbarnea root diff --git a/.travis.yml b/.travis.yml index 853d7ec..8463fe4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,47 +8,24 @@ python: - '2.7' - '3.4' - '3.5' +- '3.6' install: -- pip -q --log dist/pip.log install --upgrade pip setuptools py -- pip -q --log dist/pip.log install -r requirements.txt -r requirements-dev.txt -- pip check +- pip -q --log dist/pip.log install --upgrade pip setuptools tox-travis py wheel +- python setup.py sdist bdist_wheel install +- pip install ./dist/*.whl +- pip --version script: -- travis_wait python setup.py test - export PACKAGE_NAME=$(python setup.py --name) - export PACKAGE_VERSION=$(python setup.py --version) +- python setup.py --version +- tox --installpkg ./dist/*.whl --travis-after after_success: -- python travis_after_all.py -- export $(cat .to_export_back) -- | - if [ "$BUILD_LEADER" = "YES" ]; then - if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then - echo "All jobs succeeded! PUBLISHING..." - else - echo "Some jobs failed" - fi - fi - coveralls - - travis_wait python setup.py sdist bdist_wheel -after_failure: -- python travis_after_all.py -- export $(cat .to_export_back) -- | - if [ "$BUILD_LEADER" = "YES" ]; then - if [ "$BUILD_AGGREGATE_STATUS" = "others_failed" ]; then - echo "All jobs failed" - else - echo "Some jobs failed" - fi - fi -after_script: -- echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS -branches: - only: - - master - - develop + - bash <(curl -s https://codecov.io/bash) notifications: email: - pycontribs@googlegroups.com + - sorin.sbarnea@gmail.com before_deploy: - echo "before deploy..." deploy: @@ -60,8 +37,8 @@ deploy: skip_cleanup: true on: tags: false - branch: master - condition: "$BUILD_LEADER = YES" + python: 2.7 + condition: $TOXENV != docs - provider: pypi user: sorin password: @@ -69,8 +46,9 @@ deploy: distributions: sdist bdist_wheel skip_cleanup: true on: - condition: "$BUILD_LEADER = YES" - condition: "$TRAVIS_TAG = ''" + tags: true + python: 2.7 + condition: $TOXENV != docs branch: master - provider: pypi server: https://testpypi.python.org/pypi @@ -80,22 +58,11 @@ deploy: distributions: sdist bdist_wheel skip_cleanup: true on: - condition: "$BUILD_LEADER = YES" - condition: "$TRAVIS_TAG = ''" + tags: false + python: 2.7 + condition: $TOXENV != docs branch: develop -after_deploy: -- echo "Now we only have tag the changeset and push..." -- git tag $PACKAGE_VERSION -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER on $TRAVIS_BRANCH branch." -- git push -q https://$TAGPERM@github.com/pycontribs/$PACKAGE_NAME $PACKAGE_VERSION -addons: - artifacts: - debug: true - paths: - - dist/* - target_paths: $PACKAGE_NAME/$TRAVIS_BRANCH/$TRAVIS_BUILD_NUMBER-$TRAVIS_PYTHON_VERSION - working_dir: $TRAVIS_BUILD_DIR env: global: - secure: fuXwQL+KHQ96XkAFl2uQc8eK8dAjrgkup46tck/UGjVpdv1PT/yHmBKrvpFjDa50ueGbtBwTdKAwhyAmYuiZCk2IYHzdvBylCZBBji2FSpaTM59CVwgkVT6tx3HHO83X0mEX6ih9TJvZD5XhX+YUjopnseRXRq3ey3JZJXWN4RM= - secure: "pGQGM5YmHvOgaKihOyzb3k6bdqLQnZQ2OXO9QrfXlXwtop3zvZQi80Q+01l230x2psDWlwvqWTknAjAt1w463fYXPwpoSvKVCsLSSbjrf2l56nrDqnoir+n0CBy288+eIdaGEfzcxDiuULeKjlg08zrqjcjLjW0bDbBrlTXsb5U=" - - ARTIFACTS_BUCKET: pycontribs diff --git a/CHANGES.txt b/CHANGES.txt deleted file mode 100644 index 2128635..0000000 --- a/CHANGES.txt +++ /dev/null @@ -1,24 +0,0 @@ -CHANGELOG -=========== - -0.4.1 (2013-04-18) ---------------------- -- Added tox for testing and disabled the tests due to broken binary assets. - -0.4 (2012-06-26) ----------------------- -- Replaced print() with logging.debug() or warn() in order to allow users to change verbosity. -- Added release.sh script which runs tests, pep8 and allow you to release only when these are passing. - -0.3 (2011-02-21) ----------------------- -- fix url -- proper release - -0.2 - (unreleased) ----------------------- -- proper release - -0.1 - (unreleased) ----------------------- -- make wstools as an egg diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 67fd591..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include README.rst -include CHANGES.txt -include requirements.txt -include requirements-dev.txt -recursive-include docs *.* -recursive-include wstools *.py diff --git a/Makefile b/Makefile index 81ae13e..65cb8fa 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,11 @@ $(PYENV_HOME)/bin/activate: requirements*.txt touch $(PYENV_HOME)/bin/activate prepare: venv + pyenv install -s 2.7.13 + pyenv install -s 3.4.5 + pyenv install -s 3.5.2 + pyenv install -s 3.6.0 + pyenv local 2.7.13 3.4.5 3.5.2 3.6.0 @echo "INFO: === Prearing to run for package:$(PACKAGE_NAME) platform:$(PLATFORM) py:$(PYTHON_VERSION) dir:$(DIR) ===" testspace: diff --git a/pytest.ini b/pytest.ini index 48f2d4b..616ad44 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,17 +1,12 @@ [pytest] norecursedirs = . .git .svn tox _build tmp* lib/third lib *.egg bin distutils build docs demo python_files = *.py -addopts = -p no:xdist --ignore=setup.py --tb=long -rsxX -v --maxfail=10 tests -# remove "--flake8" due to weir errors +addopts = -s -p no:xdist --ignore=setup.py --tb=long -rxX -v --maxfail=10 timeout=60 +testpaths = tests # --maxfail=2 -n4 # -n4 runs up to 4 parallel procs -# --maxfail=2 fail fast, dude -# --durations=3 report the top 3 longest tests # these are important for distributed testing, to speedup their execution we minimize what we sync -rsyncdirs = . demo docs +rsyncdirs = . wstools demo docs rsyncignore = .hg .git -flake8-max-line-length = 99 -#flake8-ignore=D,D102 -flake8-ignore=D D102 H405 diff --git a/release.sh b/release.sh deleted file mode 100755 index 8f46500..0000000 --- a/release.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -ex - -VERSION=$(python -c "from wstools.version import __version__ ; print __version__") -echo Preparing to release version $VERSION - -echo === Chechink that all changes are commited and pushed === -git pull - -git diff -# Disallow unstaged changes in the working tree - if ! git diff-files --check --exit-code --ignore-submodules -- >&2 - then - echo >&2 "error: you have unstaged changes." - #git diff-files --check --exit-code --ignore-submodules -- >&2 - exit 1 - fi - -# Disallow uncommitted changes in the index - if ! git diff-index --cached --exit-code -r --ignore-submodules HEAD -- >&2 - then - echo >&2 "error: your index contains uncommitted changes." - exit 1 - fi - -git log --date=short --pretty=format:"%cd %s" > CHANGELOG -git diff - -if [ -v PS1 ] ; then - echo "Automatic deployment" -else - echo "Please don't run this as a user. This generates a new release for PyPI. Press ^C to exit or Enter to continue." - read -fi - -git add CHANGELOG -git commit -a "Auto-generating release notes." - -git tag -f -a $VERSION -m "Version $VERSION" -git tag -f -a RELEASE -m "Current RELEASE" - -NEW_VERSION="${VERSION%.*}.$((${VERSION##*.}+1))" -set -ex -sed -i ~ "s/${VERSION}/${NEW_VERSION}/" wstools/version.py - -git commit -a "Auto-increasing the version number after a release." - -# disables because this is done only by Travis CI from now, which calls this script after that. -#python setup.py register sdist bdist_wheel build_sphinx upload_docs upload --sign - -git push --force origin --tags - -echo "done." diff --git a/requirements-dev.txt b/requirements-dev.txt index 44fb82a..d198c39 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,11 @@ py >= 1.4 -hacking +hacking>=0.13 -pytest +pytest>=2.9.1 +pytest-cache pytest-cov +tox>=2.3.1 +tox-pyenv +wheel>=0.24.0 diff --git a/requirements.txt b/requirements.txt index 65223c1..9614a2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -setuptools +setuptools>=17.1 six diff --git a/setup.cfg b/setup.cfg index 7d97abf..7865ddb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,48 @@ [metadata] -description-file = README +name = wstools +author = Makina Corpus +author-email = python@makina-corpus.com +maintainer = Sorin Sbarnea +maintainer-email = sorin.sbarnea@gmail.com +summary = WSDL parsing services package for Web Services for Python. +description-file = README.rst +home-page = https://github.com/pycontribs/wstools +license = BSD +classifier = + Development Status :: 5 - Production/Stable + Environment :: Other Environment + Intended Audience :: Developers + Intended Audience :: Information Technology + License :: OSI Approved :: BSD License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Topic :: Software Development :: Libraries :: Python Modules + Topic :: Internet :: WWW/HTTP + +keywords = + api + wstools + wdsl + web + +[files] +packages = + wstools + +[entry_points] +pbr.config.drivers = + plain = pbr.cfg.driver:Plain + +[egg_info] +egg_base = . + +[aliases] +test=pytest [bdist_wheel] universal = 1 @@ -13,8 +56,11 @@ all_files = 1 upload-dir = docs/build/html [flake8] +max-line-length=160 enable-extensions = H106,H203,H904 exclude=build,.eggs,.tox -ignore=D,E402,H405,H,B001,B002 -max-line-length=160 statistics=yes +ignore=D,E402,H405,H,B001,B002 + +[pbr] +warnerrors = true \ No newline at end of file diff --git a/setup.py b/setup.py index 4d05ecf..d9887a8 100644 --- a/setup.py +++ b/setup.py @@ -1,169 +1,35 @@ #!/usr/bin/env python -import logging -import os -import re import sys -import subprocess +import setuptools import warnings -import codecs -from setuptools import setup, find_packages, Command from setuptools.command.test import test as TestCommand -from pip.req import parse_requirements -NAME = "wstools" -url = "https://github.com/pycontribs/wstools.git" - -# Get the version - do not use normal import because it does break coverage -base_path = os.path.dirname(__file__) -fp = open(os.path.join(base_path, NAME, 'version.py')) -__version__ = re.compile(r".*__version__\s*=\s*['\"](.*?)['\"]", - re.S).match(fp.read()).group(1) -fp.close() # this should help getting annoying warnings from inside distutils warnings.simplefilter('ignore', UserWarning) class PyTest(TestCommand): - user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] - FORMAT = '%(levelname)-10s %(message)s' - logging.basicConfig(format=FORMAT) - logging.getLogger().setLevel(logging.INFO) - - # if we have pytest-cache module we enable the test failures first mode - try: - import pytest_cache # noqa - self.pytest_args.append("--ff") - except ImportError: - pass - self.pytest_args.append("-s") - - if sys.stdout.isatty(): - # when run manually we enable fail fast - self.pytest_args.append("--maxfail=1") - def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): - # before running tests we need to run autopep8 - try: - subprocess.check_call( - "python -m autopep8 -r --in-place wstools/ tests/", - shell=True) - except subprocess.CalledProcessError: - logging.getLogger().warn('autopep8 is not installed so ' - 'it will not be run') # import here, cause outside the eggs aren't loaded - import pytest # noqa + import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) -class Release(Command): - user_options = [] - - def initialize_options(self): - # Command.initialize_options(self) - pass - - def finalize_options(self): - # Command.finalize_options(self) - pass - - def run(self): - import json - try: - from urllib.request import urlopen - except ImportError: - from urllib2 import urlopen - response = urlopen( - "http://pypi.python.org/pypi/%s/json" % NAME) - data = json.load(codecs.getreader("utf-8")(response)) - released_version = data['info']['version'] - if released_version == __version__: - raise RuntimeError( - "This version was already released, remove it from PyPi if you want to release it" - " again or increase the version number. http://pypi.python.org/pypi/%s/" % NAME) - elif released_version > __version__: - raise RuntimeError("Cannot release a version (%s) smaller than the PyPI current release (%s)." % ( - __version__, released_version)) - - -class PreRelease(Command): - user_options = [] - - def initialize_options(self): - # Command.initialize_options(self) - pass - - def finalize_options(self): - # Command.finalize_options(self) - pass - - def run(self): - import json - try: - from urllib.request import urlopen - except ImportError: - from urllib2 import urlopen - response = urlopen( - "http://pypi.python.org/pypi/%s/json" % NAME) - data = json.load(codecs.getreader("utf-8")(response)) - released_version = data['info']['version'] - if released_version >= __version__: - raise RuntimeError( - "Current version of the package is equal or lower than the already published ones (PyPi). Increse version to be able to pass prerelease stage.") - - -def get_requirements(*path): - req_path = os.path.join(*path) - reqs = parse_requirements(req_path, session=False) - return [str(ir.req) for ir in reqs] - - -setup( - name=NAME, - version=__version__, - cmdclass={'test': PyTest, 'release': Release, 'prerelease': PreRelease}, - packages=find_packages(exclude=['tests']), - include_package_data=True, - tests_require=get_requirements(base_path, 'requirements-dev.txt'), - setup_requires=['setuptools'], - install_requires=get_requirements(base_path, 'requirements.txt'), - - license='BSD', - description="WSDL parsing services package for Web Services for Python. see" + url, - long_description=open("README.rst").read(), - maintainer="Sorin Sbarnea", - maintainer_email="sorin.sbarnea@gmail.com", - author='Makina Corpus', - author_email='python@makina-corpus.com', - provides=[NAME], - url='https://github.com/pycontribs/wstools', - bugtrack_url='https://github.com/pycontribs/wstools/issues', - home_page='https://github.com/pycontribs/wstools', - keywords='api wstools wdsl web', - classifiers=[ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Development Status :: 5 - Production/Stable', - 'Environment :: Other Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Topic :: Internet :: WWW/HTTP', - ], -) +setuptools.setup( + setup_requires=['pbr>=1.10', 'setuptools>=17.1', 'pytest-runner'], + pbr=True, + cmdclass={'test': PyTest}, + test_suite='tests') diff --git a/tox.ini b/tox.ini index 940da37..106023e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,28 @@ [tox] minversion = 2.3.1 envlist = {py27,py34,py35,py36}-{win,linux,darwin} -#envlist = {py35}-{win,linux,darwin} -addopts = --ignore=setup.py skip_missing_interpreters = true tox_pyenv_fallback=True ignore_errors=False [testenv] -sitepackages=True +sitepackages=False platform = win: windows linux: linux darwin: darwin -deps= - -rrequirements.txt - -rrequirements-dev.txt +#deps= +# -rrequirements-dev.txt +# -rrequirements.txt commands= - python -m flake8 - python setup.py build test install sdist bdist_wheel + {envpython} -m pip install -rrequirements-dev.txt -rrequirements.txt + {envpython} -m pip check + {envpython} -m flake8 + {envpython} setup.py build test install sdist bdist_wheel # Note: do not try to use pytest-flake8 due to https://github.com/tholo/pytest-flake8/issues/8 -# python -m py.test --cov-report xml + +[travis:after] +toxenv = py27 diff --git a/wstools/__init__.py b/wstools/__init__.py index 5256129..2d1facc 100755 --- a/wstools/__init__.py +++ b/wstools/__init__.py @@ -3,5 +3,17 @@ ident = "$Id$" +from pbr.version import VersionInfo from . import WSDLTools # noqa from . import XMLname # noqa + +_v = VersionInfo('wstools').semantic_version() +__version__ = _v.release_string() +version_info = _v.version_tuple() + +__all__ = ( + 'WDSLTools', + 'XMLname', + '__version__', + 'version_info' +) diff --git a/wstools/version.py b/wstools/version.py deleted file mode 100644 index 98a433b..0000000 --- a/wstools/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.4.5" From d54050e0323e08fb754685f08eaa3dbb8aa47a40 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 23 Jan 2017 22:32:48 +0000 Subject: [PATCH 4/5] fixes #13 wrong self in callInfoFromWSDL() --- wstools/WSDLTools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wstools/WSDLTools.py b/wstools/WSDLTools.py index aae7b41..d5a90af 100644 --- a/wstools/WSDLTools.py +++ b/wstools/WSDLTools.py @@ -1688,9 +1688,9 @@ def callInfoFromWSDL(port, name): try: message = messages[operation.output.message] except KeyError: - if self.strict: + if wsdl.strict: raise RuntimeError( - "Recieved message not defined in the WSDL schema: %s" % + "Received message not defined in the WSDL schema: %s" % operation.output.message) else: message = wsdl.addMessage(operation.output.message) From 8c93f0d10284b71ae2a0e2417cfd93476cba39f3 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 23 Jan 2017 23:04:36 +0000 Subject: [PATCH 5/5] Updated travis credentials for release --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8463fe4..0dafa4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ before_deploy: deploy: - provider: releases api_key: - secure: gr9iOcQjdoAyUAim6FWKzJI9MBaJo9XKfGQGu7wdPXUFhg80Rp6GLJsowP+aU94NjXM1UQlVHDAy627WtjBlLH2SvmVEIIr7+UKBopBYuXG5jJ1m3wOZE+4f1Pqe9bqFc1DxgucqE8qF0sC24fIbNM2ToeyYrxrS6RoL2gRrX2I= + secure: "lQGRZWqBuieHqjfgSimeWHZf4RDf2kwfOdeWcQtSSAVSW7THsnak3ugWYsLII05vjaRBKdrLoRr8rlHe64A1CDq/XPSlSt1EZeI5ejV8DO8AZdprkKpO83O5xVRDYB6a3pHrOfbw9dhBMPq3LapRwAoGRkKcgVeTdtDyIJDxy9A=" file: - dist/$PACKAGE_NAME-$PACKAGE_VERSION* skip_cleanup: true