From 219ac6d154891900fc1444c3677c0b4b41215807 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 15 Sep 2019 08:03:12 +0200 Subject: [PATCH] Include plugins setup.py in installed files / release tarballs. --- setup.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0edaea737..02e9064e2 100644 --- a/setup.py +++ b/setup.py @@ -159,11 +159,21 @@ package_dir = {'supybot': 'src', package_data = {'supybot.locales': [s for s in os.listdir('locales/')]} for plugin in plugins: - package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin + plugin_name = 'supybot.plugins.' + plugin + package_dir[plugin_name] = 'plugins/' + plugin + pot_path = 'plugins/' + plugin + 'messages.pot' locales_path = 'plugins/' + plugin + '/locales/' - locales_name = 'supybot.plugins.'+plugin + + files = [] + + if os.path.exists(pot_path): + files.append('messages.pot') + if os.path.exists(locales_path): - package_data.update({locales_name: ['locales/'+s for s in os.listdir(locales_path)]}) + files.extend(['locales/'+s for s in os.listdir(locales_path)]) + + if files: + package_data.update({plugin_name: files}) setup( # Metadata