Solved Python port doesn't produce executable binary

Hi. I am creating a port that's written in python. IIRC, i was able to run it before but i don't remember how i was able to run the executable binary. Now, it doesn't even seem to create a executable binary. There is __init__.py in source code root but i don't think i should move this as a executable binary. There is src/cli/__main__.py but that gives error below. You can look at the port from here. I am attaching zip archive of the port too. What .py file should i run in order to execute mov-cli?

Code:
# python3.11 work-py311/mov_cli-4.4.15/mov_cli/cli/__main__.py
Traceback (most recent call last):
  File "/home/yusuf/Documents/yusuf-ports/www/py-mov-cli/work-py311/mov_cli-4.4.15/mov_cli/cli/__main__.py", line 12, in <module>
    from .play import play
ImportError: attempted relative import with no known parent package

Another way of running it
Code:
# python3.11 -m mov_cli
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/usr/local/lib/python3.11/site-packages/mov_cli/__init__.py", line 2, in <module>
    from .cli import *
  File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/__init__.py", line 1, in <module>
    from .ui import *
  File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/ui.py", line 21, in <module>
    import inquirer
ModuleNotFoundError: No module named 'inquirer'

devel/py-pyinquirer is already installed.

Thanks in advance.
 

Attachments

On linux :
Sorry but I don't think these things would help me. I am trying to create a port of the program, I shouldn't manually install it.

Are you looking for something similar to devel/cx_freeze ?
I don't think so. Also, it's marked as deprecated. My problem is, I can't run the program because it doesn't produce any binary to execute from terminal. Also, running it with python3.11 -m mov_cli fails too.
 
As far I see, to build the project, you have to use either make build, but this will require some changes in Makefile (the project one, not in the package) or python3.11 -m build . At least if I properly read the project Makefile: https://github.com/mov-cli/mov-cli/blob/v4/Makefile
I think it's not the way we supposed to go. I asked to project maintainers. I realized that devel/py-pyinquirer isn't the one that the program needs. So, I had to port the needed one together with it's dependencies. I see that some projects has __main__.py file besides the __init__.py file on source code root and that (__main__.py) may be used as executable binary that will execute the whole program by copying it to binary folder but this program doesn't have it. I am trying to find what .py I should run as executable binary.
 
I ended up using the executable binaries that installing the program via pip generates. I am not sure if this is a good way of making executable binaries but it works. I am marking the thread as solved. Maintainers of the program also said this problem is solved by creating __main__.py files where appropriate in incoming new version v4.5.

PR 281648

Code:
# pwd
/home/yusuf/Documents/yusuf-ports/www/py-movcli
# tail -n +1 files/*
==> files/mov-cli-dev.in <==
#!%%PYTHON_CMD%%
# -*- coding: utf-8 -*-
import re
import sys
from mov_cli.dev_cli.__main__ import app
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(app())

==> files/mov-cli.in <==
#!%%PYTHON_CMD%%
# -*- coding: utf-8 -*-
import re
import sys
from mov_cli.cli.__main__ import app
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(app())
 
Back
Top