From 49353fce4f3213519b0560ba095d341fabe0feea Mon Sep 17 00:00:00 2001 From: Charlotte Curtis Date: Tue, 18 Jun 2024 11:03:16 -0600 Subject: [PATCH] Fixing order of build --- .github/workflows/create_release.yml | 5 +---- setup.py | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 66fc723..8eccbde 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -60,14 +60,11 @@ jobs: libtiff-dev \ libwebkit2gtk-4.0-dev \ libxtst-dev - - - name: Copy resources directory - # PyPi needs to have resources in the same directory as the package - run: cp -r resources pdfstitcher/resources - name: Compile translation files and build distribution run: | python3 build/update_loc.py --compile + cp -r resources pdfstitcher/resources pip3 install build python3 -m build diff --git a/setup.py b/setup.py index 17d868d..10af077 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from pathlib import Path from setuptools import setup from setuptools.command.install import install from setuptools.command.develop import develop @@ -9,6 +10,10 @@ def run_compile(cmdclass): # Shamelessly copied from https://stackoverflow.com/a/41120180 compiler = compile_catalog(cmdclass.distribution) compiler.directory = "resources/locale" + compiler.directory = "pdfstitcher/resources/locale" + if not Path(compiler.directory).exists(): + print("warning: no locale directory found, only English will be available.") + return compiler.domain = ["pdfstitcher"] compiler.run()