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

add __main__.py #55

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

add __main__.py #55

wants to merge 4 commits into from

Conversation

ctfer-org
Copy link

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] ...

```
Copy link
Owner

@nemanja-m nemanja-m left a comment

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.

gaps/__main__.py Outdated Show resolved Hide resolved
gaps/__main__.py Outdated Show resolved Hide resolved
gaps/__main__.py Outdated Show resolved Hide resolved
1. use double quotes instead of single quotes
2. semicolon removed
@ctfer-org
Copy link
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
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