-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make MSNoise a real Python Package #21
Comments
to run MSNoise, my current idea is either to execute steps like this (1.1) $ python -m msnoise --step 1 or create a msnoise in Python/Scripts and (2) $ msnoise --step 1 any suggestions ? I remember reading some comment advocating for the first solution (written by someone fed up with the /scripts folder being super full)... But with the first (1.1) solution, it's not really easy to pass arguments to |
The first version is nice for commands that are rarely called by users (e.g. tests, benchmarks, ...). MSNoise on the other hand really focuses on actually using these commands so it is completely justified in my opinion to have a central Then you can design a git like interface (main command followed by the subcommand followed by the arguments), e.g. $ msnoise scan_archive .
$ msnoise do_other_stuff --who=me /path/to/stuff That is what I did here: http://lasif.net/cli.html (the documentation is actually autogenerated from the code with the help of a custom sphinx directive). My favorite part turned out to be the testing. A custom pytest fixture (https://github.com/krischer/LASIF/blob/5ad0ff11abe7703c3a9ae4507374389dee4e194f/lasif/tests/testing_helpers.py#L69-106) is used to make it really easy and clean to test the command line interface, e.g. https://github.com/krischer/LASIF/blob/5ad0ff11abe7703c3a9ae4507374389dee4e194f/lasif/tests/test_cli_interface.py#L108-L115 I coded the command dispatching and all the other stuff by hand: It is fairly straightforward to implement some nice features like fuzzy subcommand matching and pretty help messages. But nowadays I would just use something like this: http://click.pocoo.org |
Mmmm Thanks ! That sound reallllly cool : http://click.pocoo.org/3/quickstart/#nesting-commands |
Ok, so far so good, using Click
Cooooool :-) |
almost done :-) |
f945ba2 marks the first big (read -HUGE-) step toward packaging MSNoise ! |
I think this can be considered done... |
I don't think this is really done TBH. For example the dependencies are not specified in the |
aaah that... is correct :-) |
and at some point, when that looks ready, learn how to make a PyPi upload... :s |
I think it's OK... |
MSNoise should be importable like any other python package : installable using package managers, pip, easy_install, eggs or whatever.
This requires:
keep_all
is TrueThis will allow MSNoise to be installed by sysadmins, and used by users, with no output placed in the folder of the package.
The text was updated successfully, but these errors were encountered: