Skip to content

Commit

Permalink
Upgrades isort webtest and pylint quotes (oppia#6938)
Browse files Browse the repository at this point in the history
* initial commit

* test commit

* Fix backend tests

* Fix lints

* Revert fsevent

* Removed unwanted str

* Revert package-lock.json
  • Loading branch information
Nisheal John authored and seanlip committed Jun 20, 2019
1 parent 6dc1fb2 commit 995b667
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion core/controllers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ def render_template(self, filepath, iframe_restriction='DENY'):

if iframe_restriction is not None:
if iframe_restriction in ['SAMEORIGIN', 'DENY']:
self.response.headers['X-Frame-Options'] = iframe_restriction
self.response.headers['X-Frame-Options'] = str(
iframe_restriction)
else:
raise Exception(
'Invalid X-Frame-Options: %s' % iframe_restriction)
Expand Down
2 changes: 1 addition & 1 deletion core/tests/gae_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
DIRS_TO_ADD_TO_SYS_PATH = [
os.path.join(
OPPIA_TOOLS_DIR, 'google_appengine_1.9.67', 'google_appengine'),
os.path.join(OPPIA_TOOLS_DIR, 'webtest-1.4.2'),
os.path.join(OPPIA_TOOLS_DIR, 'webtest-2.0.33'),
os.path.join(
OPPIA_TOOLS_DIR, 'google_appengine_1.9.67', 'google_appengine',
'lib', 'webob_0_9'),
Expand Down
24 changes: 12 additions & 12 deletions scripts/install_third_party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,32 +124,32 @@ if [ ! -d "$TOOLS_DIR/Pillow-6.0.0" ]; then
fi

echo Checking if pylint-quotes is installed in $TOOLS_DIR
if [ ! -d "$TOOLS_DIR/pylint-quotes-0.1.9" ]; then
if [ ! -d "$TOOLS_DIR/pylint-quotes-0.2.1" ]; then
echo Installing pylint-quotes
# Note that the URL redirects, so we pass in -L to tell curl to follow the redirect.
curl -o pylint-quotes-0.1.9.tar.gz -L https://github.com/edaniszewski/pylint-quotes/archive/0.1.9.tar.gz
tar xzf pylint-quotes-0.1.9.tar.gz -C $TOOLS_DIR
rm pylint-quotes-0.1.9.tar.gz
curl -o pylint-quotes-0.2.1.tar.gz -L https://github.com/edaniszewski/pylint-quotes/archive/0.2.1.tar.gz
tar xzf pylint-quotes-0.2.1.tar.gz -C $TOOLS_DIR
rm pylint-quotes-0.2.1.tar.gz
fi

# Install webtest.
echo Checking if webtest is installed in third_party
if [ ! -d "$TOOLS_DIR/webtest-1.4.2" ]; then
if [ ! -d "$TOOLS_DIR/webtest-2.0.33" ]; then
echo Installing webtest framework
# Note that the github URL redirects, so we pass in -L to tell curl to follow the redirect.
curl -o webtest-download.zip -L https://github.com/Pylons/webtest/archive/1.4.2.zip
unzip webtest-download.zip -d $TOOLS_DIR
rm webtest-download.zip
curl -o webtest-2.0.33.zip -L https://github.com/Pylons/webtest/archive/2.0.33.zip
unzip webtest-2.0.33.zip -d $TOOLS_DIR
rm webtest-2.0.33.zip
fi

# Install isort.
echo Checking if isort is installed in third_party
if [ ! -d "$TOOLS_DIR/isort-4.2.15" ]; then
if [ ! -d "$TOOLS_DIR/isort-4.3.20" ]; then
echo Installing isort
# Note that the URL redirects, so we pass in -L to tell curl to follow the redirect.
curl -o isort-4.2.15.tar.gz -L https://pypi.python.org/packages/4d/d5/7c8657126a43bcd3b0173e880407f48be4ac91b4957b51303eab744824cf/isort-4.2.15.tar.gz
tar xzf isort-4.2.15.tar.gz -C $TOOLS_DIR
rm isort-4.2.15.tar.gz
curl -o isort-4.3.20.tar.gz -L https://files.pythonhosted.org/packages/f1/84/5d66ddbe565e36682c336c841e51430384495b272c622ac229029f671be2/isort-4.3.20.tar.gz
tar xzf isort-4.3.20.tar.gz -C $TOOLS_DIR
rm isort-4.3.20.tar.gz
fi

# Install pycodestyle.
Expand Down
4 changes: 2 additions & 2 deletions scripts/pre_commit_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@
os.path.join(
_PARENT_DIR, 'oppia_tools', 'google_appengine_1.9.67',
'google_appengine'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'webtest-1.4.2'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'webtest-2.0.33'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'browsermob-proxy-0.7.1'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'esprima-4.0.1'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'pycodestyle-2.5.0'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'pylint-quotes-0.1.9'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'pylint-quotes-0.2.1'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'selenium-2.53.2'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'PyGithub-1.43.5'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'Pillow-6.0.0'),
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_gae.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export GOOGLE_CLOUD_SDK_HOME=$TOOLS_DIR/google-cloud-sdk-222.0.0/google-cloud-sd
export COVERAGE_HOME=$TOOLS_DIR/coverage-4.5.1

# Note that if the following line is changed so that it uses webob_1_1_1, PUT requests from the frontend fail.
export PYTHONPATH=.:$COVERAGE_HOME:$GOOGLE_APP_ENGINE_HOME:$GOOGLE_APP_ENGINE_HOME/lib/webob_0_9:$TOOLS_DIR/webtest-1.4.2:$PYTHONPATH
export PYTHONPATH=.:$COVERAGE_HOME:$GOOGLE_APP_ENGINE_HOME:$GOOGLE_APP_ENGINE_HOME/lib/webob_0_9:$TOOLS_DIR/webtest-2.0.33:$PYTHONPATH

# Delete old *.pyc files
find . -iname "*.pyc" -exec rm -f {} \;
Expand Down

0 comments on commit 995b667

Please sign in to comment.