Skip to content

Add entry_points to setuptools’ configuration to provide command-line console scripts #3199

@vitorsr

Description

@vitorsr

Currently, PyMuPDF is not pipx-installable because it does not provide any console commands:

$ pipx install PyMuPDF

No apps associated with package pymupdf or its dependencies. If you are attempting to install a library, pipx should
not be used. Consider using pip or a similar tool instead.

To make, e.g., fitz, directly available from the command-line we need to add entry_points to setuptools’ configuration [1]:

        entry_points = {"console_scripts": ["fitz = fitz.__main__:main"]},

This would require modifying the pipcl.Package class.

It could alternatively be added to pyproject.toml [2]:

diff --git a/pyproject.toml b/pyproject.toml
index 10c9a43..05b7117 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,3 +5,6 @@ requires = ["libclang", "swig", "setuptools", "psutil"]
 #
 build-backend = "setup"
 backend-path = ["."]
+
+[project.scripts]
+fitz = fitz.__main__:main

[1] https://setuptools.pypa.io/en/latest/userguide/entry_point.html

[2] https://packaging.python.org/en/latest/specifications/pyproject-toml/#entry-points

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions