Switch to vcversioner, use repoze.lru only on 2.6, and add extras_require for format.
This commit is contained in:
parent
5f91ee6876
commit
e2a604f7eb
|
@ -1,26 +1,7 @@
|
||||||
.DS_Store
|
|
||||||
.idea
|
|
||||||
|
|
||||||
*.pyc
|
|
||||||
*.pyo
|
|
||||||
|
|
||||||
*.egg-info
|
|
||||||
_build
|
|
||||||
build
|
|
||||||
dist
|
|
||||||
MANIFEST
|
|
||||||
|
|
||||||
.coverage
|
|
||||||
.coveragerc
|
|
||||||
coverage
|
|
||||||
htmlcov
|
|
||||||
|
|
||||||
_cache
|
_cache
|
||||||
_static
|
_static
|
||||||
_templates
|
_templates
|
||||||
|
|
||||||
_trial_temp
|
|
||||||
|
|
||||||
.tox
|
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
|
jsonschema/_version.py
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
include *.rst
|
include *.rst
|
||||||
include COPYING
|
include COPYING
|
||||||
include tox.ini
|
include tox.ini
|
||||||
|
include version.txt
|
||||||
recursive-include json *
|
recursive-include json *
|
||||||
|
|
|
@ -19,6 +19,6 @@ from jsonschema.validators import (
|
||||||
Draft3Validator, Draft4Validator, RefResolver, validate
|
Draft3Validator, Draft4Validator, RefResolver, validate
|
||||||
)
|
)
|
||||||
|
|
||||||
from jsonschema.version import __version__
|
from jsonschema._version import __version__
|
||||||
|
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
|
|
|
@ -10,6 +10,7 @@ except ImportError:
|
||||||
from collections.abc import MutableMapping, Sequence # noqa
|
from collections.abc import MutableMapping, Sequence # noqa
|
||||||
|
|
||||||
PY3 = sys.version_info[0] >= 3
|
PY3 = sys.version_info[0] >= 3
|
||||||
|
PY26 = sys.version_info[:2] == (2, 6)
|
||||||
|
|
||||||
if PY3:
|
if PY3:
|
||||||
zip = zip
|
zip = zip
|
||||||
|
@ -24,7 +25,6 @@ if PY3:
|
||||||
iteritems = operator.methodcaller("items")
|
iteritems = operator.methodcaller("items")
|
||||||
else:
|
else:
|
||||||
from itertools import izip as zip # noqa
|
from itertools import izip as zip # noqa
|
||||||
from repoze.lru import lru_cache
|
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from urlparse import (
|
from urlparse import (
|
||||||
urljoin, urlunsplit, SplitResult, urlsplit as _urlsplit # noqa
|
urljoin, urlunsplit, SplitResult, urlsplit as _urlsplit # noqa
|
||||||
|
@ -35,6 +35,11 @@ else:
|
||||||
int_types = int, long
|
int_types = int, long
|
||||||
iteritems = operator.methodcaller("iteritems")
|
iteritems = operator.methodcaller("iteritems")
|
||||||
|
|
||||||
|
if PY26:
|
||||||
|
from repoze.lru import lru_cache
|
||||||
|
else:
|
||||||
|
from functools32 import lru_cache
|
||||||
|
|
||||||
|
|
||||||
# On python < 3.3 fragments are not handled properly with unknown schemes
|
# On python < 3.3 fragments are not handled properly with unknown schemes
|
||||||
def urlsplit(url):
|
def urlsplit(url):
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
__version__ = "2.5.0-dev"
|
|
28
setup.py
28
setup.py
|
@ -1,14 +1,10 @@
|
||||||
import os.path
|
import os
|
||||||
from setuptools import setup
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# Load __version__ info globals without importing anything
|
from setuptools import setup
|
||||||
with open(
|
|
||||||
os.path.join(os.path.dirname(__file__), 'jsonschema', 'version.py')
|
|
||||||
) as fh:
|
|
||||||
exec(fh.read())
|
|
||||||
|
|
||||||
with open("README.rst") as readme:
|
|
||||||
|
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
|
||||||
long_description = readme.read()
|
long_description = readme.read()
|
||||||
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
@ -26,16 +22,22 @@ classifiers = [
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
"Programming Language :: Python :: Implementation :: PyPy",
|
||||||
]
|
]
|
||||||
|
|
||||||
install_requires = []
|
|
||||||
|
|
||||||
if sys.version_info < (3, 2):
|
extras_require = {"format" : ["rfc3987", "strict-rfc3339", "webcolors"]}
|
||||||
install_requires.append('repoze.lru >= 0.6')
|
if sys.version_info[:2] == (2, 6):
|
||||||
|
install_requires = ["argparse", "repoze.lru"]
|
||||||
|
elif sys.version_info[:2] == (2, 7):
|
||||||
|
install_requires = ["functools32"]
|
||||||
|
else:
|
||||||
|
install_requires = []
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="jsonschema",
|
name="jsonschema",
|
||||||
version=__version__,
|
|
||||||
packages=["jsonschema", "jsonschema.tests"],
|
packages=["jsonschema", "jsonschema.tests"],
|
||||||
package_data={"jsonschema": ["schemas/*.json"]},
|
package_data={"jsonschema": ["schemas/*.json"]},
|
||||||
|
setup_requires=["vcversioner"],
|
||||||
|
install_requires=install_requires,
|
||||||
|
extras_require=extras_require,
|
||||||
author="Julian Berman",
|
author="Julian Berman",
|
||||||
author_email="Julian@GrayVines.com",
|
author_email="Julian@GrayVines.com",
|
||||||
classifiers=classifiers,
|
classifiers=classifiers,
|
||||||
|
@ -44,5 +46,5 @@ setup(
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
url="http://github.com/Julian/jsonschema",
|
url="http://github.com/Julian/jsonschema",
|
||||||
entry_points={"console_scripts": ["jsonschema = jsonschema.cli:main"]},
|
entry_points={"console_scripts": ["jsonschema = jsonschema.cli:main"]},
|
||||||
install_requires=install_requires,
|
vcversioner={"version_module_paths" : ["jsonschema/_version.py"]},
|
||||||
)
|
)
|
||||||
|
|
6
tox.ini
6
tox.ini
|
@ -10,11 +10,9 @@ commands =
|
||||||
py{26,27,34,py}: sphinx-build -b doctest {toxinidir}/docs {envtmpdir}/html
|
py{26,27,34,py}: sphinx-build -b doctest {toxinidir}/docs {envtmpdir}/html
|
||||||
deps =
|
deps =
|
||||||
pytest
|
pytest
|
||||||
strict-rfc3339
|
|
||||||
webcolors
|
|
||||||
py{27,34,py,py3}: rfc3987
|
|
||||||
|
|
||||||
py26: argparse
|
-e{toxinidir}[format]
|
||||||
|
|
||||||
py26: unittest2
|
py26: unittest2
|
||||||
py{26,27,py,py3}: mock
|
py{26,27,py,py3}: mock
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue