Skip to content

Conversation

@masaori335
Copy link
Contributor

@masaori335 masaori335 commented Feb 4, 2020

Fix #6386

Ran below command

find . -name "*.py" | xargs sed -i '' s/"python "/"python3 "/g

Ran below command
```
find . -name "*.py" | xargs sed -i '' s/"python "/"python3 "/g
```
@masaori335 masaori335 added this to the 10.0.0 milestone Feb 4, 2020
@masaori335 masaori335 self-assigned this Feb 4, 2020
@masaori335 masaori335 changed the title Replace python with python3 Replace python with python3 in AuTest Feb 4, 2020
@a-canary a-canary requested a review from dragon512 February 4, 2020 17:11
@ywkaras
Copy link
Contributor

ywkaras commented Feb 4, 2020

Maybe we should add this to the beginning of autest.sh?

if [[ $(which python) != "" ]]; then
  if [[ $(python --version) != Python?3*  ]]; then
    echo "Must use Python version 3 only" >&2
    exit 1
  fi
fi

@masaori335
Copy link
Contributor Author

@ywkaras IIUC, test-env-check.sh is checking the version & requires 3.5+.

@masaori335
Copy link
Contributor Author

I'm going to change to use sys.executable instead of python or python3 as @dragon512 recommended on slack.

@masaori335 masaori335 added the WIP label Feb 6, 2020
@ywkaras
Copy link
Contributor

ywkaras commented Feb 6, 2020

What I'm suggesting is different, that the Au test framework require that the python command run python version 3.x.

Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like consistency. I think @ywkaras suggestion can be added in another PR, but this looks necessary anyways.

@bryancall bryancall merged commit 6babe49 into apache:master Feb 19, 2020
@masaori335 masaori335 removed the WIP label Feb 19, 2020
@zwoop
Copy link
Contributor

zwoop commented Feb 27, 2020

Cherry-picked to v9.0.x branch.

@zwoop
Copy link
Contributor

zwoop commented Feb 27, 2020

Fwiw, I think a better approach would be to 1) enforce python3 by autest (as suggested above) and 2) make sure that any subsequent invocations of python to exec() the same python, which then properly enforces the same python version.

@zwoop zwoop modified the milestones: 10.0.0, 9.0.0 Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistency use of python command in AuTest

5 participants