seqan3 icon indicating copy to clipboard operation
seqan3 copied to clipboard

[FEATURE] Add sharg-parser submodule and replace the seqan3::argument_parser.

Open smehringer opened this issue 3 years ago • 5 comments

Blocked by ~#2952~ #2970

This PR does a lot.

  • [x] it adds the sharg parser as submodule
  • [x] it fixes a test in format_parse_validator_test where enum foo needs an enumeration_names overload in order to work with validators and the argument parser. This was not enforced by the validator itself, but is enforced in sharg. Since you don't use validators without the argument_parser this can be considered a fix not an API break.
    • [ ] A note in the changelog should still be added I guess
  • [x] It replaces the help page tests in format_parse_validator_test by comparing the output with filter views instead of accessing the private member console_layout to set the terminal width, s.t. the output is comparable. The sharg::detail::help+format would otherwise need to befriend the seqan3 test accessor but this would add a dependency on seqan3.
  • [x] It deletes all detail files since they are not for the user and are not needed in seqan3
  • [x] It replaces all public seqan3 API by sharg API via using namespace sharg; declaration. The following exceptions had to be made:
    • [x] The argument_parser class will have differences to the sharg parser and thus must inherit from it.
    • [x] The input and output validators had I/O specific functionality that was removed in sharg and added again here to avoid breaking code for now. We can discuss if we want to deprecate them completely.
  • [x] The enumeration_names CPO can be satisfied by overloading seqan3::custom::argument_parsing. This must be done with the explicit, complete namespace instead of opening the namespace seqan3::custom{ ... }.
    • [ ] Adjust snippet or tutorial

Once everything compiles I will make separate commits for reviews

smehringer avatar Mar 27 '22 08:03 smehringer

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/seqan/seqan3/7akSVV74g9NzS31FN6ytVf37692e
✅ Preview: https://seqan3-git-fork-smehringer-sharg-seqan.vercel.app

[Deployment for 9daf967 failed]

vercel[bot] avatar Mar 27 '22 08:03 vercel[bot]

Codecov Report

Merging #2954 (bbeac7e) into master (d9294eb) will increase coverage by 0.38%. The diff coverage is 100.00%.

:exclamation: Current head bbeac7e differs from pull request most recent head e4a3969. Consider uploading reports for the commit e4a3969 to get more accurate results

@@            Coverage Diff             @@
##           master    #2954      +/-   ##
==========================================
+ Coverage   98.21%   98.59%   +0.38%     
==========================================
  Files         274      258      -16     
  Lines       12216    10336    -1880     
==========================================
- Hits        11998    10191    -1807     
+ Misses        218      145      -73     
Impacted Files Coverage Δ
include/seqan3/argument_parser/argument_parser.hpp 100.00% <100.00%> (+2.51%) :arrow_up:
include/seqan3/argument_parser/validators.hpp 100.00% <100.00%> (ø)
include/seqan3/core/debug_stream/variant.hpp 80.00% <0.00%> (-5.72%) :arrow_down:
...clude/seqan3/search/detail/search_configurator.hpp 93.33% <0.00%> (-3.64%) :arrow_down:
...an3/alignment/scoring/aminoacid_scoring_scheme.hpp 89.47% <0.00%> (-2.84%) :arrow_down:
include/seqan3/utility/views/single_pass_input.hpp 97.22% <0.00%> (-2.78%) :arrow_down:
include/seqan3/io/detail/in_file_iterator.hpp 94.28% <0.00%> (-2.69%) :arrow_down:
include/seqan3/io/views/detail/take_until_view.hpp 96.55% <0.00%> (-1.67%) :arrow_down:
include/seqan3/io/detail/misc_output.hpp 94.44% <0.00%> (-0.30%) :arrow_down:
include/seqan3/io/sam_file/detail/cigar.hpp 97.82% <0.00%> (-0.22%) :arrow_down:
... and 220 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d9294eb...e4a3969. Read the comment docs.

codecov[bot] avatar Mar 30 '22 10:03 codecov[bot]

We have to do either of both:

namespace seqan3::custom
{
// Specialise the seqan3::custom::argument_parsing data structure to enable parsing of std::errc.
template <>
struct sharg::custom::argument_parsing<std::errc>
{
    // ...
};

} // namespace seqan3::custom
namespace sharg::custom
{
// Specialise the sharg::custom::argument_parsing data structure to enable parsing of std::errc.
template <>
struct argument_parsing<std::errc>
{
    // ...
};

} // namespace sharg::custom

eseiler avatar Apr 01 '22 11:04 eseiler

// Specialise the seqan3::custom::argument_parsing data structure to enable parsing of std::errc.
template <>
struct seqan3::custom::argument_parsing<std::errc>
{
    // ...
};

works and should be promoted

smehringer avatar Apr 01 '22 19:04 smehringer

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
seqan3 ❌ Failed (Inspect) Jun 3, 2022 at 10:33AM (UTC)

vercel[bot] avatar Apr 28 '22 13:04 vercel[bot]

We will include sharg as a submodule, but not integrate it into seqan3 namespace

SGSSGene avatar Oct 18 '22 08:10 SGSSGene