From de9d6993b2e506dac3c40e7f4f3ea4ceb5cddfd6 Mon Sep 17 00:00:00 2001 From: Colin Dunklau Date: Sun, 12 May 2013 21:44:04 -0500 Subject: Fixed loading problem for schema json --- jsonschema/_utils.py | 5 ++++- setup.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py index 7e748cb..10e7bf8 100644 --- a/jsonschema/_utils.py +++ b/jsonschema/_utils.py @@ -43,7 +43,10 @@ def load_schema(name): Load a schema from ./schemas/``name``.json and return it. """ - schemadir = os.path.join(os.path.dirname(__file__), 'schemas') + schemadir = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + 'schemas' + ) schemapath = os.path.join(schemadir, '%s.json' % (name,)) with open(schemapath) as f: return json.load(f) diff --git a/setup.py b/setup.py index e1fcf02..e649fb6 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +import os +import glob from distutils.core import setup from jsonschema import __version__ @@ -29,6 +31,7 @@ setup( name="jsonschema", version=__version__, packages=["jsonschema"], + package_data={'jsonschema': ['schemas/*.json']}, author="Julian Berman", author_email="Julian@GrayVines.com", classifiers=classifiers, -- cgit v1.2.1