Help with package installation with console_scripts

Hi! I’m trying to create a wheel of my package. The setup.py includes also an entry point.

the structure of the package is the followig:
PACKAGE_DIR
|src
|
package_name
init.py
script_file_with_command_included_in_entry_point
|__ requirements.in
|__ requirements.txt
|__ setup.py
|__ LICENSE.md
|__ pyproject.toml
|__README.md

I created the wheel with python -m build
and installed it using python -m pip install dist/package_name.whl
The problem is that the command defined in the entry point does not work from the command line.
If I install the package doing python -m setup.py install then everything works fine.
Could anyone explain me what’s happening? or pointing me to a good explanation?
what are the best practices to package a python app? I was trying to do this with build because of the SetuptoolsDeprecationWarning I sow when I run python -m setup.py

I’m using python 3.9.12 in a conda env on linux

Thanks in advance for your help!