Skip to content

Commit 950182e

Browse files
Merge pull request #18 from platinummonkey/issue-14
Drop support for python 2
2 parents e4b1e96 + 70ff513 commit 950182e

37 files changed

+1210
-1200
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: python
22
python:
3-
- '2.7'
4-
- '3.4'
3+
- '3.7'
54
install:
65
- pip install -r requirements.pip
76
- pip install tox-travis

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
.PHONY: clean-pyc ext-test test upload-docs docs coverage
22

3-
all: clean test coverage
3+
all: clean black test coverage
4+
5+
black:
6+
black -v -l 150 --include wiremock/*.py
7+
black -v -l 150 --include wiremock/base/*.py
8+
black -v -l 150 --include wiremock/exceptions/*.py
9+
black -v -l 150 --include wiremock/resources/*.py
10+
black -v -l 150 --include wiremock/resources/mappings/*.py
11+
black -v -l 150 --include wiremock/resources/near_misses/*.py
12+
black -v -l 150 --include wiremock/resources/requests/*.py
13+
black -v -l 150 --include wiremock/resources/scenarios/*.py
14+
black -v -l 150 --include wiremock/resources/settings/*.py
15+
black -v -l 150 --include wiremock/server/*.py
16+
black -v -l 150 --include wiremock/tests/*.py
17+
black -v -l 150 --include wiremock/tests/base_tests/*.py
18+
black -v -l 150 --include wiremock/tests/resource_tests/*.py
19+
black -v -l 150 --include wiremock/tests/resource_tests/mappings_tests/*.py
20+
black -v -l 150 --include wiremock/tests/resource_tests/near_misses_tests/*.py
21+
black -v -l 150 --include wiremock/tests/resource_tests/requests_tests/*.py
22+
black -v -l 150 --include wiremock/tests/resource_tests/scenarios_tests/*.py
23+
black -v -l 150 --include wiremock/tests/resource_tests/settings_tests/*.py
24+
black -v -l 150 --include wiremock/tests/server_tests/*.py
425

526
test:
627
bash run_tests.sh

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ ChangeLog
55

66
Changes to the library are recorded here.
77

8+
v2.0.0
9+
------
10+
* Fixes issue #14
11+
* Drops support for Python 2.x as this is EOL.
12+
813
v1.2.0
914
------
1015
* Add custom cert/verification options to be passed normally through the singleton config

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Links
1313
* Official Repository: https://github.com/platinummonkey/python-wiremock.git
1414
* Package: TODO
1515

16-
wiremock is known to support Python 2.7.
16+
wiremock is known to support Python 3.7.
1717

1818

1919
.. _download:

requirements.pip

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
coverage~=4.3.4
2-
detox~=0.10.0
3-
docutils~=0.13.1
4-
mock~=2.0.0
5-
nose~=1.3.7
6-
python-coveralls~=2.9.0
7-
responses~=0.5.1
8-
requests~=2.13.0
9-
six>=1.10.0
10-
Sphinx~=1.5.3
11-
sphinx-rtd-theme~=0.2.4
12-
tox~=2.6.0
13-
virtualenv~=15.1.0
14-
watchdog~=0.8.3
15-
wheel>=0.24.0
1+
black==19.10b0
2+
coverage==5.0.3
3+
detox==0.19
4+
docutils==0.16
5+
mock==4.0.1
6+
nose==1.3.7
7+
python-coveralls==2.9.3
8+
requests==2.23.0
9+
responses==0.10.9
10+
Sphinx==2.4.3
11+
sphinx-rtd-theme==0.4.3
12+
toml==0.10.0
13+
tox==3.14.5
14+
virtualenv==20.0.5
15+
watchdog==0.10.2

setup.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77

88
version = open('wiremock/VERSION', 'r').readline().strip()
99
develop_requires = [
10-
'Sphinx~=1.5.3',
11-
'coverage~=4.3.4',
12-
'detox~=0.10.0',
13-
'mock~=2.0.0',
10+
'Sphinx~=2.4.3',
11+
'black~=19.10b0',
12+
'coverage~=5.0.3',
13+
'detox~=0.19',
14+
'mock~=4.0.1',
1415
'nose~=1.3.7',
15-
'python-coveralls~=2.9.0',
16-
'responses~=0.5.1',
17-
'requests>=2.20.0',
18-
'six>=1.10.0',
19-
'sphinx-rtd-theme~=0.2.4',
20-
'tox~=2.6.0',
21-
'watchdog~=0.8.3',
22-
'wheel>=0.24.0']
16+
'python-coveralls~=2.9.3',
17+
'responses~=0.10.9',
18+
'requests~=2.23.0',
19+
'sphinx-rtd-theme~=0.4.3',
20+
'tox~=3.14.0',
21+
'watchdog~=0.10.2',
22+
'wheel>=0.34.2']
2323

2424
long_desc = """
2525
wiremock is an API Client to the Admin API for WireMock Standalone installation: https://wiremock.org/docs
@@ -52,20 +52,19 @@
5252
],
5353
keywords='wiremock',
5454
install_requires=[
55-
'setuptools>=35.0.1',
56-
'six>=1.10.0',
55+
'setuptools>=45.2.0',
5756
'requests>=2.20.0'
5857
],
5958
extras_require={
6059
'develop': develop_requires,
61-
'docs': ['Sphinx>=1.5.3', 'sphinx-rtd-theme>=0.2.4', 'watchdog>=0.8.3'],
60+
'docs': ['Sphinx>=2.4.3', 'sphinx-rtd-theme>=0.4.3', 'watchdog>=0.10.2'],
6261
},
6362
test_suite='nose.collector',
6463
tests_require=develop_requires,
6564
author='Cody Lee',
66-
author_email='[email protected]',
65+
author_email='[email protected]',
6766
maintainer='Cody Lee',
68-
maintainer_email='[email protected]',
67+
maintainer_email='[email protected]',
6968
url='https://github.com/platinummonkey/python-wiremock',
7069
license='Apache Software License 2.0',
7170
packages=find_packages(),

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[tox]
2-
envlist = py{27,34}
2+
envlist = py{37}
33

44
[testenv]
55
whitelist_externals =
66
rm
77
deps =
88
nose
99
coverage
10-
setuptools>=35.0.1
10+
setuptools>=45.2.0
1111
six
1212
mock
1313
responses

wiremock/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0
1+
2.0.0

wiremock/_compat.py

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
1-
from __future__ import unicode_literals
2-
import six
3-
4-
PY2 = six.PY2
5-
PY3 = six.PY3
6-
7-
# conversions
8-
unichr = six.unichr
9-
if PY3:
10-
long_ = int
11-
else:
12-
long_ = long
13-
text_type = six.text_type
14-
string_types = six.string_types
15-
integer_types = six.integer_types
16-
bool_types = (bool, )
17-
binary_types = (six.binary_type, )
18-
float_types = (float, )
19-
array_types = (tuple, list)
20-
int_to_byte = six.int2byte
21-
22-
# iterator functions
23-
iterkeys = six.iterkeys
24-
itervalues = six.itervalues
25-
iteritems = six.iteritems
26-
iterlists = six.iterlists
27-
iterbytes = six.iterbytes
28-
reraise = six.reraise
29-
30-
with_metaclass = six.with_metaclass
31-
add_metaclass = six.add_metaclass
32-
print_ = six.print_
33-
urllib = six.moves.urllib
34-
35-
get_method_self = six.get_method_self
1+
import sys
2+
import types
3+
4+
5+
def with_metaclass(meta, *bases):
6+
"""Create a base class with a metaclass."""
7+
# This requires a bit of explanation: the basic idea is to make a dummy
8+
# metaclass for one level of class instantiation that replaces itself with
9+
# the actual metaclass.
10+
class metaclass(type):
11+
def __new__(cls, name, this_bases, d):
12+
if sys.version_info[:2] >= (3, 7):
13+
# This version introduced PEP 560 that requires a bit
14+
# of extra care (we mimic what is done by __build_class__).
15+
resolved_bases = types.resolve_bases(bases)
16+
if resolved_bases is not bases:
17+
d["__orig_bases__"] = bases
18+
else:
19+
resolved_bases = bases
20+
return meta(name, resolved_bases, d)
21+
22+
@classmethod
23+
def __prepare__(cls, name, this_bases):
24+
return meta.__prepare__(name, bases)
25+
26+
return type.__new__(metaclass, "temporary_class", (), {})
27+
28+
29+
def add_metaclass(metaclass):
30+
"""Class decorator for creating a class with a metaclass."""
31+
32+
def wrapper(cls):
33+
orig_vars = cls.__dict__.copy()
34+
slots = orig_vars.get("__slots__")
35+
if slots is not None:
36+
if isinstance(slots, str):
37+
slots = [slots]
38+
for slots_var in slots:
39+
orig_vars.pop(slots_var)
40+
orig_vars.pop("__dict__", None)
41+
orig_vars.pop("__weakref__", None)
42+
if hasattr(cls, "__qualname__"):
43+
orig_vars["__qualname__"] = cls.__qualname__
44+
return metaclass(cls.__name__, cls.__bases__, orig_vars)
45+
46+
return wrapper

0 commit comments

Comments
 (0)