From bce186c417bf4bb597f8db628ea8e536c12fe1e9 Mon Sep 17 00:00:00 2001 From: Shadi Naif Date: Sun, 12 Nov 2023 15:40:58 +0300 Subject: [PATCH] feat: add atlas pull support Refs: FC-0012 OEP-58 --- Dockerfile | 3 ++- Makefile | 6 ++++++ requirements/base.in | 1 + requirements/base.txt | 2 ++ requirements/dev.txt | 4 +++- requirements/production.txt | 2 ++ requirements/test.txt | 4 +++- tox.ini | 5 ++--- 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5eeb76fe686..8a06c2ad9b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,9 @@ FROM ubuntu:focal as app ENV DEBIAN_FRONTEND noninteractive # System requirements. RUN apt update && \ - apt-get install -qy \ + apt-get install -qy \ curl \ + gettext \ git \ language-pack-en \ build-essential \ diff --git a/Makefile b/Makefile index f12310e0016..ac03fab4661 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,13 @@ compile_translations: requirements.tox fake_translations: extract_translations dummy_translations compile_translations pull_translations: +ifeq ($(OPENEDX_ATLAS_PULL),) cd ecommerce && tx pull -a -f -t --mode reviewed +else + find ecommerce/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; + atlas pull $(OPENEDX_ATLAS_ARGS) translations/ecommerce/ecommerce/conf/locale:ecommerce/conf/locale + python manage.py compilemessages +endif push_translations: cd ecommerce && tx push -s diff --git a/requirements/base.in b/requirements/base.in index cbdd411b0dd..038495130d5 100755 --- a/requirements/base.in +++ b/requirements/base.in @@ -45,6 +45,7 @@ markdown==2.6.9 mysqlclient<1.5 newrelic ndg-httpsclient +openedx-atlas path.py==7.2 paypalrestsdk premailer==2.9.2 diff --git a/requirements/base.txt b/requirements/base.txt index e56f3335f90..af2d9bd119d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -362,6 +362,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via drf-yasg paramiko==3.2.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index dc124d3b52a..2a0f69315d7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -333,7 +333,7 @@ edx-drf-extensions==8.13.0 # edx-rbac edx-ecommerce-worker==3.3.4 # via -r requirements/test.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.3.0 # via -r requirements/test.txt edx-opaque-keys==2.3.0 # via @@ -570,6 +570,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via # -r requirements/docs.txt diff --git a/requirements/production.txt b/requirements/production.txt index 95da1a4269e..a78cee4cdc3 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -372,6 +372,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via drf-yasg paramiko==3.2.0 diff --git a/requirements/test.txt b/requirements/test.txt index 11feac73caa..36a56461be2 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -324,7 +324,7 @@ edx-drf-extensions==8.13.0 # edx-rbac edx-ecommerce-worker==3.3.4 # via -r requirements/base.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.3.0 # via -r requirements/test.in edx-opaque-keys==2.3.0 # via @@ -549,6 +549,8 @@ oauthlib==3.2.2 # getsmarter-api-clients # requests-oauthlib # social-auth-core +openedx-atlas==0.5.0 + # via -r requirements/base.in packaging==23.1 # via # -r requirements/base.txt diff --git a/tox.ini b/tox.ini index f2665c563c3..1911c053c03 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ deps = allowlist_externals = /bin/bash changedir = - dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce + extract_translations,dummy_translations,compile_translations,detect_changed_translations,validate_translations: ecommerce commands = static: python manage.py collectstatic --noinput --verbosity 0 static: python manage.py compress --force @@ -64,8 +64,7 @@ commands = pylint: pylint -j 0 --rcfile=pylintrc ecommerce e2e - extract_translations: python manage.py makemessages -l en -v1 -d django --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*" - extract_translations: python manage.py makemessages -l en -v1 -d djangojs --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*" + extract_translations: i18n_tool extract --no-merge --no-segment dummy_translations: i18n_tool dummy compile_translations: python ../manage.py compilemessages