Skip to content

Replace use of scripts with cross-platform entry_points #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bollwyvl opened this issue Mar 25, 2022 · 1 comment · Fixed by #311
Closed

Replace use of scripts with cross-platform entry_points #310

bollwyvl opened this issue Mar 25, 2022 · 1 comment · Fixed by #311
Labels
type: chore Changes to the build process or auxiliary tools and libraries such as documentation generation

Comments

@bollwyvl
Copy link
Contributor

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.

@bollwyvl
Copy link
Contributor Author

Opened #311

@bollwyvl bollwyvl mentioned this issue Mar 27, 2022
1 task
@leszekhanusz leszekhanusz added the type: chore Changes to the build process or auxiliary tools and libraries such as documentation generation label Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Changes to the build process or auxiliary tools and libraries such as documentation generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants