X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=music_sampler.spec;h=5a814643c600569179b24cf6be5e52904c04ce49;hb=7df12958bed6544b36bc946cdbb185ff2011733c;hp=791cd686ec7d02798c4dabe25d5c5c3b3f0d24d0;hpb=6ebe62478a49df22c55ef6a2b1200473500a7f80;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/music_sampler.spec b/music_sampler.spec index 791cd68..5a81464 100644 --- a/music_sampler.spec +++ b/music_sampler.spec @@ -1,11 +1,12 @@ # -*- mode: python -*- import os +import setuptools_scm from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\ hookspath, runtime_hooks import importlib.machinery sysfont = importlib.machinery\ - .SourceFileLoader('sysfont', os.getcwd() + '/music_sampler/sysfont.py') \ + .SourceFileLoader('sysfont', os.getcwd()+'/music_sampler/sysfont.py') \ .load_module() excluded_and_hidden_modules = get_deps_minimal( @@ -22,14 +23,15 @@ excluded_and_hidden_modules['hiddenimports'] += [ 'packaging.specifiers', 'packaging.requirements' ] -commit_message = os.popen('git log -1 --format="%h %ci"').read() +commit_message = setuptools_scm.get_version() pyinstaller_file = open(".pyinstaller_commit", "w") pyinstaller_file.write(commit_message) pyinstaller_file.close() data = [ ('music_sampler/music_sampler.kv', '.'), - ('.pyinstaller_commit', '.') + ('.pyinstaller_commit', '.'), + ('music_sampler/locales', 'locales') ] a = Analysis(['run.py'], @@ -39,7 +41,13 @@ a = Analysis(['run.py'], runtime_hooks=runtime_hooks(), **excluded_and_hidden_modules) -for fontname, style in [("Ubuntu", sysfont.STYLE_NORMAL), ("Ubuntu", sysfont.STYLE_BOLD), ("Symbola", sysfont.STYLE_NONE)]: +fonts = [ + ("Ubuntu", sysfont.STYLE_NORMAL), + ("Ubuntu", sysfont.STYLE_BOLD), + ("Symbola", sysfont.STYLE_NONE) +] + +for fontname, style in fonts: font = sysfont.get_font(fontname, style=style) a.datas.append(( 'fonts/{}_{}.ttf'.format(fontname, style),