Skip to content

add __main__.py#55

Open
ctfer-org wants to merge 4 commits into
nemanja-m:mainfrom
ctfer-org:main
Open

add __main__.py#55
ctfer-org wants to merge 4 commits into
nemanja-m:mainfrom
ctfer-org:main

Conversation

@ctfer-org

Copy link
Copy Markdown

Since some one like to install packages in portable Python , there would not be a command like gaps.

Also currently they can not use the gaps as a module, if they use the command .\python.exe -m gaps , it will say:

No module named gaps.__main__; 'gaps' is a package and cannot be directly executed

add the __main__.py could let them use command as a module.

.\python.exe -m gaps [create|run] ...

Since some one like to install packages in portable Python , there would not be a command like `gaps`.

Also currently they can not use the gaps as a module, if they use the command `.\python.exe -m gaps` , it will say:

`No module named gaps.__main__; 'gaps' is a package and cannot be directly executed`

add the `__main__.py` could let them use command as a module.

```SHELL

.\python.exe -m gaps [create|run] ...

```

@nemanja-m nemanja-m left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR 🙇

Please address comments.

Comment thread gaps/__main__.py Outdated
Comment thread gaps/__main__.py Outdated
Comment thread gaps/__main__.py Outdated
1. use double quotes instead of single quotes
2. semicolon removed
@ctfer-org

Copy link
Copy Markdown
Author

I see the build failed but don't know why it failed. 😂

Again I tested in the following steps:

  1. download the https://github.com/nemanja-m/gaps main version.
  2. put main.py into the directory
  3. poetry install
  4. pip install .
  5. use the command: python -m gaps It shows the help content, pass~

@nemanja-m

Copy link
Copy Markdown
Owner

The black code formatting check failed because tabs were used instead of spaces. Please replace tabs with spaces to resolve this.

Replace tabs with spaces.
Use Try/Catch to import cli module
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.

2 participants