capi: add pathrs_version API#375
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
26a455f to
419eded
Compare
3591b13 to
e5b416f
Compare
This is a partial revert of 797b29e. For some reason CI doesn't like this, but my local mypy really needs this ignore line, otherwise you get annoying errors like: $ make -C ./contrib/bindings/python lint pathrs/_internal.py:96: error: Non-overlapping equality check (left operand type: "CError", right operand type: "CType") [comparison-overlap] Fixes: 797b29e ("mypy: fix new errors") Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This is loosely based on the copy_struct_to_user() helper and mostly mirrors the existing copy_from_extensible_struct port. This is going to be needed for the version API as well as potentially some other future APIs. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This API is extensible, which will allow us to add additional information in the future (such as API levels or feature bitflags). Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This is mostly trivial, except for the Rust test binary -- because pathrs-cmd is not part of the pathrs crate, there appears to be no straightforward way of getting the version of a dependency via build scripts. (The only communication channel via DEP_* is a links-only feature and probably is bad to use for other reasons.) So, add a #[doc(hidden)] static constant that includes the crate version for this purpose. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This API is extensible, which will allow us to add additional
information in the future (such as API levels or feature bitflags).
Closes #370
Signed-off-by: Aleksa Sarai aleksa@amutable.com