Skip to content

Commit

Permalink
fix: issues with docs & testing
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed Feb 3, 2025
1 parent 5a1f382 commit e1c77ff
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,19 @@ dev.clean:
-docker rmi $(REPO_NAME)-dev

dev.build:
docker build -t $(REPO_NAME)-dev $(CURDIR)

dev.run: dev.clean dev.build ## Clean, build and run test image
docker build --no-cache -t $(REPO_NAME)-dev $(CURDIR)

check-log:
@if [ ! -d "$(CURDIR)/var" ]; then \
echo "Creating var directory"; \
mkdir -p $(CURDIR)/var; \
fi
@if [ ! -f "$(CURDIR)/var/workbench.log" ]; then \
echo "Creating empty workbench.log"; \
touch $(CURDIR)/var/workbench.log; \
fi

dev.run: dev.clean dev.build check-log
docker run -p 8000:8000 -v $(CURDIR):/usr/local/src/$(REPO_NAME) --name $(REPO_NAME)-dev $(REPO_NAME)-dev

# XBlock directories
Expand Down Expand Up @@ -83,11 +93,17 @@ build_dummy_translations: dummy_translations compile_translations ## generate an

validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations

pull_translations: ## pull translations from transifex
cd $(PACKAGE_NAME) && i18n_tool transifex pull
pull_translations: ## pull translations from Transifex for each XBlock
@for xblock in $(XBLOCKS); do \
echo "Pulling translations for $$xblock..."; \
cd $$xblock && i18n_tool transifex pull; \
done

push_translations: extract_translations ## push translations to transifex
cd $(PACKAGE_NAME) && i18n_tool transifex push
push_translations: extract_translations ## push translations to Transifex for each XBlock
@for xblock in $(XBLOCKS); do \
echo "Pushing translations for $$xblock..."; \
cd $$xblock && i18n_tool transifex push; \
done

install_transifex_client: ## Install the Transifex client
# Instaling client will skip CHANGELOG and LICENSE files from git changes
Expand Down
13 changes: 13 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
from datetime import datetime
from subprocess import check_call

import django
from django.conf import settings

settings.configure(
USE_I18N=True,
USE_L10N=True,
USE_TZ=True,
LANGUAGE_CODE="en-us",
LANGUAGES=[("en", "English")],
)

django.setup()


def get_version(*file_paths):
"""
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ commands =

[testenv:docs]
setenv =
DJANGO_SETTINGS_MODULE = translation_settings
PYTHONPATH = {toxinidir}
# Adding the option here instead of as a default in the docs Makefile because that Makefile is generated by shpinx.
SPHINXOPTS = -W
Expand Down

0 comments on commit e1c77ff

Please sign in to comment.