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

fix Python version handling for interactive tests #806

Conversation

mattyjams
Copy link
Contributor

This should address the issue raised in #805. Since the interactive tests launch the maya binary rather than mayapy or mayapy2, they were always running using Python 3 in Maya 2021/preview releases.

In addition to setting MAYA_PY_EXECUTABLE to either mayapy or mayapy2 in FindMaya.cmake, we now also set MAYA_PY_VERSION to either 2 or 3 as appropriate. We then use that CMake variable to set MAYA_PYTHON_VERSION when setting up the environment for running the tests. Maya 2020 and earlier will simply ignore that environment variable.

I've verified that the interactive tests pass running Maya PR 119 and Python 2 on Linux. I'm not actually setup to build against Python 3 yet, so if someone is able to verify that configuration for me, that would be great. These tests get skipped by the preflight builds, so any issues likely would not show up there.

This ensures that the Python version is set appropriately in the case of tests
such as the interactive ones that run the 'maya' executable directly rather
than invoking 'mayapy' or 'mayapy2'.
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@kxl-adsk kxl-adsk added the unit test Related to unit tests (both python or c++) label Sep 30, 2020
@kxl-adsk kxl-adsk merged commit f94bcfa into Autodesk:dev Sep 30, 2020
@mattyjams mattyjams deleted the pr/fix_Python_version_handling_for_interactive_tests branch September 30, 2020 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants