aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-06-15 17:33:07 +0200
committerWojtek Kosior <koszko@koszko.org>2022-06-15 17:33:07 +0200
commit3b50a93151ae4b197b44578b6e0eb3552b1895c6 (patch)
treea8d7be6773f810d1ffc971ed5ad84f3c895135e9 /setup.py
parentc50d1505d307bf6711d12001d173ae14d91548ab (diff)
parentff759b50e5aadc3c973724021ec9fca3759f9639 (diff)
downloadhaketilo-hydrilla-3b50a93151ae4b197b44578b6e0eb3552b1895c6.tar.gz
haketilo-hydrilla-3b50a93151ae4b197b44578b6e0eb3552b1895c6.zip
Update upstream source from tag 'upstream/1.1_beta1'
Update to upstream version '1.1~beta1' with Debian dir f4a8cf6c148c483e4efd4e885ebc690eea98b8c1
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py37
1 files changed, 33 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 345febc..3aa9f74 100755
--- a/setup.py
+++ b/setup.py
@@ -8,13 +8,42 @@
import setuptools
from setuptools.command.build_py import build_py
+from setuptools.command.sdist import sdist
+
+from pathlib import Path
+
+here = Path(__file__).resolve().parent
class CustomBuildCommand(build_py):
- '''
- The build command but runs babel before build.
- '''
+ """The build command but runs babel before build."""
def run(self, *args, **kwargs):
+ """Wrapper around build_py's original run() method."""
self.run_command('compile_catalog')
+
+ super().run(*args, **kwargs)
+
+class CustomSdistCommand(sdist):
+ """
+ The sdist command but prevents compiled message catalogs from being included
+ in the archive.
+ """
+ def run(self, *args, **kwargs):
+ """Wrapper around sdist's original run() method."""
+ locales_dir = here / 'src/hydrilla/server/locales'
+ locale_files = {}
+
+ for path in locales_dir.rglob('*.mo'):
+ locale_files[path] = path.read_bytes()
+
+ for path in locale_files:
+ path.unlink()
+
super().run(*args, **kwargs)
-setuptools.setup(cmdclass={'build_py': CustomBuildCommand})
+ for path, contents in locale_files.items():
+ path.write_bytes(contents)
+
+setuptools.setup(cmdclass = {
+ 'build_py': CustomBuildCommand,
+ 'sdist': CustomSdistCommand
+})