From 027feac3cd6d2970ec56d08c566cef66731b637e Mon Sep 17 00:00:00 2001 From: Bastien Vallet Date: Wed, 22 Jul 2020 11:35:43 +0200 Subject: [PATCH] [compat] Drop support of PY2 Allowing to drop six requirement --- .github/workflows/ci.yml | 18 ------------------ docs/conf.py | 1 - json/bin/jsonschema_suite | 1 - jsonschema/cli.py | 1 - jsonschema/validators.py | 7 +------ setup.cfg | 6 ++---- tox.ini | 2 +- 7 files changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9c458501..e0cc77f83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,6 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] python-version: - - name: pypy2 - toxenv: pypy2-build - - name: pypy2 - toxenv: pypy2-tests - - name: pypy2 - toxenv: pypy2-tests_nongpl - - name: pypy2 - toxenv: safety - name: pypy3 toxenv: pypy3-build - name: pypy3 @@ -70,16 +62,6 @@ jobs: - name: 3.8 toxenv: py38-tests_nongpl exclude: - # Building on Windows isn't supported, and PyPy on Windows - # seems to fail with silent obscure errors. - - os: windows-latest - python-version: - name: pypy2 - toxenv: pypy2-build - - os: windows-latest - python-version: - name: pypy2 - toxenv: safety - os: windows-latest python-version: name: pypy3 diff --git a/docs/conf.py b/docs/conf.py index d88cc3ae3..00a9a3e41 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -83,7 +83,6 @@ doctest_global_setup = dedent( """ - from __future__ import print_function from jsonschema import * """ ) diff --git a/json/bin/jsonschema_suite b/json/bin/jsonschema_suite index c8bb7ba32..9ccd8e8fe 100755 --- a/json/bin/jsonschema_suite +++ b/json/bin/jsonschema_suite @@ -1,5 +1,4 @@ #! /usr/bin/env python3 -from __future__ import print_function from pprint import pformat import argparse import errno diff --git a/jsonschema/cli.py b/jsonschema/cli.py index abea97666..7a3291790 100644 --- a/jsonschema/cli.py +++ b/jsonschema/cli.py @@ -2,7 +2,6 @@ The ``jsonschema`` command line. """ -from __future__ import absolute_import from textwrap import dedent import argparse import errno diff --git a/jsonschema/validators.py b/jsonschema/validators.py index 13a96647f..dd4a3abe4 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -1,15 +1,11 @@ """ Creation and extension of validators, with implementations for existing drafts. """ -from __future__ import division - from warnings import warn import contextlib import json import numbers -from six import add_metaclass - from jsonschema import ( _legacy_validators, _types, @@ -247,8 +243,7 @@ def create( else: _created_with_default_types = None - @add_metaclass(_DefaultTypesDeprecatingMetaClass) - class Validator(object): + class Validator(metaclass=_DefaultTypesDeprecatingMetaClass): VALIDATORS = dict(validators) META_SCHEMA = dict(meta_schema) diff --git a/setup.cfg b/setup.cfg index daed51e85..fdc3a5b93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,14 +15,13 @@ classifiers = License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy +python_requires = ">=3.6" [options] packages = find: @@ -31,7 +30,6 @@ install_requires = functools32;python_version<'3' importlib_metadata;python_version<'3.8' pyrsistent>=0.14.0 - six>=1.11.0 [options.extras_require] format = diff --git a/tox.ini b/tox.ini index 2d2f2b8e4..073f7b7b2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{36,37,38,py2,py3}-{build,tests,tests_nongpl}, + py{36,37,38,py3}-{build,tests,tests_nongpl}, demo readme safety