Skip to content

Commit eaa279a

Browse files
authored
fix: issues with docs & testing (#32)
1 parent 5a1f382 commit eaa279a

File tree

3 files changed

+36
-8
lines changed

3 files changed

+36
-8
lines changed

Makefile

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,19 @@ dev.clean:
4545
-docker rmi $(REPO_NAME)-dev
4646

4747
dev.build:
48-
docker build -t $(REPO_NAME)-dev $(CURDIR)
49-
50-
dev.run: dev.clean dev.build ## Clean, build and run test image
48+
docker build --no-cache -t $(REPO_NAME)-dev $(CURDIR)
49+
50+
check-log:
51+
@if [ ! -d "$(CURDIR)/var" ]; then \
52+
echo "Creating var directory"; \
53+
mkdir -p $(CURDIR)/var; \
54+
fi
55+
@if [ ! -f "$(CURDIR)/var/workbench.log" ]; then \
56+
echo "Creating empty workbench.log"; \
57+
touch $(CURDIR)/var/workbench.log; \
58+
fi
59+
60+
dev.run: dev.clean dev.build check-log
5161
docker run -p 8000:8000 -v $(CURDIR):/usr/local/src/$(REPO_NAME) --name $(REPO_NAME)-dev $(REPO_NAME)-dev
5262

5363
# XBlock directories
@@ -83,11 +93,17 @@ build_dummy_translations: dummy_translations compile_translations ## generate an
8393

8494
validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations
8595

86-
pull_translations: ## pull translations from transifex
87-
cd $(PACKAGE_NAME) && i18n_tool transifex pull
96+
pull_translations: ## pull translations from Transifex for each XBlock
97+
@for xblock in $(XBLOCKS); do \
98+
echo "Pulling translations for $$xblock..."; \
99+
cd $$xblock && i18n_tool transifex pull; \
100+
done
88101

89-
push_translations: extract_translations ## push translations to transifex
90-
cd $(PACKAGE_NAME) && i18n_tool transifex push
102+
push_translations: extract_translations ## push translations to Transifex for each XBlock
103+
@for xblock in $(XBLOCKS); do \
104+
echo "Pushing translations for $$xblock..."; \
105+
cd $$xblock && i18n_tool transifex push; \
106+
done
91107

92108
install_transifex_client: ## Install the Transifex client
93109
# Instaling client will skip CHANGELOG and LICENSE files from git changes

docs/conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
from datetime import datetime
1818
from subprocess import check_call
1919

20+
import django
21+
from django.conf import settings
22+
23+
settings.configure(
24+
USE_I18N=True,
25+
USE_L10N=True,
26+
USE_TZ=True,
27+
LANGUAGE_CODE="en-us",
28+
LANGUAGES=[("en", "English")],
29+
)
30+
31+
django.setup()
32+
2033

2134
def get_version(*file_paths):
2235
"""

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ commands =
4949

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

0 commit comments

Comments
 (0)