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
setup( ... entry_points = { 'console_scripts': ['funniest-joke=funniest.command_line:main'], } ... ) Again, once the package has been installed, we can use it in the same way.
🌐
GeeksforGeeks
geeksforgeeks.org › command-line-scripts-python-packaging
Command Line Scripts | Python Packaging | GeeksforGeeks
April 29, 2019 - Syntax : code.compile_command(code) Return : Return the object or compilation error if any. Example #1 : In this example we ... Working on Python projects may require you to list the installed Python packages in order to manage dependencies, check for updates, or share project requirements with others.
🌐
Python Packaging
packaging.python.org › tutorials › packaging-projects
Packaging Python Projects - Python Packaging User Guide
Some build backends are part of larger tools that provide a command-line interface with additional features like project initialization and version management, as well as building, uploading, and installing packages. This tutorial uses single-purpose tools that work independently. The pyproject.toml tells build frontend tools like pip and build which backend to use for your project. Below are some examples for common build backends, but check your backend’s own documentation for more details.
🌐
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. First of all, create a source tree for the project. For the sake of an example, we’ll build a simple tool outputting a greeting (a string) for a person based on arguments given on the command-line.
🌐
The Carpentries
carpentries-incubator.github.io › python_packaging › 01-scripts-and-modules.html
Python Packaging: Python Scripts and Modules
April 16, 2024 - 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.
Find elsewhere
🌐
Python Packaging
packaging.python.org › en › latest › overview
Overview of Python Packaging - 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 ...
🌐
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.
🌐
Python Packaging
packaging.python.org › en › latest › guides › writing-pyproject-toml
Writing your pyproject.toml - Python Packaging User Guide
Each of the keys defines a “packaging extra”. In the example above, one could use, e.g., pip install your-project-name[gui] to install your project with GUI support, adding the PyQt5 dependency.
🌐
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
It is mostly useful if you need ... Python packages. Each (directory, files) pair in the sequence specifies the installation directory and the files to install there. The directory must be a relative path (although this may change in the future, see wheel Issue #92), and it is interpreted relative to the installation prefix (Python’s sys.prefix for a default installation; site.USER_BASE for a user installation). Each file name in files is interpreted relative to the setup.py script at the top ...
🌐
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.
🌐
Yasoob Khalid
yasoob.me › 2013 › 07 › 29 › packaging-your-python-scripts
Packaging your python scripts. - Yasoob Khalid
July 29, 2013 - For basic use of setuptools, just import things from setuptools and then look below for the minimal setup script using setuptools. from setuptools import setup, find_packages setup( name = "HelloWorld", version = "0.1", packages = find_packages(), ) ...
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › shipping › packaging
Packaging Your Code — The Hitchhiker's Guide to Python
Package your code to share it with other developers. For example, to share a library for other developers to use in their application, or for development tools like ‘py.test’.
🌐
Medium
john-tucker.medium.com › debian-packaging-python-scripts-by-example-43853970dea6
Debian Packaging Python Scripts by Example | by John Tucker | Medium
October 15, 2024 - Here we build off the Debian Packaging by Example article and create packages that deliver Python scripts, i.e., command line interface (CLI) applications written in Python.
🌐
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.