Skip to content

Commit f74298a

Browse files
author
Sorin Sbarnea
committed
v0.4.4 which finally brings nothing more than Python 3 compatibility
1 parent 69437d9 commit f74298a

17 files changed

+704
-338
lines changed

MANIFEST.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
include README.txt
1+
include README.rst
22
include CHANGES.txt
33
recursive-include docs *.*
4-
recursive-include src *.txt *.py *.tar.gz README
4+
recursive-include wstools *.py
55

README.mdown

-30
This file was deleted.

README.rst

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
=========================================================
2+
WSDL parsing services package for Web Services for Python
3+
=========================================================
4+
5+
. image:: https://pypip.in/py_versions/wstools/badge.svg?style=flat
6+
:target: https://pypi.python.org/pypi/wstools/
7+
8+
.. image:: https://pypip.in/license/wstools/badge.svg?style=flat
9+
:target: https://pypi.python.org/pypi/wstools/
10+
11+
.. image:: https://pypip.in/download/wstools/badge.svg?style=flat
12+
:target: https://pypi.python.org/pypi/wstools/
13+
14+
.. image:: https://pypip.in/version/wstools/badge.svg?style=flat
15+
:target: https://pypi.python.org/pypi/wstools/
16+
17+
.. image:: https://pypip.in/egg/wstools/badge.svg?style=flat
18+
:target: https://pypi.python.org/pypi/wstools/
19+
20+
.. image:: https://pypip.in/wheel/wstools/badge.svg?style=flat
21+
:target: https://pypi.python.org/pypi/wstools/
22+
23+
------------
24+
25+
.. image:: https://api.travis-ci.org/pycontribs/wstools.svg?branch=master
26+
:target: https://travis-ci.org/pycontribs/wstools
27+
28+
.. image:: https://pypip.in/status/wstools/badge.svg?style=flat
29+
:target: https://pypi.python.org/pypi/wstools/
30+
31+
.. image:: https://img.shields.io/coveralls/pycontribs/wstools.svg
32+
:target: https://coveralls.io/r/pycontribs/wstools
33+
34+
.. image:: http://api.flattr.com/button/flattr-badge-large.png
35+
:target: https://flattr.com/submit/auto?user_id=sbarnea&url=https://github.com/pycontribs/wstools&title=Python wstools&language=&tags=github&category=software
36+
37+
38+
General
39+
=======
40+
41+
- Homepage: https://github.com/pycontribs/wstools
42+
- Mailing List: https://groups.google.com/forum/#!forum/pycontribs
43+
- Package: http://pypi.python.org/pypi/wstools/
44+
- Docs (TBD): http://packages.python.org/wstools
45+
46+
Credits
47+
=======
48+
49+
Companies
50+
---------
51+
52+
\|makinacom\|\_
53+
54+
- ``Planet Makina Corpus <http://www.makina-corpus.org>``\ \_
55+
- ``Contact us <mailto:[email protected]>``\ \_
56+
57+
.. \|makinacom\| image:: http://depot.makina-corpus.org/public/logo.gif
58+
.. \_makinacom: http://www.makina-corpus.com
59+
60+
Authors
61+
-------
62+
63+
- Makina Corpus [email protected]
64+
65+
Contributors
66+
------------
67+
68+
- Sorin Sbarnea [email protected]
69+
70+
.. |Build Status| image:: https://travis-ci.org/kartoch/wstools.svg?branch=master
71+
:target: https://travis-ci.org/kartoch/wstools
72+
.. |Coverage Status| image:: https://img.shields.io/coveralls/kartoch/wstools.svg
73+
:target: https://coveralls.io/r/kartoch/wstools?branch=master

setup.cfg

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[metadata]
2+
description-file = README
3+
4+
[bdist_wheel]
5+
universal = 1
6+
7+
[build_sphinx]
8+
source-dir = docs
9+
build-dir = docs/build
10+
all_files = 1
11+
12+
[upload_sphinx]
13+
upload-dir = docs/build/html
14+
15+
[pytest]
16+
norecursedirs = . .svn jira _build tmp* lib/third lib *.egg bin distutils build docs demo
17+
python_files = *.py
18+
addopts = -p no:xdist --ignore=setup.py --tb=long -rsxX -v --maxfail=10 --pep8 tests
19+
# --maxfail=2 -n4
20+
# -n4 runs up to 4 parallel procs
21+
# --maxfail=2 fail fast, dude
22+
# --durations=3 report the top 3 longest tests
23+
24+
# these are important for distributed testing, to speedup their execution we minimize what we sync
25+
rsyncdirs = . jira demo docs
26+
rsyncignore = .hg .git
27+
pep8ignore = E501 E265 E127 E901 E128 E402
28+
29+
[pep8]
30+
exclude=build,lib,.tox,third,*.egg,docs,packages
31+
;filename=
32+
;select
33+
ignore=E501,E265,E402
34+
max-line-length=1024
35+
count=1
36+
;format
37+
;quiet
38+
;show-pep8
39+
;show-source
40+
statistics=1
41+
;verbose=1
42+
43+
;PEP8_OPTS="--filename=*.py --exclude=lib --ignore=E501 scripts"
44+
;pep8 $PEP8_OPTS --show-source --repeat
45+
;pep8 --statistics -qq $PEP8_OPTS

setup.py

+158-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,171 @@
11
#!/usr/bin/env python
2-
2+
import logging
33
import os
4-
from setuptools import setup
4+
import re
5+
import sys
6+
import subprocess
7+
import warnings
8+
import codecs
9+
10+
from setuptools import setup, find_packages, Command
11+
from setuptools.command.test import test as TestCommand
512

13+
NAME = "wstools"
614
url = "https://github.com/pycontribs/wstools.git"
715

16+
# Get the version - do not use normal import because it does break coverage
17+
base_path = os.path.dirname(__file__)
18+
fp = open(os.path.join(base_path, NAME, 'version.py'))
19+
__version__ = re.compile(r".*__version__\s*=\s*['\"](.*?)['\"]",
20+
re.S).match(fp.read()).group(1)
21+
fp.close()
22+
23+
# this should help getting annoying warnings from inside distutils
24+
warnings.simplefilter('ignore', UserWarning)
25+
26+
27+
class PyTest(TestCommand):
28+
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
29+
30+
def initialize_options(self):
31+
TestCommand.initialize_options(self)
32+
self.pytest_args = []
33+
34+
FORMAT = '%(levelname)-10s %(message)s'
35+
logging.basicConfig(format=FORMAT)
36+
logging.getLogger().setLevel(logging.INFO)
37+
38+
# if we have pytest-cache module we enable the test failures first mode
39+
try:
40+
import pytest_cache
41+
self.pytest_args.append("--ff")
42+
except ImportError:
43+
pass
44+
self.pytest_args.append("-s")
45+
46+
if sys.stdout.isatty():
47+
# when run manually we enable fail fast
48+
self.pytest_args.append("--maxfail=1")
49+
try:
50+
import coveralls
51+
self.pytest_args.append("--cov=%s" % NAME)
52+
self.pytest_args.extend(["--cov-report", "term"])
53+
self.pytest_args.extend(["--cov-report", "xml"])
54+
55+
except ImportError:
56+
pass
857

9-
def read(*rnames):
10-
return "\n" + open(
11-
os.path.join('.', *rnames)
12-
).read()
58+
def finalize_options(self):
59+
TestCommand.finalize_options(self)
60+
self.test_args = []
61+
self.test_suite = True
1362

14-
long_description = \
15-
"WSDL parsing services package for Web Services for Python. see" + url
63+
def run_tests(self):
64+
# before running tests we need to run autopep8
65+
try:
66+
r = subprocess.check_call(
67+
"python -m autopep8 -r --in-place wstools/ tests/",
68+
shell=True)
69+
except subprocess.CalledProcessError:
70+
logging.getLogger().warn('autopep8 is not installed so '
71+
'it will not be run')
72+
# import here, cause outside the eggs aren't loaded
73+
import pytest
74+
errno = pytest.main(self.pytest_args)
75+
sys.exit(errno)
1676

17-
from wstools.version import __version__
1877

19-
install_requires = [
20-
'docutils'
21-
]
78+
class Release(Command):
79+
user_options = []
80+
81+
def initialize_options(self):
82+
# Command.initialize_options(self)
83+
pass
84+
85+
def finalize_options(self):
86+
# Command.finalize_options(self)
87+
pass
88+
89+
def run(self):
90+
import json
91+
try:
92+
from urllib.request import urlopen
93+
except ImportError:
94+
from urllib2 import urlopen
95+
response = urlopen(
96+
"http://pypi.python.org/pypi/%s/json" % NAME)
97+
data = json.load(codecs.getreader("utf-8")(response))
98+
released_version = data['info']['version']
99+
if released_version == __version__:
100+
raise RuntimeError(
101+
"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)
102+
elif released_version > __version__:
103+
raise RuntimeError("Cannot release a version (%s) smaller than the PyPI current release (%s)." % (
104+
__version__, released_version))
105+
106+
107+
class PreRelease(Command):
108+
user_options = []
109+
110+
def initialize_options(self):
111+
# Command.initialize_options(self)
112+
pass
113+
114+
def finalize_options(self):
115+
# Command.finalize_options(self)
116+
pass
117+
118+
def run(self):
119+
import json
120+
try:
121+
from urllib.request import urlopen
122+
except ImportError:
123+
from urllib2 import urlopen
124+
response = urlopen(
125+
"http://pypi.python.org/pypi/%s/json" % NAME)
126+
data = json.load(codecs.getreader("utf-8")(response))
127+
released_version = data['info']['version']
128+
if released_version >= __version__:
129+
raise RuntimeError(
130+
"Current version of the package is equal or lower than the already published ones (PyPi). Increse version to be able to pass prerelease stage.")
131+
22132

23133
setup(
24-
name="wstools",
134+
name=NAME,
25135
version=__version__,
26-
description="wstools",
27-
maintainer="Gregory Warnes, kiorky, sorin",
28-
maintainer_email="[email protected], "
29-
30-
url=url,
31-
long_description=long_description,
32-
packages=['wstools'],
33-
install_requires=install_requires,
136+
cmdclass={'test': PyTest, 'release': Release, 'prerelease': PreRelease},
137+
packages=find_packages(exclude=['tests']),
138+
include_package_data=True,
139+
install_requires=['docutils','six'],
140+
141+
license='BSD',
142+
description="WSDL parsing services package for Web Services for Python. see" + url,
143+
long_description=open("README.rst").read(),
144+
maintainer="Sorin Sbarnea",
145+
maintainer_email="[email protected]",
146+
author='Makina Corpus',
147+
author_email='[email protected]',
148+
provides=[NAME],
149+
url='https://github.com/pycontribs/wstools',
150+
bugtrack_url='https://github.com/pycontribs/wstools/issues',
151+
home_page='https://github.com/pycontribs/wstools',
152+
keywords='api wstools wdsl web',
153+
classifiers=[
154+
'Programming Language :: Python',
155+
'Programming Language :: Python :: 2.5',
156+
'Programming Language :: Python :: 2.6',
157+
'Programming Language :: Python :: 2.7',
158+
'Programming Language :: Python :: 3',
159+
'Development Status :: 4 - Beta',
160+
'Environment :: Other Environment',
161+
'Intended Audience :: Developers',
162+
'License :: OSI Approved :: BSD License',
163+
'Operating System :: OS Independent',
164+
'Topic :: Software Development :: Libraries :: Python Modules',
165+
'Programming Language :: Python :: 2.6',
166+
'Programming Language :: Python :: 2.7',
167+
'Programming Language :: Python :: 3.3',
168+
'Programming Language :: Python :: 3.4',
169+
'Topic :: Internet :: WWW/HTTP',
170+
],
34171
)

tests/config.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[services_by_file]
1111
ip2geo = data/ip2geo.wsdl
1212
zip2geo = data/zip2geo.wsdl
13-
soapi-dlw = data/soapi-1.63.0-dlw.wsdl
13+
soapi-dlw = data/soapi-1.63.0-dlw.wsdl
1414
soapi-re = data/soapi-1.63.0-re.wsdl
1515

1616
##########################################################################
@@ -209,7 +209,7 @@ FOPService = http://live.capescience.com/wsdl/FOPService.wsdl
209209
FedRoutingDirectoryService = http://demo.soapam.com/services/FedEpayDirectory/FedEpayDirectoryService.wsdl
210210
GMChart = http://service.graphmagic.com/GMService/GraphMagic.asmx?wsdl
211211
GeoPlaces = http://www.codebump.com/services/placelookup.asmx?wsdl
212-
GlobalWeather = http://live.capescience.com/wsdl/GlobalWeather.wsdl
212+
GlobalWeatherComplex = http://live.capescience.com/wsdl/GlobalWeather.wsdl
213213
GoogleSearch = http://api.google.com/GoogleSearch.wsdl
214214
HPcatalogService = http://www.lixusnet.com/lixusnet/HPcatalog.jws?wsdl
215215
HTMLeMail = http://www.framewerks.com/WebServices/HTMLeMail/HTMLeMail.asmx?WSDL
@@ -245,7 +245,7 @@ SendSMS = http://www.webservicex.net/SendSMS.asmx?WSDL
245245
Server = http://addison.ra.cwru.edu/orc/calendar_copy/server.php?wsdl
246246
Service = http://www.ejse.com/WeatherService/Service.asmx?WSDL
247247
SpamKillerService = http://wavendon.dsdata.co.uk/axis/services/SpamKiller?wsdl
248-
StockQuotes = http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL
248+
StockQuotesComplex = http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL
249249
TWSFissionDotNet = http://www.sidespace.com/ws/fission/fissiondotnet.php?wsdl
250250
TerraService = http://terraservice.net/TerraService.asmx?WSDL
251251
Transform = http://transform.dataconcert.com/transform.wsdl

0 commit comments

Comments
 (0)