Skip to content
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

Improve the command cli interface #27

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Improve the command cli interface #27

wants to merge 9 commits into from

Conversation

signalpillar
Copy link

Problem

The project avoids installing own dependencies so external library needs to be
vendored or idea of having own small impl. should be improved.

Current implementation shows the right direction but has lack of argument
declaration/validation and thus documentation generation.

Solution

Suggest an own argparser wrapper that leverages idea of using the subparsers and
also allows using the decorators to mark the functions as commands.

Other changes

Testing

The existing tests pass.

Volodymyr Vitvitskyi and others added 2 commits October 20, 2018 11:55
Problem
-------
The project avoids installing own dependencies so external library needs to be
vendored or idea of having own small impl. should be improved.

Current implementation shows the right direction but has lack of argument
declaration/validation and thus documentation generation.

Solution
--------
Suggest an own argparser wrapper that leverages idea of using the subparsers and
also allows using the decorators to mark the functions as commands.

Other changes
-------------
- Update CircleCI configuration to use v2 -
  https://circleci.com/blog/sunsetting-1-0/
- pundleapp is the new package.
- removed some unused dependencies

Testing
-------
The existing tests pass.
@signalpillar
Copy link
Author

It is WIP. I think this is the direction where you want to go and it is improving the existing state. What do you think?

I am going to add the tests for the new module, so far.

@signalpillar
Copy link
Author

The tests are still running using CircleCi v1 that is disabled :(

Volodymyr Vitvitskyi added 4 commits October 20, 2018 12:44
Testing
-------
pyenv local system 3.6.5
tox
Example

```
usage: pundle run [-h] script [args [args ...]]

Execute given script.

    Examples:

    | pundle run test.py -- 1 --help

positional arguments:
  script
  args

optional arguments:
  -h, --help  show this help message and exit

```
@signalpillar
Copy link
Author

This is how help looks like for one of the commands that have description in the command.

usage: pundle run [-h] script [args [args ...]]

Execute given script.

    Examples:

    | pundle run test.py -- 1 --help

positional arguments:
  script
  args

optional arguments:
  -h, --help  show this help message and exit

The bundle command help

➭ ./pundle --help
usage: pundle [-h]
              {install,upgrade,fixate,exec,entry_points,edit,info,console,run,module,env,linkall,show_requirements}
              ...

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  valid subcommands

  {install,upgrade,fixate,exec,entry_points,edit,info,console,run,module,env,linkall,show_requirements}
    install
    upgrade             Upgrade all the required packages or a single package
                        if specified
    fixate              Put activation code to usercustomize.py for the user
    exec                Execute setuptools entry
    entry_points        List available setuptools entries
    edit                Print directory path to the package
    info                Print info about pundle state
    console             Start python interpreter (ipython|bpython|ptpython)
                        with activated pundle environment
    run                 Execute given script
    module              Execute module like `python -m`
    env                 Execute any command in the environment
    linkall             Link all packages to `.pundle_local` dir
    show_requirements   Show detailed requirements info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant