Skip to content

Commit

Permalink
fix: transifex pull is failing
Browse files Browse the repository at this point in the history
Fix by merging `transifex.txt` into `translations.txt` and using only the latter to avoid missing requirements scenarios

Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif committed Sep 30, 2023
1 parent 4c69261 commit ef7546c
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fix-transifex-resource-names.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
env:
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
run: |
make transifex_resources_requirements
make translations_scripts_requirements
make fix_transifex_resource_names
2 changes: 1 addition & 1 deletion .github/workflows/sync-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
with:
python-version: 3.8
- name: Install Python dependencies
run: make sync_requirements
run: make translations_scripts_requirements

- name: Sync
env:
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: piptools upgrade fix_transifex_resource_names transifex_resources_requirements validate_translation_files \
.PHONY: piptools upgrade fix_transifex_resource_names translations_scripts_requirements validate_translation_files \
sync_translations sync_translations_github_workflow


Expand All @@ -17,11 +17,10 @@ upgrade: piptools ## update the requirements/*.txt files with the latest packag
pip install -qr requirements/pip.txt
pip install -qr requirements/pip_tools.txt
pip-compile --rebuild --upgrade -o requirements/translations.txt requirements/translations.in
pip-compile --rebuild --upgrade -o requirements/transifex.txt requirements/transifex.in
pip-compile --rebuild --upgrade -o requirements/test.txt requirements/test.in


transifex_resources_requirements: ## Installs the requirements file
translations_scripts_requirements: ## Installs the requirements file
pip install -q -r requirements/transifex.txt

fix_transifex_resource_names: ## Runs the script
Expand All @@ -45,9 +44,6 @@ validate_translation_files: ## Run basic validation to ensure files are compila
@echo 'Congratulations! Translation files are valid.'
@echo '-----------------------------------------'

sync_requirements: ## install translations.txt requirements
pip install -q -r requirements/translations.txt

sync_translations: ## Syncs from the old projects to the new openedx-translations project
python scripts/sync_translations.py $(SYNC_ARGS)

Expand Down
2 changes: 1 addition & 1 deletion requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-c constraints.txt
-r transifex.txt
-r translations.txt

pytest
pytest-cov
Expand Down
79 changes: 55 additions & 24 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,74 @@
#
# make upgrade
#
asgiref==3.7.2
# via
# -r requirements/translations.txt
# django
asttokens==2.4.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# transifex-python
certifi==2023.7.22
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# requests
charset-normalizer==3.2.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# requests
click==8.1.7
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# transifex-python
coverage[toml]==7.3.1
# via pytest-cov
django==3.2.21
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/translations.txt
# edx-i18n-tools
edx-i18n-tools==1.2.0
# via -r requirements/translations.txt
exceptiongroup==1.1.3
# via pytest
future==0.18.3
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# pyseeyou
gitdb==4.0.10
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# gitpython
gitpython==3.1.36
gitpython==3.1.37
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# transifex-client
idna==3.4
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# requests
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
parsimonious==0.10.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# pyseeyou
path==16.7.1
# via
# -r requirements/translations.txt
# edx-i18n-tools
pluggy==1.3.0
# via pytest
polib==1.2.0
# via
# -r requirements/translations.txt
# edx-i18n-tools
pyseeyou==1.0.2
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# transifex-python
pytest==7.4.2
# via
Expand All @@ -62,56 +81,68 @@ pytest-cov==4.1.0
# via -r requirements/test.in
python-slugify==4.0.1
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# transifex-client
pytz==2023.3.post1
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# django
# transifex-python
pyyaml==6.0.1
# via responses
# via
# -r requirements/translations.txt
# edx-i18n-tools
# responses
regex==2023.8.8
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# parsimonious
requests==2.31.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# responses
# transifex-client
# transifex-python
responses==0.23.3
# via -r requirements/test.in
six==1.16.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# asttokens
# transifex-client
smmap==5.0.1
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# gitdb
sqlparse==0.4.4
# via
# -r requirements/translations.txt
# django
text-unidecode==1.3
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# python-slugify
tomli==2.0.1
# via
# coverage
# pytest
toolz==0.12.0
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# pyseeyou
transifex-client==0.14.4
# via -r requirements/transifex.txt
# via -r requirements/translations.txt
transifex-python==3.4.0
# via -r requirements/transifex.txt
types-pyyaml==6.0.12.11
# via -r requirements/translations.txt
types-pyyaml==6.0.12.12
# via responses
typing-extensions==4.8.0
# via
# -r requirements/translations.txt
# asgiref
urllib3==1.26.16
# via
# -r requirements/transifex.txt
# -r requirements/translations.txt
# requests
# responses
# transifex-client
5 changes: 0 additions & 5 deletions requirements/transifex.in

This file was deleted.

55 changes: 0 additions & 55 deletions requirements/transifex.txt

This file was deleted.

5 changes: 5 additions & 0 deletions requirements/translations.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
# i18n
edx-i18n-tools
pyyaml

# transifex
requests
transifex-client
transifex-python
51 changes: 50 additions & 1 deletion requirements/translations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,72 @@
#
asgiref==3.7.2
# via django
asttokens==2.4.0
# via transifex-python
certifi==2023.7.22
# via requests
charset-normalizer==3.2.0
# via requests
click==8.1.7
# via transifex-python
django==3.2.21
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# edx-i18n-tools
edx-i18n-tools==1.2.0
# via -r requirements/translations.in
future==0.18.3
# via pyseeyou
gitdb==4.0.10
# via gitpython
gitpython==3.1.37
# via transifex-client
idna==3.4
# via requests
parsimonious==0.10.0
# via pyseeyou
path==16.7.1
# via edx-i18n-tools
polib==1.2.0
# via edx-i18n-tools
pyseeyou==1.0.2
# via transifex-python
python-slugify==4.0.1
# via transifex-client
pytz==2023.3.post1
# via django
# via
# django
# transifex-python
pyyaml==6.0.1
# via
# -r requirements/translations.in
# edx-i18n-tools
regex==2023.8.8
# via parsimonious
requests==2.31.0
# via
# -r requirements/translations.in
# transifex-client
# transifex-python
six==1.16.0
# via
# asttokens
# transifex-client
smmap==5.0.1
# via gitdb
sqlparse==0.4.4
# via django
text-unidecode==1.3
# via python-slugify
toolz==0.12.0
# via pyseeyou
transifex-client==0.14.4
# via -r requirements/translations.in
transifex-python==3.4.0
# via -r requirements/translations.in
typing-extensions==4.8.0
# via asgiref
urllib3==1.26.16
# via
# requests
# transifex-client

0 comments on commit ef7546c

Please sign in to comment.