-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
Ensure that DevEncoded (aka bytearray) commands work the same as the attributes.
ext/server/command.cpp
Outdated
#if PY_MAJOR_VERSION >= 3 | ||
boost::python::object encoded_data( | ||
boost::python::handle<>( | ||
PyMemoryView_FromMemory( |
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 for working on this.
- As mentioned in the issue thread, we have similar code in
to_py.h
, so I wonder about the difference. - Second point: that code doesn't do a Python 3 check, so wonder if we need it here?
Lines 20 to 31 in 19e4c5d
struct DevEncoded_to_tuple | |
{ | |
static inline PyObject* convert(Tango::DevEncoded const& a) | |
{ | |
boost::python::str encoded_format(a.encoded_format); | |
bopy::object encoded_data = bopy::object( | |
bopy::handle<>(PyBytes_FromStringAndSize( | |
(const char*)a.encoded_data.get_buffer(), | |
(Py_ssize_t)a.encoded_data.length()))); | |
boost::python::object result = boost::python::make_tuple(encoded_format, encoded_data); | |
return boost::python::incref(result.ptr()); | |
} |
@ajoubertza The latest pipeline was set to build with tango 9.2.5a in
which let me think that the CI either used a cached build of pytango to run the tests (scarry) or that the build and test environments are different. Any clue? |
Yes, the builds do use caching, so as not to rebuild the tango wrapper extension unnecessarily. The build looks at the source files, but I guess it doesn't know if the conda environment changed. You could try modifying the Do you really want to test against 9.2.5a? |
- No need to differentiate between Python versions. - Changed namespace from `bopy` -> `boost::python` for consistency with surrounding code. Also restore travis tests to use TANGO 9.3.2
@sdebionne I tried your changes in my environment (Docker container), with TANGO 9.3.2alpha.1 conda package. They worked fine. Even after changes in c131db3, the extension was not recompiled by Travis. However, I see an option to delete the cache on Travis today (didn't see it yesterday). I deleted the cache for this PR but that didn't help either! Finally read the Travis docs. Interestingly, if the PR branch doesn't have a cache yet, it takes one from the default branch. I notice a bug in the |
The `ext` directory has multiple levels, so we need to check all of them for changes.
That worked. Tests passing at last. |
I had a day off yesterday. Glad to hear that travis config was buggy and fixed!
Nope, it was more a desperate attempt to understand what was wrong with the pipeline and limit the differences between my local build env and the CI. Thanks for reverting this. Everyting LGTM! |
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
Work in progress.
Fixes: issue #280