CMakePP / CMinx

Generates API documentation for CMake functions and macros
https://cmakepp.github.io/CMinx/
Apache License 2.0
14 stars 5 forks source link

Test Dependency Coverage #68

Closed ryanmrichard closed 2 years ago

ryanmrichard commented 2 years ago

Is your feature request related to a problem? Please describe. This was partially brought on by #64. The idea is we should actually figure out what versions of our dependencies will work and not just force a specific version (~= helps, but odds are that's still too restrictive). In practice, people are going to use us as part of a larger workflow and that workflow may have already installed some of our dependencies. By being as flexible as possible it makes us as user-friendly as possible.

Describe the solution you'd like My recommendation would be to only put our direct dependencies in the top-level requirements.txt. I know that includes Antlr, but does that include anything else, i.e. do all of the other dependencies in requirements.txt come from Antlr and/or can they be removed?

We then only have to figure ranges for the direct dependencies, which AFAIK are:

I vote we only focus on dependencies needed to build CMinx, and ignore say dependencies needed for unit testing and generating CMinx's documentation (the documentation for how to use CMinx, not the documentation generated by CMinx).

The CI should be updated to test the resulting set. If that's too many combinations, we'll have to spot check. We can revisit the best way to do the CI once we know the ranges to test.

Describe alternatives you've considered We tried hard freezing, and ~=, but that's still too restrictive.

AutonomicPerfectionist commented 2 years ago

@ryanmrichard Sphinx is also required to enable adding the docs Make target (via cminx_add_docs_target() in the CMake API), that's where the majority of the dependencies are coming from. We could pull that out of the explicit dependencies and instead install it when running that target, but that would introduce a secondary place to store needed version information.

ryanmrichard commented 2 years ago

@AutonomicPerfectionist if it's only used in the CMake API I'd recommend moving it into the CMake infrastructure. As a first pass we can just do something like:

set(cmaize_sphinx_min_version 4.5.0)
set(cmaize_requirements_file ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt)
#whatever the command is to read contents of ${cmaize_requirements_file} into variable cmaize_requirements_file_contents
set(cmaize_requirements_file_contents "${cmaize_requirements_file_contents}\nsphinx~=${cmaize_sphinx_min_version}")
#write contents to ${CMAKE_BINARY_DIR}/cmaize_requirements.txt install from that
ryanmrichard commented 2 years ago

Actually, I think it's better to drop the cminx_add_docs_target command and just add something to the documentation about how to make that target (it's more or less a one-liner).