DDMAL / MEI2Volpiano

An MEI to Volpiano converter for CWMN or Neume MEI files.
MIT License
0 stars 0 forks source link

Move away from argparse to python click testing CLI #18

Closed deepio closed 3 years ago

deepio commented 3 years ago

There's a convenient CliRunner functionality in python click to test CLI commands like you're trying to do here

https://github.com/DDMAL/MEI2Volpiano/blob/943e76337ee856d64de0bbe7aacd4215f0e04576/tests/test_mei2volpiano.py#L1680

So do something like this instead

from mei2volpiano import function_which_cli_runs
from click.testing import CliRunner

def test_cli_validator():
    """
    Test that the command line arguments work ____ ??
    """
    runner = CliRunner()
    result = runner.invoke(function_which_cli_runs, [test_file_path])
    assert result.exit_code == 0
napulen commented 3 years ago

@fujinaga might want to do the final call on this one (and future similar discussions).

I have been pushing our devs for "official-packages-only". My argument is that, in the long term, we don't know whether a third-party tool that is popular today will be so three years from now, and that we are always looking for long-term solutions, given that SIMSSA tools are intended to outlive the current maintainers' role in the lab. We don't know that about "official" packages either, but odds are that those will live longer.

This collides with @deepio's view of using the most appealing option at a given time. I have no opinion regarding learning click or argparse, but I do have an opinion about not inheriting dependencies to future devs that may well be abandoned in, say, 2 years from now.

It has happened before (e.g., migrating abandoned python2 libraries from 2014), and it could happen for today's popular tools too.

I think we should adopt one point of view, and that could be the policy of the lab about this. It's relevant not only to this particular library, but as a general development guideline of the lab.

deepio commented 3 years ago

While I agree many packages should be avoided for that exact reason, click is kind of an exception because they've been around for almost a decade and most the decorators haven't changed since version 1.x (now 8.x)

napulen commented 3 years ago

~6 years. Commit history seems healthy.

image

As I said, one can never know for sure. I guess I try to reduce the time spent thinking about all the future outcomes of a tool by just saying "go with the official ones".

Anyway. Any feedback from @fujinaga appreciated here. I'll stop bugging the devs about official tools after that.

As of now, I am still slightly inclined towards argparse.

fujinaga commented 3 years ago

In general, please avoid using third-party libraries unless you absolutely need the feature and you cannot write it yourself. Do not use one just because it makes your life easier. On the long run, it makes other people’s work a lot harder later.

Please ask the Scrum coaches (Martha, Tim, and Néstor) whether you can use an external library.

The most important thing about our software is maintainability. We’ve been affected so many times by people using “nice” libraries, which “everybody” is using. (We don’t even use jQuery!)

Some of the code we use (e.g., Gamera) are over 20 years old and one of the main reasons of their success is because they do not use any external libraries.

Thank you for your understanding.

On May 14, 2021, at 12:26, Néstor Nápoles López @.***> wrote:



~6 years. Commit history seems healthy.

[image]https://user-images.githubusercontent.com/7258463/118299769-27816500-b4af-11eb-8b88-0d31f89b1180.png

As I said, one can never know for sure. I guess I try to reduce the time spent thinking about all the future outcomes of a tool by just saying "go with the official ones".

Anyway. Any feedback from @fujinagahttps://github.com/fujinaga appreciated here. I'll stop bugging the devs about official tools after that.

As of now, I am still slightly inclined towards argparse.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/DDMAL/MEI2Volpiano/issues/18#issuecomment-841351485, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAH342PUJM5WGA3OF3AXYEDTNVFMXANCNFSM443XGTIA.

deepio commented 3 years ago

Gamera uses WX, pyplate, numpy, and others.