From 71dbd39dd7158534089df265dfa5158dff99c5c0 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 23 Feb 2019 00:10:10 +0100 Subject: [PATCH] Revert changes to the structure of sdist packages. c87aacb690c9b9b24487c64e28a1cfa51605b572 b882d1cc00924e2cd7b9cb6769e7c637a7fdd1f2 b1db15c0562ff9f719570842358b7e6d2605a209 --- .gitignore | 1 + {src/locales => locales}/__init__.py | 0 {src/locales => locales}/de.po | 0 {src/locales => locales}/fi.po | 0 {src/locales => locales}/fr.po | 0 {src/locales => locales}/fr.py | 0 {src/locales => locales}/it.po | 0 {src/locales => locales}/messages.pot | 0 setup.py | 25 +++++++++++++++++-------- 9 files changed, 18 insertions(+), 8 deletions(-) rename {src/locales => locales}/__init__.py (100%) rename {src/locales => locales}/de.po (100%) rename {src/locales => locales}/fi.po (100%) rename {src/locales => locales}/fr.po (100%) rename {src/locales => locales}/fr.py (100%) rename {src/locales => locales}/it.po (100%) rename {src/locales => locales}/messages.pot (100%) diff --git a/.gitignore b/.gitignore index e46140096..ae0ab4221 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ supybot.egg-info/ test-conf/ test-data/ test-logs/ +src/version.py INSTALL README.txt conf/ diff --git a/src/locales/__init__.py b/locales/__init__.py similarity index 100% rename from src/locales/__init__.py rename to locales/__init__.py diff --git a/src/locales/de.po b/locales/de.po similarity index 100% rename from src/locales/de.po rename to locales/de.po diff --git a/src/locales/fi.po b/locales/fi.po similarity index 100% rename from src/locales/fi.po rename to locales/fi.po diff --git a/src/locales/fr.po b/locales/fr.po similarity index 100% rename from src/locales/fr.po rename to locales/fr.po diff --git a/src/locales/fr.py b/locales/fr.py similarity index 100% rename from src/locales/fr.py rename to locales/fr.py diff --git a/src/locales/it.po b/locales/it.po similarity index 100% rename from src/locales/it.po rename to locales/it.po diff --git a/src/locales/messages.pot b/locales/messages.pot similarity index 100% rename from src/locales/messages.pot rename to locales/messages.pot diff --git a/setup.py b/setup.py index cb1366b1e..0edaea737 100644 --- a/setup.py +++ b/setup.py @@ -48,10 +48,7 @@ if debug: if path: os.chdir(path) -if os.path.isdir('src'): - VERSION_FILE = os.path.join('src', 'version.py') -else: - VERSION_FILE = os.path.join('supybot', 'version.py') +VERSION_FILE = os.path.join('src', 'version.py') version = None try: if 'SOURCE_DATE_EPOCH' in os.environ: @@ -67,7 +64,7 @@ try: time.strptime(time.asctime(time.gmtime(date)))[:3]) except: if os.path.isfile(VERSION_FILE): - from supybot.version import version + from src.version import version else: version = 'installed on ' + time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime()) try: @@ -75,7 +72,7 @@ try: except OSError: # Does not exist pass if version: - fd = open(VERSION_FILE, 'a') + fd = open(os.path.join('src', 'version.py'), 'a') fd.write("version = '%s'\n" % version) fd.write('try: # For import from setup.py\n') fd.write(' import supybot.utils.python\n') @@ -102,7 +99,7 @@ import shutil import os -plugins = [s for s in os.listdir(os.path.join('supybot', 'plugins')) if +plugins = [s for s in os.listdir('plugins') if os.path.exists(os.path.join('plugins', s, 'plugin.py'))] def normalizeWhitespace(s): @@ -150,9 +147,19 @@ packages = ['supybot', 'supybot.plugins.Math.local', ] -package_data = {'supybot.locales': [s for s in os.listdir('supybot/locales/')]} +package_dir = {'supybot': 'src', + 'supybot.utils': 'src/utils', + 'supybot.locales': 'locales', + 'supybot.plugins': 'plugins', + 'supybot.drivers': 'src/drivers', + 'supybot.plugins.Dict.local': 'plugins/Dict/local', + 'supybot.plugins.Math.local': 'plugins/Math/local', + } + +package_data = {'supybot.locales': [s for s in os.listdir('locales/')]} for plugin in plugins: + package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin locales_path = 'plugins/' + plugin + '/locales/' locales_name = 'supybot.plugins.'+plugin if os.path.exists(locales_path): @@ -203,6 +210,8 @@ setup( # Installation data packages=packages, + package_dir=package_dir, + package_data=package_data, scripts=['scripts/supybot',