stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.83k stars 383 forks source link

bindings: allow use of `pathlib.Path | str` for paths #2431

Closed nim65s closed 5 days ago

nim65s commented 2 weeks ago

Hi,

This update the python bindings to allow passing filenames through pathlib objects, without breaking compatibility with the previous way of passing filenames through bare str.

It also modernize python code by adding the PTH ruff check and update os.path code with pathlib.

nim65s commented 2 weeks ago

windows CI still failing with unrelated:

C:\Miniconda\envs\pinocchio\Library\include\cppad/cg/cg.hpp(200): error C2063: 'CppAD::cg::operator *': not a function
C:\Miniconda\envs\pinocchio\Library\include\cppad/cg/base_double.hpp(27): note: see reference to class template instantiation 'CppAD::cg::CG<double>' being compiled
C:\Miniconda\envs\pinocchio\Library\include\cppad/cg/cg.hpp(217): error C2143: syntax error: missing ';' before '<'
C:\Miniconda\envs\pinocchio\Library\include\cppad/cg/cg.hpp(217): error C2433: 'CppAD::cg::NearEqual': 'friend' not permitted on data declarations
C:\Miniconda\envs\pinocchio\Library\include\cppad/cg/cg.hpp(217): error C2365: 'CppAD::cg::NearEqual': redefinition; previous definition was 'function'
jorisv commented 1 week ago

build_all label is adding -DBUILD_WITH_CODEGEN_SUPPORT=ON on Windows but this option is not allowed on this OS.

We will fix this.