Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert bash scripts to Python #7465

Merged
merged 156 commits into from
Sep 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
6ac0724
initial
Aug 17, 2019
13c37f9
fix lint
Aug 18, 2019
9ae6f2e
fix
Aug 18, 2019
2eca67e
fix
Aug 18, 2019
c9b6f98
conver
Aug 19, 2019
7218092
fix
Aug 19, 2019
9250dcb
fix
Aug 19, 2019
9d33246
convert
Aug 19, 2019
41113da
fix
Aug 19, 2019
4fe2b2d
Merge branch 'develop' into convert_bash_1
Aug 20, 2019
406129e
Merge branch 'develop' into convert_bash_1
Aug 21, 2019
beb3c52
add
Aug 22, 2019
77e21d7
convert
Aug 22, 2019
c5e3c97
fix lint
Aug 22, 2019
a5eebeb
convert
Aug 22, 2019
f9a8586
convert
Aug 22, 2019
afb7068
Merge branch 'develop' into convert_bash_1
Aug 23, 2019
dc1845c
convert
Aug 23, 2019
eee27b9
convert
Aug 24, 2019
a6dc5bb
convert
Aug 24, 2019
e88fd13
address
Aug 24, 2019
c373919
fix path
Aug 24, 2019
06dc081
convert
Aug 24, 2019
6b57f85
Merge branch 'develop' into convert_bash_1
Aug 25, 2019
845a94c
remove files
Aug 25, 2019
4df7247
convert
Aug 25, 2019
d3a2464
fix comment
Aug 25, 2019
275d886
convert
Aug 25, 2019
3482864
convert
Aug 25, 2019
0ab00ec
fix
Aug 25, 2019
cbb09a7
address comments
Aug 25, 2019
d2ed087
convert
Aug 25, 2019
1ced71c
convert
Aug 25, 2019
60510ae
fix lint
Aug 25, 2019
f83f917
update circleci
Aug 25, 2019
fb26396
fix
Aug 25, 2019
d0a9f56
convert
Aug 25, 2019
df0c880
fix
Aug 25, 2019
af66d95
fix
Aug 25, 2019
48c8ce8
fix
Aug 25, 2019
fcbbbb0
fix
Aug 25, 2019
0af2fc4
Merge branch 'develop' into convert_bash_1
Aug 25, 2019
d3f80a3
sync with develop
Aug 25, 2019
740eb7a
fix
Aug 25, 2019
c6ae74b
fix conflicts
Aug 26, 2019
2834e82
use parse known args
Aug 26, 2019
8bbda96
remove user
Aug 26, 2019
cd84f0b
fix pip
Aug 27, 2019
2c03e24
try subprocess on pip install
Aug 27, 2019
cd4a824
fix
Aug 27, 2019
ae51254
fix
Aug 27, 2019
a7e21c5
fix
Aug 27, 2019
e9fd69d
fix
Aug 27, 2019
b26d7dc
fix
Aug 27, 2019
33a10ce
add node path
Aug 27, 2019
8ba23a5
fix
Aug 27, 2019
db7a003
fix lint
Aug 27, 2019
f521c7a
add args
Aug 27, 2019
b6d5878
fix lint
Aug 27, 2019
3086329
merge develo
Aug 27, 2019
b912d6d
add path
Aug 27, 2019
efabda0
address comments
Aug 27, 2019
899228a
address comments
Aug 27, 2019
6044c23
fix
Aug 27, 2019
c28656b
fix
Aug 27, 2019
2d62316
fix
Aug 27, 2019
1e7bcdb
fix
Aug 27, 2019
3a97331
fix frontend
Aug 28, 2019
cfad6b3
fix
Aug 28, 2019
11ae549
fix start
Aug 28, 2019
46eb948
fix lint
Aug 28, 2019
95b6ca9
clear cache
Aug 28, 2019
7130eb7
revert
Aug 28, 2019
13155a5
remove pylint
Aug 28, 2019
86647a8
remove pylint path
Aug 28, 2019
7c47253
add path
Aug 28, 2019
efc69b0
add pylint path
Aug 28, 2019
834bffa
fix
Aug 28, 2019
0186a8a
fix
Aug 28, 2019
326eda8
use vurtual env
Aug 28, 2019
4f4b3c2
fix
Aug 28, 2019
ad9fbae
fix
Aug 28, 2019
34efc74
add url in travis yaml
Aug 28, 2019
2d3d642
test
Aug 28, 2019
dcf6ec3
test
Aug 28, 2019
b532ba0
fix
Aug 28, 2019
f58f27a
test
Aug 28, 2019
93b7cf4
test
Aug 28, 2019
01970a5
test
Aug 28, 2019
eda2856
test
Aug 28, 2019
92d39d5
test
Aug 28, 2019
98b324b
test
Aug 28, 2019
4cc089c
test
Aug 28, 2019
2f2871c
tes
Aug 28, 2019
14d2659
fi
Aug 28, 2019
862490c
fix
Aug 28, 2019
1ec120f
test
Aug 28, 2019
9386c0c
fix conflicts
Aug 29, 2019
11d891d
fix
Aug 29, 2019
07eaf2b
Merge branch 'develop' into convert_bash_1
Aug 30, 2019
ce7d114
fix
Aug 30, 2019
6f04c1b
fix test
Aug 30, 2019
767d97e
fix
Aug 30, 2019
82804cb
fix conflicts
Aug 31, 2019
8e43243
fix
Aug 31, 2019
fabf517
address comments
Aug 31, 2019
8b7bb5a
fix
Aug 31, 2019
057f2e6
fix node
Aug 31, 2019
8003bfe
fix
Aug 31, 2019
25b64ad
remove vagrant
Aug 31, 2019
0492abe
fix
Aug 31, 2019
fd168ab
address comments
Aug 31, 2019
77ddcbc
fix conflicts
Aug 31, 2019
d89c3b0
fix lint
Aug 31, 2019
251669a
fix
Aug 31, 2019
b07b0d9
fix
Aug 31, 2019
03e56b7
address comments
Aug 31, 2019
770cd4f
fix
Aug 31, 2019
fafbde2
fix
Sep 1, 2019
9ec9238
fix
Sep 1, 2019
33f38a7
fix
Sep 1, 2019
35cfe60
fix
Sep 1, 2019
af6ad16
merge develop
Sep 2, 2019
55a1a99
address comments
Sep 2, 2019
c604eae
fix
Sep 2, 2019
90b50d8
fix
Sep 2, 2019
5bdc8b1
fix
Sep 2, 2019
891d088
only one backend_tests.py
Sep 2, 2019
a6e6b28
address comments
Sep 2, 2019
a42a17c
Merge branch 'develop' into convert_bash_1
Sep 2, 2019
28eaabe
fix
Sep 2, 2019
6e9b993
fix
Sep 2, 2019
7bf028d
fix
Sep 2, 2019
f0ebb60
fix
Sep 2, 2019
8fe8d20
fix errors
Sep 2, 2019
b73afbf
address comments
Sep 2, 2019
1b4638b
fix
Sep 2, 2019
64fc6c5
use None and args
Sep 2, 2019
320b65e
fix permission
Sep 2, 2019
127cead
fix
Sep 2, 2019
595be3c
fix conflicts
Sep 2, 2019
6939582
address comments
Sep 2, 2019
80a9599
fix e2e
Sep 3, 2019
5ac03b0
address comments
Sep 3, 2019
9a84e6f
fix
Sep 3, 2019
770c6f3
fix
Sep 3, 2019
d713208
skip e2e
Sep 3, 2019
c3006d2
remove yaml
Sep 3, 2019
2459c84
fix lint
Sep 3, 2019
89f61e6
use single quotes
Sep 4, 2019
07814eb
fix conflicts
Sep 7, 2019
89afe82
fix conflicts
Sep 7, 2019
6967564
test
Sep 7, 2019
6ba9902
fix linr
Sep 7, 2019
943759b
add tests
Sep 8, 2019
911d84a
use triple strings
Sep 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use triple strings
  • Loading branch information
Rishav Chakraborty committed Sep 8, 2019
commit 911d84ab18caea4656763f04a0812aa6d84de01f
10 changes: 5 additions & 5 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@
APP_DEV_YAML_FILEPATH = 'app_dev.yaml'
APP_YAML_FILEPATH = 'app.yaml'

_PARSER = argparse.ArgumentParser(
description='Creates a third-party directory where all the JS and CSS '
'dependencies are built and stored. Depending on the options passed to the '
'script, might also minify third-party libraries and/or generate a build '
'directory.')
_PARSER = argparse.ArgumentParser(description="""
Creates a third-party directory where all the JS and CSS dependencies are
built and stored. Depending on the options passed to the script, might also
minify third-party libraries and/or generate a build directory.
""")

_PARSER.add_argument(
'--prod_env', action='store_true', default=False, dest='prod_mode')
Expand Down
5 changes: 3 additions & 2 deletions scripts/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
CURR_DIR = os.path.abspath(os.getcwd())
OPPIA_TOOLS_DIR = os.path.join(CURR_DIR, '..', 'oppia_tools')

_PARSER = argparse.ArgumentParser(
description='Deletes temporary and installed files.')
_PARSER = argparse.ArgumentParser(description="""
Deletes temporary and installed files.
""")


def delete_directory_tree(directory_path):
Expand Down
9 changes: 5 additions & 4 deletions scripts/create_expression_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
from . import common
from . import setup

_PARSER = argparse.ArgumentParser(
description='Run this script from the oppia root folder: '
'python -m scripts.create_expression_parser. '
'The root folder MUST be named \'oppia\'.')
_PARSER = argparse.ArgumentParser(description="""
Run this script from the oppia root folder:
python -m scripts.create_expression_parser
The root folder MUST be named 'oppia'.
""")


def main(args=None):
Expand Down
7 changes: 4 additions & 3 deletions scripts/install_chrome_on_travis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

import python_utils

_PARSER = argparse.ArgumentParser(
description='This script should only be run by Travis to install and '
'provide a constant version of Chrome.')
_PARSER = argparse.ArgumentParser(description="""
This script should only be run by Travis to install and provide a constant
version of Chrome.
""")


def main(args=None):
Expand Down
5 changes: 3 additions & 2 deletions scripts/install_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
}
}

_PARSER = argparse.ArgumentParser(
description='Installation script for Oppia third-party libraries.')
_PARSER = argparse.ArgumentParser(description="""
Installation script for Oppia third-party libraries.
""")


def download_files(source_url_root, target_dir, source_filenames):
Expand Down
5 changes: 3 additions & 2 deletions scripts/install_third_party_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
# pylint: enable=wrong-import-order
# pylint: enable=wrong-import-position

_PARSER = argparse.ArgumentParser(
description='Installation script for Oppia third-party libraries.')
_PARSER = argparse.ArgumentParser(description="""
Installation script for Oppia third-party libraries.
""")

_PARSER.add_argument(
'--nojsrepl',
Expand Down
9 changes: 5 additions & 4 deletions scripts/run_backend_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@
_LOAD_TESTS_DIR = os.path.join(os.getcwd(), 'core', 'tests', 'load_tests')


_PARSER = argparse.ArgumentParser(
description='Run this script from the oppia root folder: '
'python -m scripts.run_backend_tests. '
'IMPORTANT: Only one of --test_path and --test_target should be specified.')
_PARSER = argparse.ArgumentParser(description="""
Run this script from the oppia root folder:
python -m scripts.run_backend_tests
IMPORTANT: Only one of --test_path and --test_target should be specified.
""")

_EXCLUSIVE_GROUP = _PARSER.add_mutually_exclusive_group()
_EXCLUSIVE_GROUP.add_argument(
Expand Down
13 changes: 7 additions & 6 deletions scripts/run_frontend_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
from . import setup
from . import setup_gae

_PARSER = argparse.ArgumentParser(
description='Run this script from the oppia root folder: '
'python -m scripts.run_frontend_tests. '
'The root folder MUST be named \'oppia\'. '
'Note: You can replace \'it\' with \'fit\' or \'describe\' with '
'\'fdescribe\' to run a single test or test suite.')
_PARSER = argparse.ArgumentParser(description="""
Run this script from the oppia root folder:
python -m scripts.run_frontend_tests
The root folder MUST be named 'oppia'.
Note: You can replace 'it' with 'fit' or 'describe' with 'fdescribe' to run
a single test or test suite.
""")

_PARSER.add_argument(
'--skip_install',
Expand Down
17 changes: 9 additions & 8 deletions scripts/run_performance_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
from . import setup
from . import setup_gae

_PARSER = argparse.ArgumentParser(
description='The root folder MUST be named \'oppia\'. '
'Run all tests sequentially: '
'python -m scripts.run_performance_tests without args in order to run all '
'tests sequentially. '
'Run test for a specific page: '
'python -m scripts.run_performance_tests --test_name=page_test. '
'page_test is the name of the file containing that test eg. splash_test.')
_PARSER = argparse.ArgumentParser(description="""
The root folder MUST be named 'oppia'.
Run all tests sequentially:
python -m scripts.run_performance_tests without args in order to run all
tests sequentially.
Run test for a specific page:
python -m scripts.run_performance_tests --test_name=page_test
page_test is the name of the file containing that test eg. splash_test.
""")

_PARSER.add_argument(
'--skip_install',
Expand Down
33 changes: 16 additions & 17 deletions scripts/run_presubmit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,22 @@
from . import run_backend_tests
from . import run_frontend_tests

_PARSER = argparse.ArgumentParser(
description='Run this script from the oppia root folder prior to opening a '
'PR: '
'python -m scripts.run_presubmit_checks '
'Set the origin branch to compare against by adding '
'--branch=your_branch or -b=your_branch '
'By default, if the current branch tip exists on remote origin, '
'the current branch is compared against its tip on GitHub. '
'Otherwise it\'s compared against \'develop\'. '
'This script runs the following tests in all cases. '
'- Javascript and Python Linting '
'- Backend Python tests '
'Only when frontend files are changed will it run Frontend Karma unit '
'tests. '
'If any of these tests result in errors, this script will terminate. '
'Note: The test scripts are arranged in increasing order of time taken. '
'This enables a broken build to be detected as quickly as possible.')
_PARSER = argparse.ArgumentParser(description="""
Run this script from the oppia root folder prior to opening a PR:
python -m scripts.run_presubmit_checks
Set the origin branch to compare against by adding
--branch=your_branch or -b=your_branch
By default, if the current branch tip exists on remote origin,
the current branch is compared against its tip on GitHub.
Otherwise it's compared against 'develop'.
This script runs the following tests in all cases.
- Javascript and Python Linting
- Backend Python tests
Only when frontend files are changed will it run Frontend Karma unit tests.
If any of these tests result in errors, this script will terminate.
Note: The test scripts are arranged in increasing order of time taken. This
enables a broken build to be detected as quickly as possible.
""")

_PARSER.add_argument(
'--branch', '-b',
Expand Down
15 changes: 8 additions & 7 deletions scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
from . import setup
from . import setup_gae

_PARSER = argparse.ArgumentParser(
description='Run this script from the oppia root folder: '
'python -m scripts.run_tests '
'This script runs all the tests, in this order: '
'- Frontend Karma unit tests '
'- Backend Python tests '
'- End-to-end Protractor tests ')
_PARSER = argparse.ArgumentParser(description="""
Run this script from the oppia root folder:
python -m scripts.run_tests
This script runs all the tests, in this order:
- Frontend Karma unit tests
- Backend Python tests
- End-to-end Protractor tests
""")


def main(args=None):
Expand Down
5 changes: 3 additions & 2 deletions scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
from . import clean
from . import common

_PARSER = argparse.ArgumentParser(
description='Python execution environent set up for all scripts.')
_PARSER = argparse.ArgumentParser(description="""
Python execution environent set up for all scripts.
""")


def delete_directory_tree(directory_path):
Expand Down
6 changes: 3 additions & 3 deletions scripts/setup_gae.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

from . import common

_PARSER = argparse.ArgumentParser(
description='Python execution environment setup for scripts that require '
'GAE.')
_PARSER = argparse.ArgumentParser(description="""
Python execution environment setup for scripts that require GAE.
""")


def main(args=None):
Expand Down
9 changes: 5 additions & 4 deletions scripts/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
from . import setup
from . import setup_gae

_PARSER = argparse.ArgumentParser(
description='Run the script from the oppia root folder: '
'python -m scripts.start '
'Note that the root folder MUST be named \'oppia\'.')
_PARSER = argparse.ArgumentParser(description="""
Run the script from the oppia root folder:
python -m scripts.start
Note that the root folder MUST be named 'oppia'.
""")

_PARSER.add_argument(
'--save_datastore',
Expand Down