This is a build tool designed to meet the needs of RobotPy's various wrapper libraries build needs, chiefly around:
robotpy-build is intended to be a generally useful build tool for any python project that has binary dependencies. If you find that isn't the case, please report a bug on github.
Requires Python 3.6+
Documentation can be found at https://robotpy-build.readthedocs.io/
Dustin Spicuzza is the primary author of robotpy-build, but it is the culmination of many years of experimentation with automated wrapper generation by members of the RobotPy community.
robotpy-build is available under the BSD 3-clause license.
Since each template instantiation is built in its own translation unit, being able to have different includes for each template instantiation would be beneficial.
InitSendable (see https://github.com/robotpy/robotpy-commands-v2/pull/22 for example) takes a non-copyable type as an argument. Since the smart-holder branch of pybind11 can invalidate objects, we might be able to automatically detect and fix this case at compile time. Would need some thought.
When headers are scanned, the types used in a template should be cached. This can be used automatically fill in the template_params in create-gen.
For example (ctre pro),
CoreTalonFX.hpp
has a function StatusSignalValue<units::angle::turn_t> &GetPosition();
From this, we know that StatusSignalValue
needs a units::angle::turn_t
template param.
Then, SignalStatusValue.hpp
has a function SignalMeasurement<T> GetDataCopy() const {...}
From this, we can propogate all of SignalStatusValue
's template_params including units::angle::turn_t
to SignalMeasurement
.
This would require all headers to be scanned before yaml files are written.
This doesn't fix what I'm working on but /shrug I wrote the code.
CTRE in particular has a lot of libraries, and right now each one needs its own subpackage. Would be nice if we could just put everything in a single directory. Lots of changes needed to make this doable however.
FWIW, numpy is now doing this sort of thing:
``site-packages/numpy.libs/`` (linux), or
``site-packages/numpy/.dylibs/`` (macOS), or
``site-packages/numpy/.libs/`` (windows).
robotpy pybind11 first-robotics-competition python