File tree Expand file tree Collapse file tree 3 files changed +9
-28
lines changed Expand file tree Collapse file tree 3 files changed +9
-28
lines changed Original file line number Diff line number Diff line change @@ -181,18 +181,18 @@ jobs:
181
181
- name : run tests under valgrind
182
182
run : PYTHONMALLOC=malloc valgrind python3 -m unittest discover -v -s tests/
183
183
184
- ubuntu2004_clang9 :
185
- name : " Ubuntu 20.04 with Clang 9 "
184
+ ubuntu2004_clang8 :
185
+ name : " Ubuntu 20.04 with Clang 8 "
186
186
runs-on : ubuntu-20.04
187
187
if : " !contains(github.event.head_commit.message, '[skip ci]')"
188
188
env :
189
- CC : clang-9
190
- CXX : clang++-9
189
+ CC : clang-8
190
+ CXX : clang++-8
191
191
SKBUILD_CMAKE_ARGS : " -DCMAKE_CXX_STANDARD=11;-DEXTRA_WARNINGS=ON;-DSTANDALONE_PYTHON_MODULE=OFF"
192
192
SKBUILD_CMAKE_TARGETS : " all;check"
193
193
steps :
194
194
- uses : actions/checkout@v4
195
- - run : sudo apt-get install clang-9 libz-dev python3-pip python3-numpy
195
+ - run : sudo apt-get install clang-8 libz-dev python3-pip python3-numpy
196
196
- name : install nanobind
197
197
run : |
198
198
sudo /usr/bin/python3 -m pip install nanobind build
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
2
requires = [
3
3
" scikit-build-core ~=0.10.7" ,
4
- " nanobind >=2.1 " ,
4
+ " nanobind >=2.2 " ,
5
5
" typing-extensions >=4.0; python_version < '3.11'"
6
6
]
7
7
build-backend = " scikit_build_core.build"
Original file line number Diff line number Diff line change
1
+ #include < nanobind/stl/detail/nb_optional.h>
1
2
2
3
namespace gemmi {
3
4
std::ostream& operator << (std::ostream& os, const Entity& ent);
4
5
}
5
6
6
7
namespace nanobind { namespace detail {
7
- template <> struct type_caster <gemmi::SeqId::OptionalNum> {
8
- NB_TYPE_CASTER (gemmi::SeqId::OptionalNum, optional_name(const_name(" int" )))
9
- using Caster = make_caster<int >;
10
-
11
- bool from_python (handle src, uint8_t flags, cleanup_list* cleanup) noexcept {
12
- if (src.is_none ()) {
13
- value = Value ();
14
- return true ;
15
- }
16
- Caster caster;
17
- if (!caster.from_python (src, flags_for_local_caster<int >(flags), cleanup))
18
- return false ;
19
- value = caster.operator cast_t <int >();
20
- return true ;
21
- }
22
-
23
- static handle from_cpp (Value value, rv_policy policy, cleanup_list *cleanup) noexcept {
24
- if (!value)
25
- return none ().release ();
26
- return Caster::from_cpp (*value, policy, cleanup);
27
- }
28
- };
8
+ template <> struct type_caster <gemmi::SeqId::OptionalNum>
9
+ : optional_caster<gemmi::SeqId::OptionalNum> {};
29
10
}} // namespace nanobind::detail
30
11
31
12
NB_MAKE_OPAQUE (std::vector<gemmi::Helix>)
You can’t perform that action at this time.
0 commit comments