clan-cli: dev-shell, build, tab completion, formatting, linting, unit tests #11

Merged
Mic92 merged 11 commits from cli into main 2023-07-21 09:26:57 +00:00
Owner
  • updates the clan-cli to use #10 to get a proper dev environment + some useful commands + checks.
  • set up tab completion for bash, zsh, fish for the clan cli package as well as the python dev shell
  • adds flake output checks.clan
  • adds flake output packages.clan
  • add some unit tests
  • move clan-admin.py -> clan_admin.py so it can be loaded as a module
  • compose python sub commands via argparse subparsers instead of Popen

@lassulus For now I broke your design idea of implementing sub commands via Popen, not because I'm against it, but simply because this made it simpler to set up a proper python project with dev shell and tests. Also I'm not sure if the tab completion would integrate as nicely otherwise.
We could add this mechanism back as soon as we actually have a non-python implementation of some command. Would that be ok with you?

- updates the clan-cli to use https://git.clan.lol/clan/clan-core/pulls/10 to get a proper dev environment + some useful commands + checks. - set up tab completion for bash, zsh, fish for the clan cli package as well as the python dev shell - adds flake output `checks.clan` - adds flake output `packages.clan` - add some unit tests - move `clan-admin.py` -> `clan_admin.py` so it can be loaded as a module - compose python sub commands via argparse subparsers instead of Popen @lassulus For now I broke your design idea of implementing sub commands via Popen, not because I'm against it, but simply because this made it simpler to set up a proper python project with dev shell and tests. Also I'm not sure if the tab completion would integrate as nicely otherwise. We could add this mechanism back as soon as we actually have a non-python implementation of some command. Would that be ok with you?
DavHau requested review from Mic92 2023-07-21 00:29:35 +00:00
DavHau requested review from lassulus 2023-07-21 00:29:35 +00:00
Mic92 reviewed 2023-07-21 05:09:22 +00:00
@ -0,0 +3,4 @@
import clan_admin
def test_make_parser():
Owner

I would also add typing to tests because than refactoring becomes easier.

I would also add typing to tests because than refactoring becomes easier.
Mic92 reviewed 2023-07-21 08:04:36 +00:00
@ -0,0 +19,4 @@
)
def edit(args: argparse.Namespace) -> None: # pragma: no cover
Owner

Is no cover for pytest-coverage?

Is `no cover` for pytest-coverage?
Author
Owner

Yes, currently it's set to require 100% coverage. You can then exclude functions from the coverage report via this comment. I thought, requiring tests for newly added functions is a better default than not requiring them.

Yes, currently it's set to require 100% coverage. You can then exclude functions from the coverage report via this comment. I thought, requiring tests for newly added functions is a better default than not requiring them.
Mic92 reviewed 2023-07-21 08:05:33 +00:00
@ -0,0 +15,4 @@
"init",
"-t",
"git+https://git.clan.lol/clan/clan-core#clan-template",
]
Owner

This should have a check=True or handle the exit code in a different way.

This should have a `check=True` or handle the exit code in a different way.
Mic92 reviewed 2023-07-21 08:05:53 +00:00
@ -0,0 +67,4 @@
"git",
"-C",
args.folder,
] + args.git_args
Owner

Same here.

Same here.
Mic92 force-pushed cli from 1cfd48ffdc to e4fbb08f91 2023-07-21 09:19:22 +00:00 Compare
Mic92 added 2 commits 2023-07-21 09:22:07 +00:00
lassulus approved these changes 2023-07-21 09:24:47 +00:00
Mic92 force-pushed cli from dfa83ac9c3 to 3ab90e6785 2023-07-21 09:25:29 +00:00 Compare
Mic92 merged commit c87db7106a into main 2023-07-21 09:26:57 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: clan/clan-core#11
No description provided.