diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index fb9b8d7..f9eb6a1 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -26,6 +26,7 @@ jobs: python -m pip install --upgrade pip pip install pytest flake8 pip install . + python compile_locales.py - name: Check code style with flake8 (lint) run: | @@ -60,5 +61,6 @@ jobs: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | + python compile_locales.py python setup.py sdist bdist_wheel twine upload dist/* diff --git a/Dockerfile b/Dockerfile index 0c8034b..e278593 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,10 @@ RUN python -mvenv venv && ./venv/bin/pip install --upgrade pip COPY . . -# Install package from source code +# Install package from source code, compile translations RUN ./venv/bin/pip install . \ - && ./venv/bin/pip cache purge + && ./venv/bin/pip cache purge \ + && ./venv/bin/python compile_locales.py FROM python:3.8.14-slim-bullseye diff --git a/docker/Dockerfile.cuda b/docker/Dockerfile.cuda index 61f7f0f..dd0cb9a 100644 --- a/docker/Dockerfile.cuda +++ b/docker/Dockerfile.cuda @@ -35,7 +35,8 @@ RUN if [ "$with_models" = "true" ]; then \ # Install package from source code RUN pip3 install . \ - && pip3 cache purge + && pip3 cache purge \ + && python3 compile_locales.py # Depending on your cuda install you may need to uncomment this line to allow the container to access the cuda libraries # See: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions diff --git a/setup.py b/setup.py index 94527ca..873e60d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( packages=find_packages(), # packages=find_packages(include=['openpredict']), # package_dir={'openpredict': 'openpredict'}, - package_data={'': ['static/*', 'static/**/*', 'templates/*']}, + package_data={'': ['static/*', 'static/**/*', 'templates/*', 'locales/**/meta.json', 'locales/**/.mo']}, include_package_data=True, entry_points={ 'console_scripts': [