refactor: Don't expose Tox_System in the public API#2741
Conversation
208d3e7 to
331381d
Compare
It makes no sense to include it in the public API as clients can't make any meaningful use of it via public API, it can only be used if one also includes other internal/private headers that we don't install. It's used only in the testing code, which has access to the internal headers. Fixes #2739, at least to some degree. I decided against moving things to a separate `tox_testing.h` and leaving only things in `tox_private.h` that we are fine with clients using, as otherwise `tox_lock()` / `tox_unlock()` would have to be moved out of `tox_private.h` to somewhere else, but `tox_private.h` actually sounds like the right place for them, naming-wise. So perhaps it's fine if we have things in `tox_private.h` that we don't want clients to use.
|
Not sure if this should be marked as API break since we haven't made a release with |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2741 +/- ##
==========================================
+ Coverage 73.04% 73.09% +0.05%
==========================================
Files 149 149
Lines 30516 30533 +17
==========================================
+ Hits 22290 22319 +29
+ Misses 8226 8214 -12 ☔ View full report in Codecov by Sentry. |
This is not exactly true, system is supposed to be publicly/privately accessible. |
|
@Green-Sky I'm just stating the fact that it is currently used only in the testing code. I did a grep for "tox_options_set_operating_system" and that's the only code that used that function. (If you search for Also, see #2739 (comment) - there is no way for any external code to use It would indeed be nice for clients to be able to provide their own |
Yea that's bad, I had to include
Fine. |
It makes no sense to include it in the public API as clients can't make any meaningful use of it via public API, it can only be used if one also includes other internal/private headers that we don't install.
It's used only in the testing code, which has access to the internal headers.
Fixes #2739, at least to some degree. I decided against moving things to a separate
tox_testing.hand leaving only things intox_private.hthat we are fine with clients using, as otherwisetox_lock()/tox_unlock()would have to be moved out oftox_private.hto somewhere else, buttox_private.hactually sounds like the right place for them, naming-wise. So perhaps it's fine if we have things intox_private.hthat we don't want clients to use.This change is