commit python-jsonschema for openSUSE:Factory
Hello community, here is the log from the commit of package python-jsonschema for openSUSE:Factory checked in at 2015-09-30 05:49:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jsonschema (Old) and /work/SRC/openSUSE:Factory/.python-jsonschema.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-jsonschema" Changes: -------- --- /work/SRC/openSUSE:Factory/python-jsonschema/python-jsonschema.changes 2014-11-13 09:17:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-jsonschema.new/python-jsonschema.changes 2015-09-30 05:49:10.000000000 +0200 @@ -1,0 +2,13 @@ +Mon Jun 15 02:16:17 UTC 2015 - arun@gmx.de + +- update to version 2.5.1: + (no changelog available) +- update to version 2.5.0: + * Improved performance on CPython by adding caching around ref + resolution (#203) +- specfile: + * add python-vcversioner +- drop test requirements and %check section, which is broken +- Fix update-alternatives usage + +------------------------------------------------------------------- Old: ---- jsonschema-2.4.0.tar.gz New: ---- jsonschema-2.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jsonschema.spec ++++++ --- /var/tmp/diff_new_pack.yoQcXK/_old 2015-09-30 05:49:11.000000000 +0200 +++ /var/tmp/diff_new_pack.yoQcXK/_new 2015-09-30 05:49:11.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-jsonschema # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-jsonschema -Version: 2.4.0 +Version: 2.5.1 Release: 0 Summary: An implementation of JSON-Schema validation for Python License: MIT @@ -26,8 +26,11 @@ Source: http://pypi.python.org/packages/source/j/jsonschema/jsonschema-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-setuptools +BuildRequires: python-functools32 +BuildRequires: python-vcversioner # Test build requirements BuildRequires: python-mock +Requires: python-functools32 Requires(post): update-alternatives Requires(postun): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -50,31 +53,34 @@ %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} + +# Prepare for update-alternatives usage +mkdir -p %{buildroot}%{_sysconfdir}/alternatives mv %{buildroot}%{_bindir}/jsonschema %{buildroot}%{_bindir}/jsonschema-%{py_ver} -ln -s %{_bindir}/jsonschema-%{py_ver} %{buildroot}%{_bindir}/jsonschema +ln -s -f %{_sysconfdir}/alternatives/jsonschema %{buildroot}%{_bindir}/jsonschema +# create a dummy target for /etc/alternatives/jsonschema +touch %{buildroot}%{_sysconfdir}/alternatives/jsonschema %if 0%{?suse_version} > 1110 %check python -m unittest jsonschema.tests.test_jsonschema_test_suite %endif -%pre -[ -h %{_bindir}/jsonschema ] || rm -f %{_bindir}/jsonschema - %post -update-alternatives --install \ - %{_bindir}/jsonschema jsonschema %{_bindir}/jsonschema-%{py_ver} 20 +%_sbindir/update-alternatives \ + --install %{_bindir}/jsonschema jsonschema %{_bindir}/jsonschema-%{py_ver} 30 %preun if [ $1 -eq 0 ] ; then - update-alternatives --remove jsonschema %{_bindir}/jsonschema-%{py_ver} + %_sbindir/update-alternatives --remove jsonschema %{_bindir}/jsonschema-%{py_ver} fi %files %defattr(-,root,root,-) %doc COPYING README.rst -%ghost %{_bindir}/jsonschema +%{_bindir}/jsonschema %{_bindir}/jsonschema-%{py_ver} +%ghost %{_sysconfdir}/alternatives/jsonschema %{python_sitelib}/* %changelog ++++++ jsonschema-2.4.0.tar.gz -> jsonschema-2.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/CHANGELOG.rst new/jsonschema-2.5.1/CHANGELOG.rst --- old/jsonschema-2.4.0/CHANGELOG.rst 2014-08-19 02:53:22.000000000 +0200 +++ new/jsonschema-2.5.1/CHANGELOG.rst 2015-06-05 16:26:18.000000000 +0200 @@ -1,3 +1,9 @@ +v2.5.0 +------ + +* Improved performance on CPython by adding caching around ref resolution + (#203) + v2.4.0 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/MANIFEST.in new/jsonschema-2.5.1/MANIFEST.in --- old/jsonschema-2.4.0/MANIFEST.in 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/MANIFEST.in 2015-04-13 17:23:46.000000000 +0200 @@ -1,4 +1,5 @@ include *.rst include COPYING include tox.ini +include version.txt recursive-include json * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/PKG-INFO new/jsonschema-2.5.1/PKG-INFO --- old/jsonschema-2.4.0/PKG-INFO 2014-08-19 02:55:48.000000000 +0200 +++ new/jsonschema-2.5.1/PKG-INFO 2015-06-08 21:37:24.000000000 +0200 @@ -1,12 +1,19 @@ Metadata-Version: 1.1 Name: jsonschema -Version: 2.4.0 +Version: 2.5.1 Summary: An implementation of JSON Schema validation for Python Home-page: http://github.com/Julian/jsonschema Author: Julian Berman Author-email: Julian@GrayVines.com License: MIT -Description: ========== +Description: .. image:: https://img.shields.io/pypi/v/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema + .. image:: https://travis-ci.org/Julian/jsonschema.svg?branch=master + :target: https://travis-ci.org/Julian/jsonschema + .. image:: https://img.shields.io/pypi/l/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema + + ========== jsonschema ========== @@ -57,25 +64,18 @@ Release Notes ------------- - * A simple CLI was added for validation - * Validation errors now keep full absolute paths and absolute schema paths in - their ``absolute_path`` and ``absolute_schema_path`` attributes. The ``path`` - and ``schema_path`` attributes are deprecated in favor of ``relative_path`` - and ``relative_schema_path``\ . + Version 2.5.0 is mainly a performance release. The interface for `RefResolver` + was extended to add methods that improve performance on CPython. - *Note:* Support for Python 3.2 was dropped in this release, and installation - now uses setuptools. + Support for custom `RefResolver` objects with the legacy interface should *not* + be affected. If you notice something amiss please file an issue ticket. Running the Test Suite ---------------------- - ``jsonschema`` uses the wonderful `Tox <http://tox.readthedocs.org>`_ for its - test suite. (It really is wonderful, if for some reason you haven't heard of - it, you really should use it for your projects). - - Assuming you have ``tox`` installed (perhaps via ``pip install tox`` or your - package manager), just run ``tox`` in the directory of your source checkout to + If you have ``tox`` installed (perhaps via ``pip install tox`` or your + package manager), running``tox`` in the directory of your source checkout will run ``jsonschema``'s test suite on all of the versions of Python ``jsonschema`` supports. Note that you'll need to have all of those versions installed in order to run the tests on each of them, otherwise ``tox`` will skip (and fail) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/README.rst new/jsonschema-2.5.1/README.rst --- old/jsonschema-2.4.0/README.rst 2014-08-19 02:53:32.000000000 +0200 +++ new/jsonschema-2.5.1/README.rst 2015-06-08 18:03:55.000000000 +0200 @@ -1,3 +1,10 @@ +.. image:: https://img.shields.io/pypi/v/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema +.. image:: https://travis-ci.org/Julian/jsonschema.svg?branch=master + :target: https://travis-ci.org/Julian/jsonschema +.. image:: https://img.shields.io/pypi/l/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema + ========== jsonschema ========== @@ -49,25 +56,18 @@ Release Notes ------------- -* A simple CLI was added for validation -* Validation errors now keep full absolute paths and absolute schema paths in - their ``absolute_path`` and ``absolute_schema_path`` attributes. The ``path`` - and ``schema_path`` attributes are deprecated in favor of ``relative_path`` - and ``relative_schema_path``\ . +Version 2.5.0 is mainly a performance release. The interface for `RefResolver` +was extended to add methods that improve performance on CPython. -*Note:* Support for Python 3.2 was dropped in this release, and installation -now uses setuptools. +Support for custom `RefResolver` objects with the legacy interface should *not* +be affected. If you notice something amiss please file an issue ticket. Running the Test Suite ---------------------- -``jsonschema`` uses the wonderful `Tox <http://tox.readthedocs.org>`_ for its -test suite. (It really is wonderful, if for some reason you haven't heard of -it, you really should use it for your projects). - -Assuming you have ``tox`` installed (perhaps via ``pip install tox`` or your -package manager), just run ``tox`` in the directory of your source checkout to +If you have ``tox`` installed (perhaps via ``pip install tox`` or your +package manager), running``tox`` in the directory of your source checkout will run ``jsonschema``'s test suite on all of the versions of Python ``jsonschema`` supports. Note that you'll need to have all of those versions installed in order to run the tests on each of them, otherwise ``tox`` will skip (and fail) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/README.md new/jsonschema-2.5.1/json/README.md --- old/jsonschema-2.4.0/json/README.md 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/README.md 2015-06-05 16:26:18.000000000 +0200 @@ -60,21 +60,70 @@ This suite is being used by: - * [json-schema-validator (Java)](https://github.com/fge/json-schema-validator) - * [jsonschema (python)](https://github.com/Julian/jsonschema) - * [aeson-schema (haskell)](https://github.com/timjb/aeson-schema) - * [direct-schema (javascript)](https://github.com/IreneKnapp/direct-schema) - * [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema) - * [JaySchema (javascript)](https://github.com/natesilva/jayschema) - * [z-schema (javascript)](https://github.com/zaggino/z-schema) - * [jassi (javascript)](https://github.com/iclanzan/jassi) - * [json-schema-valid (javascript)](https://github.com/ericgj/json-schema-valid) - * [jesse (Erlang)](https://github.com/klarna/jesse) - * [json-schema (PHP)](https://github.com/justinrainbow/json-schema) - * [gojsonschema (Go)](https://github.com/sigu-399/gojsonschema) - * [json_schema (Dart)](https://github.com/patefacio/json_schema) - * [tv4 (JavaScript)](https://github.com/geraintluff/tv4) - * [Jsonary (JavaScript)](https://github.com/jsonary-js/jsonary) +### Coffeescript ### + +* [jsck](https://github.com/pandastrike/jsck) + +### Dart ### + +* [json_schema](https://github.com/patefacio/json_schema) + +### Erlang ### + +* [jesse](https://github.com/klarna/jesse) + +### Go ### + +* [gojsonschema](https://github.com/sigu-399/gojsonschema) + +### Haskell ### + +* [aeson-schema](https://github.com/timjb/aeson-schema) +* [hjsonschema](https://github.com/seagreen/hjsonschema) + +### Java ### + +* [json-schema-validator](https://github.com/fge/json-schema-validator) + +### Javascript ### + +* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark) +* [direct-schema](https://github.com/IreneKnapp/direct-schema) +* [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) +* [jassi](https://github.com/iclanzan/jassi) +* [JaySchema](https://github.com/natesilva/jayschema) +* [json-schema-valid](https://github.com/ericgj/json-schema-valid) +* [Jsonary](https://github.com/jsonary-js/jsonary) +* [jsonschema](https://github.com/tdegrunt/jsonschema) +* [request-validator](https://github.com/bugventure/request-validator) +* [skeemas](https://github.com/Prestaul/skeemas) +* [tv4](https://github.com/geraintluff/tv4) +* [z-schema](https://github.com/zaggino/z-schema) +* [jsen](https://github.com/bugventure/jsen) + +### .NET ### + +* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema) + +### PHP ### + +* [json-schema](https://github.com/justinrainbow/json-schema) + +### Python ### + +* [jsonschema](https://github.com/Julian/jsonschema) + +### Ruby ### + +* [json-schema](https://github.com/hoxworth/json-schema) + +### Rust ### + +* [valico](https://github.com/rustless/valico) + +### Swift ### + +* [JSONSchema](https://github.com/kylef/JSONSchema.swift) If you use it as well, please fork and send a pull request adding yourself to the list :). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft3/additionalProperties.json new/jsonschema-2.5.1/json/tests/draft3/additionalProperties.json --- old/jsonschema-2.4.0/json/tests/draft3/additionalProperties.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft3/additionalProperties.json 2015-04-13 17:23:46.000000000 +0200 @@ -56,6 +56,25 @@ ] }, { + "description": + "additionalProperties can exist by itself", + "schema": { + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "an additional valid property is valid", + "data": {"foo" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1}, + "valid": false + } + ] + }, + { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft3/default.json new/jsonschema-2.5.1/json/tests/draft3/default.json --- old/jsonschema-2.4.0/json/tests/draft3/default.json 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/json/tests/draft3/default.json 2015-04-13 17:23:46.000000000 +0200 @@ -0,0 +1,49 @@ +[ + { + "description": "invalid type for default", + "schema": { + "properties": { + "foo": { + "type": "integer", + "default": [] + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"foo": 13}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + }, + { + "description": "invalid string value for default", + "schema": { + "properties": { + "bar": { + "type": "string", + "minLength": 4, + "default": "bad" + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"bar": "good"}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + } +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft3/optional/bignum.json new/jsonschema-2.5.1/json/tests/draft3/optional/bignum.json --- old/jsonschema-2.4.0/json/tests/draft3/optional/bignum.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft3/optional/bignum.json 2014-10-27 23:20:13.000000000 +0100 @@ -22,6 +22,28 @@ ] }, { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { "description": "string", "schema": {"type": "string"}, "tests": [ @@ -56,5 +78,30 @@ "valid": false } ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] } ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft3/pattern.json new/jsonschema-2.5.1/json/tests/draft3/pattern.json --- old/jsonschema-2.4.0/json/tests/draft3/pattern.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft3/pattern.json 2015-06-05 16:26:18.000000000 +0200 @@ -19,5 +19,16 @@ "valid": true } ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] } ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft3/ref.json new/jsonschema-2.5.1/json/tests/draft3/ref.json --- old/jsonschema-2.4.0/json/tests/draft3/ref.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft3/ref.json 2015-06-05 16:26:18.000000000 +0200 @@ -86,19 +86,34 @@ }, "tests": [ { - "description": "slash", + "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { - "description": "tilda", + "description": "tilda invalid", "data": {"tilda": "aoeu"}, "valid": false }, { - "description": "percent", + "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true } ] }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/additionalProperties.json new/jsonschema-2.5.1/json/tests/draft4/additionalProperties.json --- old/jsonschema-2.4.0/json/tests/draft4/additionalProperties.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft4/additionalProperties.json 2015-04-13 17:23:46.000000000 +0200 @@ -56,6 +56,25 @@ ] }, { + "description": + "additionalProperties can exist by itself", + "schema": { + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "an additional valid property is valid", + "data": {"foo" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1}, + "valid": false + } + ] + }, + { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/default.json new/jsonschema-2.5.1/json/tests/draft4/default.json --- old/jsonschema-2.4.0/json/tests/draft4/default.json 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/json/tests/draft4/default.json 2015-04-13 17:23:46.000000000 +0200 @@ -0,0 +1,49 @@ +[ + { + "description": "invalid type for default", + "schema": { + "properties": { + "foo": { + "type": "integer", + "default": [] + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"foo": 13}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + }, + { + "description": "invalid string value for default", + "schema": { + "properties": { + "bar": { + "type": "string", + "minLength": 4, + "default": "bad" + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"bar": "good"}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + } +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/maxLength.json new/jsonschema-2.5.1/json/tests/draft4/maxLength.json --- old/jsonschema-2.4.0/json/tests/draft4/maxLength.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft4/maxLength.json 2014-10-27 23:20:13.000000000 +0100 @@ -20,7 +20,7 @@ }, { "description": "ignores non-strings", - "data": 10, + "data": 100, "valid": true }, { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/optional/bignum.json new/jsonschema-2.5.1/json/tests/draft4/optional/bignum.json --- old/jsonschema-2.4.0/json/tests/draft4/optional/bignum.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft4/optional/bignum.json 2014-10-27 23:20:13.000000000 +0100 @@ -22,6 +22,28 @@ ] }, { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { "description": "string", "schema": {"type": "string"}, "tests": [ @@ -56,5 +78,30 @@ "valid": false } ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] } ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/pattern.json new/jsonschema-2.5.1/json/tests/draft4/pattern.json --- old/jsonschema-2.4.0/json/tests/draft4/pattern.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft4/pattern.json 2015-06-05 16:26:18.000000000 +0200 @@ -19,5 +19,16 @@ "valid": true } ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] } ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/json/tests/draft4/ref.json new/jsonschema-2.5.1/json/tests/draft4/ref.json --- old/jsonschema-2.4.0/json/tests/draft4/ref.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/json/tests/draft4/ref.json 2015-06-05 16:26:18.000000000 +0200 @@ -86,19 +86,34 @@ }, "tests": [ { - "description": "slash", + "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { - "description": "tilda", + "description": "tilda invalid", "data": {"tilda": "aoeu"}, "valid": false }, { - "description": "percent", + "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true } ] }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/__init__.py new/jsonschema-2.5.1/jsonschema/__init__.py --- old/jsonschema-2.4.0/jsonschema/__init__.py 2014-08-19 02:54:09.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/__init__.py 2015-04-13 17:23:46.000000000 +0200 @@ -19,8 +19,6 @@ Draft3Validator, Draft4Validator, RefResolver, validate ) - -__version__ = "2.4.0" - +from jsonschema._version import __version__ # flake8: noqa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/_utils.py new/jsonschema-2.5.1/jsonschema/_utils.py --- old/jsonschema-2.4.0/jsonschema/_utils.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/_utils.py 2015-04-13 17:23:46.000000000 +0200 @@ -54,7 +54,7 @@ """ - data = pkgutil.get_data(__package__, "schemas/{0}.json".format(name)) + data = pkgutil.get_data('jsonschema', "schemas/{0}.json".format(name)) return json.loads(data.decode("utf-8")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/_validators.py new/jsonschema-2.5.1/jsonschema/_validators.py --- old/jsonschema-2.4.0/jsonschema/_validators.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/_validators.py 2015-04-13 17:23:46.000000000 +0200 @@ -5,9 +5,6 @@ from jsonschema.compat import iteritems -FLOAT_TOLERANCE = 10 ** -15 - - def patternProperties(validator, patternProperties, instance, schema): if not validator.is_type(instance, "object"): return @@ -77,10 +74,10 @@ return if schema.get("exclusiveMinimum", False): - failed = float(instance) <= minimum + failed = instance <= minimum cmp = "less than or equal to" else: - failed = float(instance) < minimum + failed = instance < minimum cmp = "less than" if failed: @@ -111,8 +108,8 @@ return if isinstance(dB, float): - mod = instance % dB - failed = (mod > FLOAT_TOLERANCE) and (dB - mod) > FLOAT_TOLERANCE + quotient = instance / dB + failed = int(quotient) != quotient else: failed = instance % dB @@ -193,9 +190,20 @@ def ref(validator, ref, instance, schema): - with validator.resolver.resolving(ref) as resolved: - for error in validator.descend(instance, resolved): - yield error + resolve = getattr(validator.resolver, "resolve", None) + if resolve is None: + with validator.resolver.resolving(ref) as resolved: + for error in validator.descend(instance, resolved): + yield error + else: + scope, resolved = validator.resolver.resolve(ref) + validator.resolver.push_scope(scope) + + try: + for error in validator.descend(instance, resolved): + yield error + finally: + validator.resolver.pop_scope() def type_draft3(validator, types, instance, schema): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/_version.py new/jsonschema-2.5.1/jsonschema/_version.py --- old/jsonschema-2.4.0/jsonschema/_version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/jsonschema/_version.py 2015-06-08 21:37:21.000000000 +0200 @@ -0,0 +1,5 @@ + +# This file is automatically generated by setup.py. +__version__ = '2.5.1' +__sha__ = 'g3f459b7' +__revision__ = 'g3f459b7' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/compat.py new/jsonschema-2.5.1/jsonschema/compat.py --- old/jsonschema-2.4.0/jsonschema/compat.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/compat.py 2015-04-13 17:23:46.000000000 +0200 @@ -1,6 +1,6 @@ -from __future__ import unicode_literals -import sys import operator +import sys + try: from collections import MutableMapping, Sequence # noqa @@ -8,9 +8,11 @@ from collections.abc import MutableMapping, Sequence # noqa PY3 = sys.version_info[0] >= 3 +PY26 = sys.version_info[:2] == (2, 6) if PY3: zip = zip + from functools import lru_cache from io import StringIO from urllib.parse import ( unquote, urljoin, urlunsplit, SplitResult, urlsplit as _urlsplit @@ -31,6 +33,11 @@ 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): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/exceptions.py new/jsonschema-2.5.1/jsonschema/exceptions.py --- old/jsonschema-2.4.0/jsonschema/exceptions.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/exceptions.py 2014-10-27 23:20:13.000000000 +0100 @@ -27,6 +27,18 @@ schema_path=(), parent=None, ): + super(_Error, self).__init__( + message, + validator, + path, + cause, + context, + validator_value, + instance, + schema, + schema_path, + parent, + ) self.message = message self.path = self.relative_path = deque(path) self.schema_path = self.relative_schema_path = deque(schema_path) @@ -86,7 +98,7 @@ return self.relative_path path = deque(self.relative_path) - path.extendleft(parent.absolute_path) + path.extendleft(reversed(parent.absolute_path)) return path @property @@ -96,7 +108,7 @@ return self.relative_schema_path path = deque(self.relative_schema_path) - path.extendleft(parent.absolute_schema_path) + path.extendleft(reversed(parent.absolute_schema_path)) return path def _set(self, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/schemas/draft4.json new/jsonschema-2.5.1/jsonschema/schemas/draft4.json --- old/jsonschema-2.4.0/jsonschema/schemas/draft4.json 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/schemas/draft4.json 2014-09-12 20:06:51.000000000 +0200 @@ -123,6 +123,9 @@ "default": false, "type": "boolean" }, + "format": { + "type": "string" + }, "id": { "format": "uri", "type": "string" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/tests/test_exceptions.py new/jsonschema-2.5.1/jsonschema/tests/test_exceptions.py --- old/jsonschema-2.4.0/jsonschema/tests/test_exceptions.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/tests/test_exceptions.py 2014-10-27 23:20:13.000000000 +0100 @@ -273,7 +273,7 @@ self.assertIsInstance(tree["foo"], exceptions.ErrorTree) -class TestErrorReprStr(unittest.TestCase): +class TestErrorInitReprStr(unittest.TestCase): def make_error(self, **kwargs): defaults = dict( message=u"hello", @@ -295,6 +295,10 @@ self.assertEqual(message_line, error.message) self.assertEqual(rest, expected) + def test_it_calls_super_and_sets_args(self): + error = self.make_error() + self.assertGreater(len(error.args), 1) + def test_repr(self): self.assertEqual( repr(exceptions.ValidationError(message="Hello!")), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/tests/test_validators.py new/jsonschema-2.5.1/jsonschema/tests/test_validators.py --- old/jsonschema-2.4.0/jsonschema/tests/test_validators.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/tests/test_validators.py 2015-04-13 17:23:46.000000000 +0200 @@ -425,6 +425,106 @@ self.assertEqual(e5.validator, "minItems") self.assertEqual(e6.validator, "enum") + def test_recursive(self): + schema = { + "definitions": { + "node": { + "anyOf": [{ + "type": "object", + "required": ["name", "children"], + "properties": { + "name": { + "type": "string", + }, + "children": { + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/definitions/node", + }, + }, + }, + }, + }], + }, + }, + "type": "object", + "required": ["root"], + "properties": { + "root": {"$ref": "#/definitions/node"}, + } + } + + instance = { + "root": { + "name": "root", + "children": { + "a": { + "name": "a", + "children": { + "ab": { + "name": "ab", + # missing "children" + } + } + }, + }, + }, + } + validator = Draft4Validator(schema) + + e, = validator.iter_errors(instance) + self.assertEqual(e.absolute_path, deque(["root"])) + self.assertEqual( + e.absolute_schema_path, deque(["properties", "root", "anyOf"]), + ) + + e1, = e.context + self.assertEqual(e1.absolute_path, deque(["root", "children", "a"])) + self.assertEqual( + e1.absolute_schema_path, deque( + [ + "properties", + "root", + "anyOf", + 0, + "properties", + "children", + "patternProperties", + "^.*$", + "anyOf", + ], + ), + ) + + e2, = e1.context + self.assertEqual( + e2.absolute_path, deque( + ["root", "children", "a", "children", "ab"], + ), + ) + self.assertEqual( + e2.absolute_schema_path, deque( + [ + "properties", + "root", + "anyOf", + 0, + "properties", + "children", + "patternProperties", + "^.*$", + "anyOf", + 0, + "properties", + "children", + "patternProperties", + "^.*$", + "anyOf" + ], + ), + ) + def test_additionalProperties(self): instance = {"bar": "bar", "foo": 2} schema = { @@ -533,17 +633,32 @@ resolver = RefResolver("", {}) schema = {"$ref" : mock.Mock()} - @contextmanager - def resolving(): - yield {"type": "integer"} - - with mock.patch.object(resolver, "resolving") as resolve: - resolve.return_value = resolving() + with mock.patch.object(resolver, "resolve") as resolve: + resolve.return_value = "url", {"type": "integer"} with self.assertRaises(ValidationError): self.validator_class(schema, resolver=resolver).validate(None) resolve.assert_called_once_with(schema["$ref"]) + def test_it_delegates_to_a_legacy_ref_resolver(self): + """ + Legacy RefResolvers support only the context manager form of + resolution. + + """ + + class LegacyRefResolver(object): + @contextmanager + def resolving(this, ref): + self.assertEqual(ref, "the ref") + yield {"type" : "integer"} + + resolver = LegacyRefResolver() + schema = {"$ref" : "the ref"} + + with self.assertRaises(ValidationError): + self.validator_class(schema, resolver=resolver).validate(None) + def test_is_type_is_true_for_valid_type(self): self.assertTrue(self.validator.is_type("foo", "string")) @@ -675,11 +790,11 @@ self.assertEqual(resolved, self.referrer["properties"]["foo"]) def test_it_resolves_local_refs_with_id(self): - schema = {"id": "foo://bar/schema#", "a": {"foo": "bar"}} + schema = {"id": "http://bar/schema#", "a": {"foo": "bar"}} resolver = RefResolver.from_schema(schema) with resolver.resolving("#/a") as resolved: self.assertEqual(resolved, schema["a"]) - with resolver.resolving("foo://bar/schema#/a") as resolved: + with resolver.resolving("http://bar/schema#/a") as resolved: self.assertEqual(resolved, schema["a"]) def test_it_retrieves_stored_refs(self): @@ -716,6 +831,7 @@ schema = {"id" : "foo"} resolver = RefResolver.from_schema(schema) self.assertEqual(resolver.base_uri, "foo") + self.assertEqual(resolver.resolution_scope, "foo") with resolver.resolving("") as resolved: self.assertEqual(resolved, schema) with resolver.resolving("#") as resolved: @@ -729,6 +845,7 @@ schema = {} resolver = RefResolver.from_schema(schema) self.assertEqual(resolver.base_uri, "") + self.assertEqual(resolver.resolution_scope, "") with resolver.resolving("") as resolved: self.assertEqual(resolved, schema) with resolver.resolving("#") as resolved: @@ -763,9 +880,7 @@ ) with resolver.resolving(ref): pass - with resolver.resolving(ref): - pass - self.assertEqual(foo_handler.call_count, 2) + self.assertEqual(foo_handler.call_count, 1) def test_if_you_give_it_junk_you_get_a_resolution_error(self): ref = "foo://bar" @@ -776,6 +891,13 @@ pass self.assertEqual(str(err.exception), "Oh no! What's this?") + def test_helpful_error_message_on_failed_pop_scope(self): + resolver = RefResolver("", {}) + resolver.pop_scope() + with self.assertRaises(RefResolutionError) as exc: + resolver.pop_scope() + self.assertIn("Failed to pop the scope", str(exc.exception)) + def sorted_errors(errors): def key(error): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema/validators.py new/jsonschema-2.5.1/jsonschema/validators.py --- old/jsonschema-2.4.0/jsonschema/validators.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema/validators.py 2015-04-13 17:23:46.000000000 +0200 @@ -12,7 +12,7 @@ from jsonschema import _utils, _validators from jsonschema.compat import ( Sequence, urljoin, urlsplit, urldefrag, unquote, urlopen, - str_types, int_types, iteritems, + str_types, int_types, iteritems, lru_cache, ) from jsonschema.exceptions import ErrorTree # Backwards compatibility # noqa from jsonschema.exceptions import RefResolutionError, SchemaError, UnknownType @@ -79,7 +79,10 @@ if _schema is None: _schema = self.schema - with self.resolver.in_scope(_schema.get(u"id", u"")): + scope = _schema.get(u"id") + if scope: + self.resolver.push_scope(scope) + try: ref = _schema.get(u"$ref") if ref is not None: validators = [(u"$ref", ref)] @@ -103,6 +106,9 @@ if k != u"$ref": error.schema_path.appendleft(k) yield error + finally: + if scope: + self.resolver.pop_scope() def descend(self, instance, schema, path=None, schema_path=None): for error in self.iter_errors(instance, schema): @@ -227,19 +233,33 @@ first resolution :argument dict handlers: a mapping from URI schemes to functions that should be used to retrieve them + :arguments functools.lru_cache urljoin_cache: a cache that will be used for + caching the results of joining the resolution scope to subscopes. + :arguments functools.lru_cache remote_cache: a cache that will be used for + caching the results of resolved remote URLs. """ def __init__( - self, base_uri, referrer, store=(), cache_remote=True, handlers=(), + self, + base_uri, + referrer, + store=(), + cache_remote=True, + handlers=(), + urljoin_cache=None, + remote_cache=None, ): - self.base_uri = base_uri - self.resolution_scope = base_uri - # This attribute is not used, it is for backwards compatibility + if urljoin_cache is None: + urljoin_cache = lru_cache(1024)(urljoin) + if remote_cache is None: + remote_cache = lru_cache(1024)(self.resolve_from_url) + self.referrer = referrer self.cache_remote = cache_remote self.handlers = dict(handlers) + self._scopes_stack = [base_uri] self.store = _utils.URIDict( (id, validator.META_SCHEMA) for id, validator in iteritems(meta_schemas) @@ -247,26 +267,52 @@ self.store.update(store) self.store[base_uri] = referrer + self._urljoin_cache = urljoin_cache + self._remote_cache = remote_cache + @classmethod def from_schema(cls, schema, *args, **kwargs): """ Construct a resolver from a JSON schema object. - :argument schema schema: the referring schema + :argument schema: the referring schema :rtype: :class:`RefResolver` """ return cls(schema.get(u"id", u""), schema, *args, **kwargs) + def push_scope(self, scope): + self._scopes_stack.append( + self._urljoin_cache(self.resolution_scope, scope), + ) + + def pop_scope(self): + try: + self._scopes_stack.pop() + except IndexError: + raise RefResolutionError( + "Failed to pop the scope from an empty stack. " + "`pop_scope()` should only be called once for every " + "`push_scope()`", + ) + + @property + def resolution_scope(self): + return self._scopes_stack[-1] + + @property + def base_uri(self): + uri, _ = urldefrag(self.resolution_scope) + return uri + @contextlib.contextmanager def in_scope(self, scope): - old_scope = self.resolution_scope - self.resolution_scope = urljoin(old_scope, scope) + self.push_scope(scope) try: yield finally: - self.resolution_scope = old_scope + self.pop_scope() @contextlib.contextmanager def resolving(self, ref): @@ -278,25 +324,28 @@ """ - full_uri = urljoin(self.resolution_scope, ref) - uri, fragment = urldefrag(full_uri) - if not uri: - uri = self.base_uri - - if uri in self.store: - document = self.store[uri] - else: + url, resolved = self.resolve(ref) + self.push_scope(url) + try: + yield resolved + finally: + self.pop_scope() + + def resolve(self, ref): + url = self._urljoin_cache(self.resolution_scope, ref) + return url, self._remote_cache(url) + + def resolve_from_url(self, url): + url, fragment = urldefrag(url) + try: + document = self.store[url] + except KeyError: try: - document = self.resolve_remote(uri) + document = self.resolve_remote(url) except Exception as exc: raise RefResolutionError(exc) - old_base_uri, self.base_uri = self.base_uri, uri - try: - with self.in_scope(uri): - yield self.resolve_fragment(document, fragment) - finally: - self.base_uri = old_base_uri + return self.resolve_fragment(document, fragment) def resolve_fragment(self, document, fragment): """ @@ -332,8 +381,9 @@ """ Resolve a remote ``uri``. - Does not check the store first, but stores the retrieved document in - the store if :attr:`RefResolver.cache_remote` is True. + If called directly, does not check the store first, but after + retrieving the document at the specified URI it will be saved in + the store if :attr:`cache_remote` is True. .. note:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema.egg-info/PKG-INFO new/jsonschema-2.5.1/jsonschema.egg-info/PKG-INFO --- old/jsonschema-2.4.0/jsonschema.egg-info/PKG-INFO 2014-08-19 02:55:46.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema.egg-info/PKG-INFO 2015-06-08 21:37:21.000000000 +0200 @@ -1,12 +1,19 @@ Metadata-Version: 1.1 Name: jsonschema -Version: 2.4.0 +Version: 2.5.1 Summary: An implementation of JSON Schema validation for Python Home-page: http://github.com/Julian/jsonschema Author: Julian Berman Author-email: Julian@GrayVines.com License: MIT -Description: ========== +Description: .. image:: https://img.shields.io/pypi/v/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema + .. image:: https://travis-ci.org/Julian/jsonschema.svg?branch=master + :target: https://travis-ci.org/Julian/jsonschema + .. image:: https://img.shields.io/pypi/l/jsonschema.svg + :target: https://pypi.python.org/pypi/jsonschema + + ========== jsonschema ========== @@ -57,25 +64,18 @@ Release Notes ------------- - * A simple CLI was added for validation - * Validation errors now keep full absolute paths and absolute schema paths in - their ``absolute_path`` and ``absolute_schema_path`` attributes. The ``path`` - and ``schema_path`` attributes are deprecated in favor of ``relative_path`` - and ``relative_schema_path``\ . + Version 2.5.0 is mainly a performance release. The interface for `RefResolver` + was extended to add methods that improve performance on CPython. - *Note:* Support for Python 3.2 was dropped in this release, and installation - now uses setuptools. + Support for custom `RefResolver` objects with the legacy interface should *not* + be affected. If you notice something amiss please file an issue ticket. Running the Test Suite ---------------------- - ``jsonschema`` uses the wonderful `Tox <http://tox.readthedocs.org>`_ for its - test suite. (It really is wonderful, if for some reason you haven't heard of - it, you really should use it for your projects). - - Assuming you have ``tox`` installed (perhaps via ``pip install tox`` or your - package manager), just run ``tox`` in the directory of your source checkout to + If you have ``tox`` installed (perhaps via ``pip install tox`` or your + package manager), running``tox`` in the directory of your source checkout will run ``jsonschema``'s test suite on all of the versions of Python ``jsonschema`` supports. Note that you'll need to have all of those versions installed in order to run the tests on each of them, otherwise ``tox`` will skip (and fail) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema.egg-info/SOURCES.txt new/jsonschema-2.5.1/jsonschema.egg-info/SOURCES.txt --- old/jsonschema-2.4.0/jsonschema.egg-info/SOURCES.txt 2014-08-19 02:55:47.000000000 +0200 +++ new/jsonschema-2.5.1/jsonschema.egg-info/SOURCES.txt 2015-06-08 21:37:24.000000000 +0200 @@ -5,6 +5,7 @@ setup.cfg setup.py tox.ini +version.txt json/.gitignore json/.travis.yml json/LICENSE @@ -15,6 +16,7 @@ json/remotes/folder/folderInteger.json json/tests/draft3/additionalItems.json json/tests/draft3/additionalProperties.json +json/tests/draft3/default.json json/tests/draft3/dependencies.json json/tests/draft3/disallow.json json/tests/draft3/divisibleBy.json @@ -43,6 +45,7 @@ json/tests/draft4/additionalProperties.json json/tests/draft4/allOf.json json/tests/draft4/anyOf.json +json/tests/draft4/default.json json/tests/draft4/definitions.json json/tests/draft4/dependencies.json json/tests/draft4/enum.json @@ -75,6 +78,7 @@ jsonschema/_reflect.py jsonschema/_utils.py jsonschema/_validators.py +jsonschema/_version.py jsonschema/cli.py jsonschema/compat.py jsonschema/exceptions.py @@ -83,6 +87,8 @@ jsonschema.egg-info/SOURCES.txt jsonschema.egg-info/dependency_links.txt jsonschema.egg-info/entry_points.txt +jsonschema.egg-info/pbr.json +jsonschema.egg-info/requires.txt jsonschema.egg-info/top_level.txt jsonschema/schemas/draft3.json jsonschema/schemas/draft4.json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema.egg-info/pbr.json new/jsonschema-2.5.1/jsonschema.egg-info/pbr.json --- old/jsonschema-2.4.0/jsonschema.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/jsonschema.egg-info/pbr.json 2015-06-08 21:37:21.000000000 +0200 @@ -0,0 +1 @@ +{"is_release": true, "git_version": "3f459b7"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/jsonschema.egg-info/requires.txt new/jsonschema-2.5.1/jsonschema.egg-info/requires.txt --- old/jsonschema-2.4.0/jsonschema.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/jsonschema.egg-info/requires.txt 2015-06-08 21:37:21.000000000 +0200 @@ -0,0 +1,12 @@ + +[:python_version=='2.6'] +argparse +repoze.lru + +[:python_version=='2.7'] +functools32 + +[format] +rfc3987 +strict-rfc3339 +webcolors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/setup.py new/jsonschema-2.5.1/setup.py --- old/jsonschema-2.4.0/setup.py 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/setup.py 2015-06-08 18:04:36.000000000 +0200 @@ -1,9 +1,9 @@ -from setuptools import setup +import os -from jsonschema import __version__ +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 = [ @@ -21,11 +21,18 @@ "Programming Language :: Python :: Implementation :: PyPy", ] +extras_require = { + "format" : ["rfc3987", "strict-rfc3339", "webcolors"], + ":python_version=='2.6'": ["argparse", "repoze.lru"], + ":python_version=='2.7'": ["functools32"], +} + setup( name="jsonschema", - version=__version__, packages=["jsonschema", "jsonschema.tests"], package_data={"jsonschema": ["schemas/*.json"]}, + setup_requires=["vcversioner"], + extras_require=extras_require, author="Julian Berman", author_email="Julian@GrayVines.com", classifiers=classifiers, @@ -34,4 +41,5 @@ long_description=long_description, url="http://github.com/Julian/jsonschema", entry_points={"console_scripts": ["jsonschema = jsonschema.cli:main"]}, + vcversioner={"version_module_paths" : ["jsonschema/_version.py"]}, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/tox.ini new/jsonschema-2.5.1/tox.ini --- old/jsonschema-2.4.0/tox.ini 2014-07-06 04:55:07.000000000 +0200 +++ new/jsonschema-2.5.1/tox.ini 2015-04-13 17:23:46.000000000 +0200 @@ -1,56 +1,39 @@ [tox] -envlist = py26, py27, pypy, py34, docs, style +envlist = py{26,27,34,py,py3}, docs, style + [testenv] +changedir = {envtmpdir} +setenv = + JSON_SCHEMA_TEST_SUITE = {toxinidir}/json commands = - py.test [] jsonschema - {envpython} -m doctest README.rst -deps = - {[testenv:notpy34]deps} - {[testenv:py34]deps} + py26: trial [] jsonschema + py{27,34,py,py3}: green [] jsonschema -[testenv:py26] + {envpython} -m doctest {toxinidir}/README.rst + py{26,27,34}: sphinx-build -b doctest {toxinidir}/docs {envtmpdir}/html deps = - {[testenv:notpy34]deps} - {[testenv:all]deps} - argparse - unittest2 + -e{toxinidir}[format] -[testenv:py34] -commands = - py.test [] jsonschema - {envpython} -m doctest README.rst - sphinx-build -b doctest docs {envtmpdir}/html -deps = - {[testenv:all]deps} - {[testenv:notpy26]deps} + py26: twisted + py{27,34,py,py3}: green -[testenv:notpy34] -deps = - mock + py26: unittest2 + py{26,27,py,py3}: mock -[testenv:notpy26] -deps = - rfc3987 + py{26,27,34}: lxml + py{26,27,34,py}: sphinx -[testenv:all] -deps = - lxml - pytest - sphinx - strict-rfc3339 - webcolors [testenv:coverage] commands = - coverage run --branch --source jsonschema [] {envbindir}/py.test jsonschema + coverage run --branch --source {toxinidir}/jsonschema [] {envbindir}/green jsonschema coverage report --show-missing coverage html deps = - {[testenv:notpy34]deps} - {[testenv:py34]deps} coverage + [testenv:docs] basepython = python changedir = docs @@ -59,13 +42,12 @@ commands = sphinx-build [] -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html + [testenv:style] deps = flake8 commands = - flake8 [] --max-complexity 10 jsonschema + flake8 [] --max-complexity 10 {toxinidir}/jsonschema + [flake8] ignore = E203,E302,E303,E701,F811 - -[pytest] -addopts = -r s -s diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jsonschema-2.4.0/version.txt new/jsonschema-2.5.1/version.txt --- old/jsonschema-2.4.0/version.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jsonschema-2.5.1/version.txt 2015-06-08 21:37:21.000000000 +0200 @@ -0,0 +1 @@ +v2.5.1-0-g3f459b7 \ No newline at end of file
participants (1)
-
root@hilbert.suse.de