diff --git a/setup.py b/setup.py index e3281ae..0f3f3a0 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ config.read('settings.ini', encoding='utf-8') cfg = config['DEFAULT'] +# NOTE: package_data is missing from here cfg_keys = 'version description keywords author author_email'.split() expected = cfg_keys + "lib_name user branch license status min_python audience language".split() for o in expected: assert o in cfg, "missing expected setting: {}".format(o) @@ -30,6 +31,14 @@ lic = licenses.get(cfg['license'].lower(), (cfg['license'], None)) dev_requirements = (cfg.get('dev_requirements') or '').split() +# NOTE: handle package_data here e.g. in settings.ini `package_data = ../data/defaults.yml` +package_data = dict() +pkg_data = cfg.get('package_data', None) +if pkg_data: + package_data[cfg['lib_name']] = pkg_data.split() # split as multiple files might be listed +# Add package data to setup_cfg for setuptools.setup(..., **setup_cfg) +setup_cfg['package_data'] = package_data + setuptools.setup( name = cfg['lib_name'], license = lic[0], @@ -40,7 +49,7 @@ ] + ['Programming Language :: Python :: '+o for o in py_versions[py_versions.index(min_python):]] + (['License :: ' + lic[1] ] if lic[1] else []), url = cfg['git_url'], packages = setuptools.find_packages(), - include_package_data = True, + include_package_data = True, # NOTE: unclear if this automatically determines package data and if so how install_requires = requirements, extras_require={ 'dev': dev_requirements }, dependency_links = cfg.get('dep_links','').split(),