Skip to content

Replace use of scripts with cross-platform entry_points #310

Closed
@bollwyvl

Description

@bollwyvl

Problem

In looking into #309, I see that scripts are being used. These are troublesome for cross-platform downstreams, as they make otherwise-well-behaved distributions less portable.

Proposal

Migrate from scripts to entry_points, where:

  • the contents of scripts/gql-cli would be move to gql/cli.py
    • as main is already named there, might have a different name, e.g. entry_point_main
  • setup.py would be updated, a la:
--- setup.py	2022-03-25 11:06:08.397539455 -0500
+++ setup.py	2022-03-25 11:08:23.321126291 -0500
@@ -8,7 +8,7 @@
 ]
 
 scripts = [
-    "scripts/gql-cli",
+    "gql-cli=gli.cli:main"
 ]
 
 tests_requires = [
@@ -106,5 +106,5 @@
     include_package_data=True,
     zip_safe=False,
     platforms="any",
-    scripts=scripts,
+    entry_points={"console_scripts": scripts}
 )

This would also allow the noarch python wheels to be created, which would be helpful for performance and security without increasing the maintenance/build burden much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: choreChanges to the build process or auxiliary tools and libraries such as documentation generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions