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

'__main__.py' isn't used anywhere #69

Open
sleeptightAnsiC opened this issue Mar 24, 2024 · 1 comment
Open

'__main__.py' isn't used anywhere #69

sleeptightAnsiC opened this issue Mar 24, 2024 · 1 comment

Comments

@sleeptightAnsiC
Copy link
Contributor

__main__.py does not seem to be used anywhere.
The entry point for ue4cli is actually in a different place:

ue4cli/setup.py

Lines 35 to 37 in fed71c1

entry_points = {
'console_scripts': ['ue4=ue4cli.cli:main']
}

I'm also not able to use this file directly like a script, as it does not bootstrap the module:

# cwd is repo root directory
$ python ./ue4cli                
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/kornel/Projects/ue4cli/./ue4cli/__main__.py", line 1, in <module>
    from .cli import main
ImportError: attempted relative import with no known parent package

Maybe I'm not using it right?
Shall we fix this?

@sleeptightAnsiC
Copy link
Contributor Author

sleeptightAnsiC commented May 2, 2024

NOTE:
To be able to use ue4cli from sourcecode without installing it, one must move the __main__.py file to the ue4cli's root directory and change from .cli import main to from ue4cli.cli import main. Then invoking the scripts will be possible by python /path/to/ue4cliroot

ref: https://www.geeksforgeeks.org/usage-of-__main__-py-in-python/

Still not sure about the lines from setup.py, but we probably can leave it as it is.

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

No branches or pull requests

1 participant