Skip to content

Commit dd8bfdc

Browse files
committed
modified run_tests.sh to use poetry
1 parent 3bf439e commit dd8bfdc

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

run_tests.sh

+12-9
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
function setup_python {
17-
python3 -m venv .env
18-
source .env/bin/activate
19-
pip install --upgrade pip
20-
pip3 install -r requirements.txt -q
16+
function setup_poetry {
17+
export PATH="$HOME/.local/bin:$PATH"
18+
alias pyrun='poetry run python3 -m'
19+
20+
if ! which poetry; then
21+
curl -sSL https://install.python-poetry.org | python
22+
fi
23+
poetry install
2124
}
2225

2326
function run_py_test {
24-
setup_python
25-
python3 -m pytest -vv
27+
setup_poetry
28+
pyrun pytest -vv
2629
echo -e "#### Checking Python style"
27-
if ! yapf --recursive --diff --style='{based_on_style: google, indent_width: 2}' -p datacommons/ datacommons_pandas/; then
30+
if ! pyrun yapf --recursive --diff --style='{based_on_style: google, indent_width: 2}' -p datacommons/ datacommons_pandas/; then
2831
echo "Fix lint errors by running: ./run_test.sh -f"
2932
exit 1
3033
fi
@@ -67,4 +70,4 @@ done
6770
if [ $OPTIND -eq 1 ]
6871
then
6972
help
70-
fi
73+
fi

0 commit comments

Comments
 (0)