Entrypoint resolution issue
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
$ shiv -o glances.pyz -e glances:main glances
$ ./glances.pyz
Traceback (most recent call last):
File "./glances.pyz/_bootstrap/__init__.py", line 125, in bootstrap
TypeError: 'module' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "./glances.pyz/__main__.py", line 3, in <module>
File "./glances.pyz/_bootstrap/__init__.py", line 130, in bootstrap
AttributeError: module 'glances.main' has no attribute 'main'
Glances (strangely enough) has a module named main as well as a function named main. These work:
import glances.main; glances.main()
import glances; getattr(glances, "main")()
This (shiv's technique) does not:
from importlib import import_module
import_module("glances.main")()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the command shown in the issue and start at _bootstrap/init.py around the traceback's bootstrap call, comparing it with Python's import_module("glances.main") behavior. Trace how the -e glances:main entrypoint is resolved; done means an entrypoint where a package has both a main module and main function runs successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100