Switch to vcversioner, use repoze.lru only on 2.6, and add extras_require for format.

This commit is contained in:
Julian Berman 2015-03-15 11:45:34 -04:00
parent 5f91ee6876
commit e2a604f7eb
No known key found for this signature in database
GPG Key ID: 3F8D9C8C011729F8
7 changed files with 27 additions and 41 deletions

23
.gitignore vendored
View File

@ -1,26 +1,7 @@
.DS_Store
.idea
*.pyc
*.pyo
*.egg-info
_build
build
dist
MANIFEST
.coverage
.coveragerc
coverage
htmlcov
_cache
_static
_templates
_trial_temp
.tox
TODO
jsonschema/_version.py

View File

@ -1,4 +1,5 @@
include *.rst
include COPYING
include tox.ini
include version.txt
recursive-include json *

View File

@ -19,6 +19,6 @@ from jsonschema.validators import (
Draft3Validator, Draft4Validator, RefResolver, validate
)
from jsonschema.version import __version__
from jsonschema._version import __version__
# flake8: noqa

View File

@ -10,6 +10,7 @@ except ImportError:
from collections.abc import MutableMapping, Sequence # noqa
PY3 = sys.version_info[0] >= 3
PY26 = sys.version_info[:2] == (2, 6)
if PY3:
zip = zip
@ -24,7 +25,6 @@ if PY3:
iteritems = operator.methodcaller("items")
else:
from itertools import izip as zip # noqa
from repoze.lru import lru_cache
from StringIO import StringIO
from urlparse import (
urljoin, urlunsplit, SplitResult, urlsplit as _urlsplit # noqa
@ -35,6 +35,11 @@ else:
int_types = int, long
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
def urlsplit(url):

View File

@ -1 +0,0 @@
__version__ = "2.5.0-dev"

View File

@ -1,14 +1,10 @@
import os.path
from setuptools import setup
import os
import sys
# Load __version__ info globals without importing anything
with open(
os.path.join(os.path.dirname(__file__), 'jsonschema', 'version.py')
) as fh:
exec(fh.read())
from setuptools import setup
with open("README.rst") as readme:
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
long_description = readme.read()
classifiers = [
@ -26,16 +22,22 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
install_requires = []
if sys.version_info < (3, 2):
install_requires.append('repoze.lru >= 0.6')
extras_require = {"format" : ["rfc3987", "strict-rfc3339", "webcolors"]}
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(
name="jsonschema",
version=__version__,
packages=["jsonschema", "jsonschema.tests"],
package_data={"jsonschema": ["schemas/*.json"]},
setup_requires=["vcversioner"],
install_requires=install_requires,
extras_require=extras_require,
author="Julian Berman",
author_email="Julian@GrayVines.com",
classifiers=classifiers,
@ -44,5 +46,5 @@ setup(
long_description=long_description,
url="http://github.com/Julian/jsonschema",
entry_points={"console_scripts": ["jsonschema = jsonschema.cli:main"]},
install_requires=install_requires,
vcversioner={"version_module_paths" : ["jsonschema/_version.py"]},
)

View File

@ -10,11 +10,9 @@ commands =
py{26,27,34,py}: sphinx-build -b doctest {toxinidir}/docs {envtmpdir}/html
deps =
pytest
strict-rfc3339
webcolors
py{27,34,py,py3}: rfc3987
py26: argparse
-e{toxinidir}[format]
py26: unittest2
py{26,27,py,py3}: mock