Fix build-i18n.py to set up the appropriate environment before importing.

Review Request #10944 — Created March 9, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

build-i18n.py, which is a necessary part of the package build process,
was assuming it had the right version of Review Board and Django in the
import path when it began importing modules. While this is often going
to be the case when building packages, it's not necessarily the case in
CI.

Our build-media.py script has code to set up the correct environment
before doing imports, so it was able to work fine in CI. This change
simply copies over that logic to build-i18n.py.

Built the package successfully.

Summary ID
Fix build-i18n.py to set up the appropriate environment before importing.
`build-i18n.py`, which is a necessary part of the package build process, was assuming it had the right version of Review Board and Django in the import path when it began importing modules. While this is often going to be the case when building packages, it's not necessarily the case in CI. Our `build-media.py` script has code to set up the correct environment before doing imports, so it was able to work fine in CI. This change simply copies over that logic to `build-i18n.py`.
82d747564dedf90293a6895aed1672eaecdc4c8b
Description From Last Updated

E402 module level import not at top of file

reviewbotreviewbot

E402 module level import not at top of file

reviewbotreviewbot

E402 module level import not at top of file

reviewbotreviewbot

F401 'pkg_resources' imported but unused

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (a11c896)