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

Switch to python 3 #583

Merged
merged 3 commits into from
Feb 8, 2019
Merged

Switch to python 3 #583

merged 3 commits into from
Feb 8, 2019

Conversation

basicNew
Copy link

@basicNew basicNew commented Feb 7, 2019

This requires latest Drake, so goes hand-in-hand with maliput/delphyne_gui#179

Steps to migrate:

  • Use delphyne's gui PR to bring latest Drake.
  • Change a bit the way we prepare to build drake (note the last script):
mkdir -p delphyne_ws/src
cd delphyne_ws
# Bootstrap the workspace
sudo apt install git
git clone git@github.com:ToyotaResearchInstitute/delphyne-gui.git src/delphyne_gui
# Install a few tools to setup the rest of the workspace
sudo ./src/delphyne_gui/tools/install_prereqs.sh
# Clone the remaining source repositories into the workspace
vcs import src < src/delphyne_gui/delphyne.repos
# Additionally retrieve drake system dependencies
sudo ./src/drake/setup/ubuntu/18.04/install_prereqs.sh
# Setup platform
./src/drake/setup/ubuntu/source_distribution/install_prereqs_user_environment.sh
  • Change a bit the way we build drake (note the --config=python3 flag):
cd delphyne_ws
# Drake
pushd src/drake
bazel run --config=python3 //:install `pwd`/../../install
popd
  • Make sure your $PYTHONPATH points to a 3.6 install and not a 2.7

All the demos should run and the tests should pass.

@clalancette @hidmic haven't yet checked on CI, wanted to push this as soon as I got it so you could confirm this is working locally too

@clalancette
Copy link
Contributor

I tried this out, and it worked! I ended up having two problems:

  1. I had to completely remove delphyne_ws/install and build/delphyne for it to build properly.
  2. I had to update delphyne_gui/setup.bash to point to the python3 stuff.

Otherwise, I ran all of the demos and they all seemed to work pretty well. This is awesome @basicNew !

@basicNew
Copy link
Author

basicNew commented Feb 7, 2019

@clalancette thanks for checking this so quickly! Indeed, I forgot to mention I nuked build and install before this, sorry about that. And thanks for pointing out about delphyne_gui/setup.bash, I'll update the PR to include that.

@basicNew basicNew force-pushed the SwitchToPython3 branch 2 times, most recently from 3bf330b to 1d0a8db Compare February 7, 2019 21:40
@basicNew
Copy link
Author

basicNew commented Feb 8, 2019

Alright, CI is passing! @hidmic would you mind testing this one (check @clalancette 's comments)? If everything goes ok I think we could merge this one.

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I left a couple of small nits in the code that is here.

However, I think we need to change a bit more of the CI code. In particular I think we need to remove https://github.com/ToyotaResearchInstitute/delphyne-gui/blob/master/tools/install_prereqs.sh#L43, change https://github.com/ToyotaResearchInstitute/delphyne-gui/blob/master/tools/install_prereqs.sh#L80 to python3, etc. Also, I'm surprised that we didn't have to change the name of the tarball that we fetch: https://github.com/ToyotaResearchInstitute/delphyne/blob/master/tools/continuous_integration/jenkins/build#L20 ; is python3 bindings automatically included in the "default" nightly tarballs now?

@@ -62,12 +62,14 @@ def launch(self, command, label=None, cwd=None, environ=None):
stdin=self.devnull,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't feel strongly about adding this, but I'm surprised you needed it, given that we only support Linux at the moment.

Copy link
Author

Choose a reason for hiding this comment

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

yup, I was surprised require this too, but otherwise the characters used from ignition logging (spaces and colors) were all escaped and output was a mess.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Good reason to use it then; I'll just suggest that you put a comment in there saying that we need it for that reason.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comments added!

@@ -38,7 +38,7 @@ libignition-cmake-dev
mercurial
pkg-config
pycodestyle
pylint
pylint3
python-pip
Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that you didn't have to change this to python3-pip suggests that we don't actually need pip anymore; I'd suggest removing this.

Copy link
Author

Choose a reason for hiding this comment

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

+1, I'll take a shot at it

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

Working fine on my end, LGTM pending @clalancette comments' resolution!

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor

hidmic commented Feb 8, 2019

@clalancette

In particular I think we need to remove...

Done!

Also, I'm surprised that we didn't have to change the name of the tarball that we fetch

AFAIK nightly include python3 support, see relevant comment here.

@hidmic
Copy link
Contributor

hidmic commented Feb 8, 2019

Let's see what CI has to say.

@hidmic
Copy link
Contributor

hidmic commented Feb 8, 2019

@clalancette @basicNew looks like CI is happy :)

@hidmic hidmic changed the title [Do not merge] Switch to python 3 Switch to python 3 Feb 8, 2019
@hidmic hidmic merged commit 78e5656 into master Feb 8, 2019
@clalancette clalancette deleted the SwitchToPython3 branch February 9, 2019 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants