From 65667c6a610d17b1e0c02ab2cbc1f0e50dee8014 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 21 May 2020 11:27:52 +1200 Subject: [PATCH] make a separate build_i18n command again otherwise you might get the one from distutils-extra which does not do the right thing any more --- setup.cfg | 2 -- setup.py | 23 +++++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) delete mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 03d88005..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[build_i18n] -domain=subiquity diff --git a/setup.py b/setup.py index e678ee4d..00b4045f 100644 --- a/setup.py +++ b/setup.py @@ -27,16 +27,22 @@ import distutils.command.build import distutils.spawn import glob import os -import subprocess import sys from setuptools import setup, find_packages -class build(distutils.command.build.build): +class build_i18n(distutils.cmd.Command): + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass def run(self): - super().run() data_files = self.distribution.data_files with open('po/POTFILES.in') as in_fp: @@ -70,6 +76,12 @@ class build(distutils.command.build.build): data_files.append((targetpath, (mo_file,))) +class build(distutils.command.build.build): + + sub_commands = distutils.command.build.build.sub_commands + [ + ("build_i18n", None)] + + with open(os.path.join(os.path.dirname(__file__), 'subiquitycore', '__init__.py')) as init: lines = [line for line in init if 'i18n' not in line] @@ -110,5 +122,8 @@ setup(name='subiquity', ], }, data_files=[], - cmdclass={'build': build}, + cmdclass={ + 'build': build, + 'build_i18n': build_i18n, + }, )