From 4e7816c4ec41cd3032b6b9faa44addedf3071b30 Mon Sep 17 00:00:00 2001 From: Ricky Laney Date: Mon, 21 Mar 2022 14:27:13 -0400 Subject: [PATCH] Fixed path and added data file to package_data --- grapheme/grapheme_property_group.py | 2 +- setup.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/grapheme/grapheme_property_group.py b/grapheme/grapheme_property_group.py index 7f0560b..eed6a1a 100644 --- a/grapheme/grapheme_property_group.py +++ b/grapheme/grapheme_property_group.py @@ -94,7 +94,7 @@ def __init__(self, range_min, range_max, group): def get_value(self, _key): return self.group -with open(os.path.join(os.path.dirname(__file__), "data/grapheme_break_property.json"), 'r') as f: +with open(os.path.join(os.path.dirname(__file__), "data", "grapheme_break_property.json"), 'r') as f: data = json.load(f) assert len(data) == len(GraphemePropertyGroup) - 1 diff --git a/setup.py b/setup.py index 508fddd..f5fbb93 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import os from codecs import open as codecs_open from setuptools import setup, find_packages @@ -6,6 +7,10 @@ with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() +extra_files = [] +data_file = os.path.join('data', 'grapheme_break_property.json') +extra_files.append(data_file) + setup(name='grapheme', version='0.6.0', @@ -18,6 +23,7 @@ license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, + package_data={'': extra_files}, zip_safe=False, install_requires=[], extras_require={