-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
support python test without installation python package #3357
Conversation
cmake/generic.cmake
Outdated
@@ -411,7 +411,7 @@ function(py_test TARGET_NAME) | |||
set(multiValueArgs SRCS DEPS) | |||
cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | |||
add_test(NAME ${TARGET_NAME} | |||
COMMAND env PYTHONPATH=${PADDLE_PYTHON_PACKAGE_DIR} | |||
COMMAND env PYTHONPATH=${PADDLE_PYTHON_LIB_DIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test swig wrapper unit test??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I have run all the python test and I don't think that copy all the generated files to python src dir is a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please pip uninstall paddlepaddle
before you test this PR.
test 91
Start 91: testGradientMachine
91: Test command: /usr/bin/env "PYTHONPATH=" "python2" "testGradientMachine.py"
91: Test timeout computed to be: 9.99988e+06
91: Traceback (most recent call last):
91: File "testGradientMachine.py", line 15, in <module>
91: from py_paddle import swig_paddle
91: ImportError: No module named py_paddle
1/1 Test #91: testGradientMachine ..............***Failed 0.03 sec
0% tests passed, 1 tests failed out of 1
test 90
Start 90: testArguments
90: Test command: /usr/bin/env "PYTHONPATH=" "python2" "testArguments.py"
90: Test timeout computed to be: 9.99988e+06
90: Traceback (most recent call last):
90: File "testArguments.py", line 15, in <module>
90: from py_paddle import swig_paddle
90: ImportError: No module named py_paddle
1/1 Test #90: testArguments ....................***Failed 0.03 sec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy
Python proto into paddle/v2/framework/proto
is necessary. because we import proto like import paddle.v2.framework.proto
in our code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @jacquesqiao and @gangliao for this PR and #3360!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix #3352
after
make
, can useto run python unit test is build dir without install the python package.
tested on all python unit test.