1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-10 09:35:34 +00:00

Merge pull request #435 from hugovk/rm-3.4

Drop support for EOL Python 3.4
This commit is contained in:
Luiz Menezes
2019-06-10 15:38:36 -03:00
committed by GitHub
9 changed files with 15 additions and 30 deletions

View File

@@ -1,5 +1,4 @@
language: python language: python
sudo: false
before_install: openssl version before_install: openssl version
env: env:
global: global:
@@ -18,37 +17,27 @@ matrix:
- env: TOX_SUFFIX="flakes" - env: TOX_SUFFIX="flakes"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
- env: TOX_SUFFIX="requests27" - env: TOX_SUFFIX="requests27"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
- env: TOX_SUFFIX="httplib2" - env: TOX_SUFFIX="httplib2"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
- env: TOX_SUFFIX="urllib3121" - env: TOX_SUFFIX="urllib3121"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
- env: TOX_SUFFIX="tornado4" - env: TOX_SUFFIX="tornado4"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
- env: TOX_SUFFIX="aiohttp" - env: TOX_SUFFIX="aiohttp"
python: 3.7 python: 3.7
dist: xenial dist: xenial
sudo: true
allow_failures: allow_failures:
- env: TOX_SUFFIX="boto3" - env: TOX_SUFFIX="boto3"
- env: TOX_SUFFIX="aiohttp" - env: TOX_SUFFIX="aiohttp"
python: "pypy3.5-5.9.0" python: "pypy3.5-5.9.0"
- env: TOX_SUFFIX="aiohttp"
python: 3.4
exclude: exclude:
# Only run flakes on a single Python 2.x and a single 3.x # Only run flakes on a single Python 2.x and a single 3.x
- env: TOX_SUFFIX="flakes"
python: 3.4
- env: TOX_SUFFIX="flakes" - env: TOX_SUFFIX="flakes"
python: 3.5 python: 3.5
- env: TOX_SUFFIX="flakes" - env: TOX_SUFFIX="flakes"
@@ -61,7 +50,6 @@ matrix:
python: pypy python: pypy
python: python:
- 2.7 - 2.7
- 3.4
- 3.5 - 3.5
- 3.6 - 3.6
- pypy - pypy

View File

@@ -9,7 +9,7 @@ with pip::
Compatibility Compatibility
------------- -------------
VCR.py supports Python 2.7 and 3.4+, and VCR.py supports Python 2.7 and 3.5+, and
`pypy <http://pypy.org>`__. `pypy <http://pypy.org>`__.
The following HTTP libraries are supported: The following HTTP libraries are supported:

View File

@@ -28,9 +28,7 @@ install_requires = [
'six>=1.5', 'six>=1.5',
'contextlib2; python_version=="2.7"', 'contextlib2; python_version=="2.7"',
'mock; python_version=="2.7"', 'mock; python_version=="2.7"',
'yarl; python_version>"3.4"', 'yarl; python_version>"3.5"',
'yarl<1.0.0; python_version=="3.4"',
'multidict<4.0.0,>=2.0; python_version=="3.4"'
] ]
excluded_packages = ["tests*"] excluded_packages = ["tests*"]
@@ -49,7 +47,7 @@ setup(
author_email='me@kevinmccarthy.org', author_email='me@kevinmccarthy.org',
url='https://github.com/kevin1024/vcrpy', url='https://github.com/kevin1024/vcrpy',
packages=find_packages(exclude=excluded_packages), packages=find_packages(exclude=excluded_packages),
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
install_requires=install_requires, install_requires=install_requires,
license='MIT', license='MIT',
tests_require=['pytest', 'mock', 'pytest-httpbin'], tests_require=['pytest', 'mock', 'pytest-httpbin'],
@@ -61,7 +59,6 @@ setup(
'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',

View File

@@ -44,7 +44,7 @@ def proxy_server():
target=httpd.serve_forever, target=httpd.serve_forever,
) )
proxy_process.start() proxy_process.start()
yield 'http://{0}:{1}'.format(*httpd.server_address) yield 'http://{}:{}'.format(*httpd.server_address)
proxy_process.terminate() proxy_process.terminate()

View File

@@ -1,5 +1,5 @@
[tox] [tox]
envlist = {py27,py34,py35,py36,py37,pypy}-{flakes,requests27,httplib2,urllib3121,tornado4,boto3,aiohttp} envlist = {py27,py35,py36,py37,pypy}-{flakes,requests27,httplib2,urllib3121,tornado4,boto3,aiohttp}
[testenv:flakes] [testenv:flakes]
skipsdist = True skipsdist = True

View File

@@ -68,7 +68,7 @@ def _migrate(data):
for item in data: for item in data:
req = item['request'] req = item['request']
res = item['response'] res = item['response']
uri = dict((k, req.pop(k)) for k in PARTS) uri = {k: req.pop(k) for k in PARTS}
req['uri'] = build_uri(**uri) req['uri'] = build_uri(**uri)
# convert headers to dict of lists # convert headers to dict of lists
headers = req['headers'] headers = req['headers']
@@ -100,7 +100,7 @@ def migrate_json(in_fp, out_fp):
def _list_of_tuples_to_dict(fs): def _list_of_tuples_to_dict(fs):
return dict((k, v) for k, v in fs[0]) return {k: v for k, v in fs[0]}
def _already_migrated(data): def _already_migrated(data):
@@ -159,9 +159,9 @@ def main():
for (root, dirs, files) in os.walk(path) for (root, dirs, files) in os.walk(path)
for name in files) for name in files)
for file_path in files: for file_path in files:
migrated = try_migrate(file_path) migrated = try_migrate(file_path)
status = 'OK' if migrated else 'FAIL' status = 'OK' if migrated else 'FAIL'
sys.stderr.write("[{}] {}\n".format(status, file_path)) sys.stderr.write("[{}] {}\n".format(status, file_path))
sys.stderr.write("Done.\n") sys.stderr.write("Done.\n")

View File

@@ -91,7 +91,7 @@ class Request(object):
'method': self.method, 'method': self.method,
'uri': self.uri, 'uri': self.uri,
'body': self.body, 'body': self.body,
'headers': dict(((k, [v]) for k, v in self.headers.items())), 'headers': {k: [v] for k, v in self.headers.items()},
} }
@classmethod @classmethod

View File

@@ -139,7 +139,7 @@ class VCRConnection(object):
if url and not url.startswith('/'): if url and not url.startswith('/'):
# Then this must be a proxy request. # Then this must be a proxy request.
return url return url
uri = "{0}://{1}{2}{3}".format( uri = "{}://{}{}{}".format(
self._protocol, self._protocol,
self.real_connection.host, self.real_connection.host,
self._port_postfix(), self._port_postfix(),

View File

@@ -118,10 +118,10 @@ def auto_decorate(
) )
def __new__(cls, name, bases, attributes_dict): def __new__(cls, name, bases, attributes_dict):
new_attributes_dict = dict( new_attributes_dict = {
(attribute, maybe_decorate(attribute, value)) attribute: maybe_decorate(attribute, value)
for attribute, value in attributes_dict.items() for attribute, value in attributes_dict.items()
) }
return super(DecorateAll, cls).__new__( return super(DecorateAll, cls).__new__(
cls, name, bases, new_attributes_dict cls, name, bases, new_attributes_dict
) )