File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
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
21
24
}
22
25
23
26
function run_py_test {
24
- setup_python
25
- python3 -m pytest -vv
27
+ setup_poetry
28
+ pyrun pytest -vv
26
29
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
28
31
echo " Fix lint errors by running: ./run_test.sh -f"
29
32
exit 1
30
33
fi
67
70
if [ $OPTIND -eq 1 ]
68
71
then
69
72
help
70
- fi
73
+ fi
You can’t perform that action at this time.
0 commit comments