Skip to content

Commit a0ed208

Browse files
committed
Release 3.1.5.
2 parents ea58ec4 + d2c4bbc commit a0ed208

File tree

10 files changed

+51
-58
lines changed

10 files changed

+51
-58
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ build-wheel:
1717
tags:
1818
- docker
1919
image: python:3.8
20-
variables:
21-
LIBQI_REPOSITORY_URL: "https://gitlab-ci-token:$CI_JOB_TOKEN@$CI_SERVER_HOST/qi/libqi"
2220
script:
2321
- curl -sSL https://get.docker.com/ | sh
2422
- pip install cibuildwheel==2.14.1

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ if(BUILD_TESTING)
297297
include(GoogleTest)
298298

299299
find_package(qimodule REQUIRED)
300-
qi_create_module(moduletest NO_INSTALL)
300+
qi_add_module(moduletest)
301301
target_sources(
302302
moduletest
303303
PRIVATE

ci/cibuildwheel_linux_before_all.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ pip install 'conan>=2' 'cmake>=3.23' ninja
99
yum install -y perl-IPC-Cmd perl-Digest-SHA
1010

1111
# Install Conan configuration.
12+
conan profile detect
1213
conan config install "$PACKAGE/ci/conan"
1314

1415
# Clone and export libqi to Conan cache.
15-
QI_VERSION=$(sed -nE '/^\s*requires\s*=/,/^\s*]/{ s/\s*"qi\/([^"]+)".*/\1/p }' "$PACKAGE/conanfile.py")
16-
1716
GIT_SSL_NO_VERIFY=true \
18-
git clone --depth=1 \
19-
--branch "qi-framework-v${QI_VERSION}" \
20-
"$LIBQI_REPOSITORY_URL" \
17+
git clone \
18+
--branch master \
19+
https://github.com/aldebaran/libqi.git \
2120
/work/libqi
22-
conan export /work/libqi --version="${QI_VERSION}"
21+
conan export /work/libqi
2322

2423
# Install dependencies of libqi-python from Conan, including libqi.
2524
#
2625
# Build everything from sources, so that we do not reuse precompiled binaries.
2726
# This is because the GLIBC from the manylinux images are often older than the
2827
# ones that were used to build the precompiled binaries, which means the binaries
2928
# cannot by executed.
30-
conan install "$PACKAGE" --build="*"
29+
conan install "$PACKAGE" --build="*" --profile:all default --profile:all cppstd17

ci/conan/global.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
core:default_profile=default
2-
core:default_build_profile=default
31
tools.build:skip_test=true
42
tools.cmake.cmaketoolchain:generator=Ninja
53
# Only use the build_type as a variable for the build folder name, so

ci/conan/profiles/cppstd17

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
compiler.cppstd=gnu17

ci/conan/profiles/default

Lines changed: 0 additions & 8 deletions
This file was deleted.

conanfile.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@
5252
"system",
5353
]
5454

55+
5556
class QiPythonConan(ConanFile):
5657
requires = [
57-
"boost/[~1.78]",
58-
"pybind11/[^2.9]",
59-
"qi/4.0.2",
58+
"boost/[~1.83]",
59+
"pybind11/[^2.11]",
60+
"qi/[~4]",
6061
]
6162

6263
test_requires = [
@@ -77,9 +78,9 @@ class QiPythonConan(ConanFile):
7778
# Disable every components of Boost unless we actively use them.
7879
default_options.update(
7980
{
80-
f"boost/*:without_{_name}": False
81-
if _name in USED_BOOST_COMPONENTS
82-
else True
81+
f"boost/*:without_{_name}": (
82+
False if _name in USED_BOOST_COMPONENTS else True
83+
)
8384
for _name in BOOST_COMPONENTS
8485
}
8586
)

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "scikit_build_core.build"
77
[project]
88
name = "qi"
99
description = "LibQi Python bindings"
10-
version = "3.1.4"
10+
version = "3.1.5"
1111
readme = "README.rst"
1212
requires-python = ">=3.7"
1313
license = { "file" = "COPYING" }
@@ -60,10 +60,7 @@ BUILD_TESTING = "OFF"
6060
build = "cp*manylinux*x86_64"
6161
build-frontend = "build"
6262

63-
environment-pass = ["LIBQI_REPOSITORY_URL"]
64-
6563
[tool.cibuildwheel.linux]
66-
manylinux-x86_64-image = "manylinux2014"
6764
before-all = ["ci/cibuildwheel_linux_before_all.sh {package}"]
6865

6966
[tool.cibuildwheel.linux.config-settings]

src/pytypes.cpp

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -595,20 +595,13 @@ class ListInterface : public ObjectInterfaceBase<Storage, qi::ListTypeInterface>
595595

596596
using DefaultImpl = DefaultTypeImplMethods<Iterator, TypeByPointerPOD<Iterator>>;
597597

598-
void* initializeStorage(void* ptr = nullptr) override
599-
{
600-
return DefaultImpl::initializeStorage(ptr);
601-
}
602-
598+
void* initializeStorage(void* ptr = nullptr) override { return DefaultImpl::initializeStorage(ptr); }
603599
void* clone(void* storage) override { return DefaultImpl::clone(storage); }
604-
void destroy(void* storage) override
605-
{
606-
destroyDisownedReferences(storage);
607-
return DefaultImpl::destroy(storage);
608-
}
600+
void destroy(void* storage) override { return DefaultImpl::destroy(storage); }
609601
const TypeInfo& info() override { return DefaultImpl::info(); }
610602
void* ptrFromStorage(void** s) override { return DefaultImpl::ptrFromStorage(s); }
611603
bool less(void* a, void* b) override { return DefaultImpl::less(a, b); }
604+
612605
Iterator* asIterPtr(void** storage) { return static_cast<Iterator*>(ptrFromStorage(storage)); }
613606
Iterator& asIter(void** storage) { return *asIterPtr(storage); }
614607
};
@@ -680,34 +673,27 @@ class DictInterface: public ObjectInterfaceBase<Storage, qi::MapTypeInterface>
680673
std::advance(it, index);
681674
const auto key = ::py::reinterpret_borrow<::py::object>(it->first);
682675
const auto element = ::py::reinterpret_borrow<::py::object>(it->second);
683-
const auto keyElementPair = std::make_pair(key, element);
684-
auto ref = AnyReference::from(keyElementPair).clone();
676+
auto keyRef = AnyReference::from(key);
677+
auto elementRef = AnyReference::from(element);
678+
auto pairRef = makeGenericTuple({keyRef, elementRef});
685679
// Store the disowned reference with the list as a context instead of the
686680
// iterator because the reference might outlive the iterator.
687-
storeDisownedReference(dictStorage, ref);
688-
return ref;
681+
storeDisownedReference(dictStorage, pairRef);
682+
return pairRef;
689683
}
690684

691685
void next(void** storage) override { ++asIter(storage).second; }
692686
bool equals(void* s1, void* s2) override { return asIter(&s1) == asIter(&s2); }
693687

694688
using DefaultImpl = DefaultTypeImplMethods<Iterator, TypeByPointerPOD<Iterator>>;
695689

696-
void* initializeStorage(void* ptr = nullptr) override
697-
{
698-
return DefaultImpl::initializeStorage(ptr);
699-
}
700-
690+
void* initializeStorage(void* ptr = nullptr) override { return DefaultImpl::initializeStorage(ptr); }
701691
void* clone(void* storage) override { return DefaultImpl::clone(storage); }
702-
void destroy(void* storage) override
703-
{
704-
destroyDisownedReferences(storage);
705-
return DefaultImpl::destroy(storage);
706-
}
707-
692+
void destroy(void* storage) override { return DefaultImpl::destroy(storage); }
708693
const TypeInfo& info() override { return DefaultImpl::info(); }
709694
void* ptrFromStorage(void** s) override { return DefaultImpl::ptrFromStorage(s); }
710695
bool less(void* a, void* b) override { return DefaultImpl::less(a, b); }
696+
711697
Iterator* asIterPtr(void** storage) { return static_cast<Iterator*>(ptrFromStorage(storage)); }
712698
Iterator& asIter(void** storage) { return *asIterPtr(storage); }
713699
};

tests/test_types.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,40 @@ TEST_F(TypePassing, Recursive)
387387
}
388388
}
389389

390+
TEST_F(TypePassing, ReverseList)
391+
{
392+
exec(
393+
"class TestService:\n"
394+
" def func(self, list):\n"
395+
// Test the iterator interface.
396+
" for value in list:\n"
397+
" assert(isinstance(value, str))\n"
398+
" assert(list == ['hello', 'world'])\n"
399+
);
400+
registerService();
401+
const std::vector<const char*> list {"hello", "world"};
402+
getService().call<void>("func", list);
403+
}
404+
405+
390406
TEST_F(TypePassing, ReverseDict)
391407
{
392408
exec(
393409
"class TestService:\n"
394410
" def func(self, dict):\n"
395-
" return dict == {'one' : 1, 'two' : 2, 'three' : 3}\n"
411+
// Test the iterator interface.
412+
" for key, value in dict.items():\n"
413+
" assert(isinstance(key, str))\n"
414+
" assert(isinstance(value, int))\n"
415+
" assert(dict == {'one' : 1, 'two' : 2, 'three' : 3})\n"
396416
);
397417
registerService();
398-
const std::map<std::string, int> expected {
418+
const std::map<std::string, int> dict {
399419
{"one", 1},
400420
{"two", 2},
401421
{"three", 3},
402422
};
403-
EXPECT_TRUE(getService().call<bool>("func", expected));
423+
getService().call<void>("func", dict);
404424
}
405425

406426
TEST_F(TypePassing, LogLevel)

0 commit comments

Comments
 (0)