Rather than using setuptools non standard way of proceeding, it is possible to directly rely on distutils setup's function, using the scripts argument, as stated here: http://docs.python.org/distutils/setupscript.html#installing-scripts

from distutils import setup
setup(
    ...,
    scripts=['path/to/your/script',],
    ...
)

It allows you to stay compatible a) with all python versions and b) not having to rely on a setuptools as an external dependency.

Answer from Alexis Métaireau on Stack Overflow
🌐
Readthedocs
python-packaging.readthedocs.io › en › latest › command-line-scripts.html
Command Line Scripts — Python Packaging Tutorial
Many Python packages include command line tools. This is useful for distributing support tools which are associated with a library, or just taking advantage of the setuptools / PyPI infrastructure to distribute a command line tool that happens to use Python. For funniest, we’ll add a funniest-joke command line tool. There are two mechanisms that setuptools.setup() provides to do this: the scripts keyword argument, and the console_scripts entry point.
🌐
Python Packaging
packaging.python.org › overview
An Overview of Packaging for Python — Python Packaging User Guide
If you’re looking for ways to ... ahead to Packaging Python applications. A Python file, provided it only relies on the standard library, can be redistributed and reused. You will also need to ensure it’s written for the right version of Python, and only relies on the standard library. This is great for sharing simple scripts and snippets ...
🌐
Python Packaging
packaging.python.org › guides › distributing-packages-using-setuptools
Packaging and distributing projects - Python Packaging User Guide
When installing packages as egg, data_files is not supported. So, if your project uses Setuptools, you must use pip to install it. Alternatively, if you must use python setup.py, then you need to pass the --old-and-unmanageable option. Although setup() supports a scripts keyword for pointing to pre-made scripts to install, the recommended approach to achieve cross-platform compatibility is to use Creating executable scripts entry points (see below).
🌐
Python Packaging
packaging.python.org › tutorials › packaging-projects
Packaging Python Projects - Python Packaging User Guide
Creating the file __init__.py is recommended because the existence of an __init__.py file allows users to import the directory as a regular package, even if (as is the case in this tutorial) __init__.py is empty.
🌐
GeeksforGeeks
geeksforgeeks.org › command-line-scripts-python-packaging
Command Line Scripts | Python Packaging | GeeksforGeeks
April 29, 2019 - Basically, they are just your python scripts converted to command line tools. In this article, we will discuss how you can do that yourself. The process can be broken down in these 6 steps: Create your Command Line Script.
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › shipping › packaging
Packaging Your Code — The Hitchhiker's Guide to Python
The Python Packaging Guide provides an extensive guide on creating and maintaining Python packages.
Find elsewhere
🌐
Python Packaging
packaging.python.org › en › latest › overview
Overview of Python Packaging - Python Packaging User Guide
February 6, 2023 - If you’re looking for ways to ... ahead to Packaging Python applications. A Python file, provided it only relies on the standard library, can be redistributed and reused. You will also need to ensure it’s written for the right version of Python, and only relies on the standard library. This is great for sharing simple scripts and snippets ...
🌐
Wehi-education
wehi-education.github.io › python_packaging › 01-scripts-and-modules.html
Python Packaging: Python Scripts and Modules
August 4, 2026 - It is possible to write a linear series of Python expressions in a file, and run this using the Python interpretter –again, like a scripting language. Python code can be bundled in modules and packages which can then be import-ed into other Python programs/scripts.
🌐
Readthedocs
python-packaging.readthedocs.io
How To Package Your Python Code — Python Packaging Tutorial
We’ll walk through the basic steps of building up a contrived package funniest to support these things. ... At this time, this documentation focuses on Python 2.x only, and may not be as applicable to packages targeted to Python 3.x.
🌐
Python Packaging
packaging.python.org › tutorials › installing-packages
Installing Packages - Python Packaging User Guide
On Windows you can find the user base binary directory by running py -m site --user-site and replacing site-packages with Scripts. For example, this could return C:\Users\Username\AppData\Roaming\Python36\site-packages so you would need to set your PATH to include C:\Users\Username\AppData\Roaming\Python36\Scripts.
🌐
Python Packaging
packaging.python.org
Python Packaging User Guide
The Python Packaging User Guide (PyPUG) is a collection of tutorials and guides for packaging Python software.
🌐
ArcGIS Pro
pro.arcgis.com › en › pro-app › latest › help › analysis › geoprocessing › share-analysis › packaging-python-scripts.htm
Package Python scripts—ArcGIS Pro | Documentation
When a data path is found, it is consolidated into a temporary folder that is included in the package. When your script is scanned, every quoted string (either single- or double-quotes) used in a Python variable or as an argument to a function is tested to see if it is a path to data that exists.
🌐
Springer
link.springer.com › home › advanced python development › chapter
Packaging scripts | SpringerLink
Chapter 3 covers code packaging and dependency distribution in Python. These are key features for writing applications that can be distributed to others and for designing deployment systems that work reliably. We will use this to convert our stand-alone script into...
🌐
Medium
john-tucker.medium.com › packaging-python-projects-supplement-2024-5c22b9d0e7b6
Packaging Python Projects — Supplement 2024 | by John Tucker | Medium
October 17, 2024 - The package would like to provide commands to be run at the terminal. This functionality is known as console scripts. The command may also open up a GUI, in which case it is known as a GUI script.
🌐
Python Packaging
packaging.python.org › en › latest › guides › creating-command-line-tools
Creating and packaging command-line tools - Python Packaging User Guide
This guide will walk you through creating and packaging a standalone command-line application that can be installed with pipx, a tool for creating and managing Python Virtual Environments and exposing the executable scripts of packages (and available manual pages) for use on the command-line.
🌐
Scientific Python Development
learn.scientific-python.org › development › guides › packaging-simple
Simple packaging - Scientific Python Development Guide
Self dependencies can be used by using the name of the package, such as all = ["package[cli,mpl]"], (requires Pip 21.2+). If you want to ship an “app” that a user can run from the command line, you need to add a script entry point.