-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Deprecate direct commandline scripts invocation and exclude nonsense ones #2364
base: dev
Are you sure you want to change the base?
Conversation
c337f72
to
a3b25ae
Compare
I would keep checksec, asm, disasm, constgrep, cyclic and errno, honestly, but most distros (pentoo, kali, AUR, not sure what else) already use the flag anyway. |
We can add the inverse of the current pwn-only flag for users who wish to keep the wrapper scripts. I too think you can discover the other commands more easily when using the |
Hm, I think keeping those is benefitial or at least leaving an option to have them installed. I frequently use those tools and always typing |
I thought about something like this, but removing the flag might annoy distro maintainers, as it force-reintroduces the deprecated scripts to those using the magic flag: From baf9b8532a2f54f47035af0c792bf7e30e5cf1cd Mon Sep 17 00:00:00 2001
From: Arusekk <[email protected]>
Date: Mon, 24 Jun 2024 21:47:13 +0200
Subject: [PATCH] Clean up entry points
---
pyproject.toml | 24 +++++++++++++++++++++++-
setup.py | 2 +-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index ce59233f..a3320880 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["setuptools>=44.0", "wheel", "toml; python_version<'3.4'"]
build-backend = "setuptools.build_meta"
[project]
-dynamic = ["version", "scripts"]
+dynamic = ["version"]
name = "pwntools"
description = "Pwntools CTF framework and exploit development library."
@@ -63,6 +63,28 @@ dependencies = [
homepage = "https://pwntools.com"
download = "https://github.com/Gallopsled/pwntools/releases"
+[project.scripts]
+pwn = "pwnlib.commandline.main:main"
+asm = "pwnlib.commandline.common:deprecated_main"
+checksec = "pwnlib.commandline.common:main"
+constgrep = "pwnlib.commandline.common:main"
+cyclic = "pwnlib.commandline.common:deprecated_main"
+debug = "pwnlib.commandline.common:deprecated_main"
+disablenx = "pwnlib.commandline.common:deprecated_main"
+disasm = "pwnlib.commandline.common:deprecated_main"
+elfdiff = "pwnlib.commandline.common:deprecated_main"
+elfpatch = "pwnlib.commandline.common:deprecated_main"
+errno = "pwnlib.commandline.common:deprecated_main"
+hex = "pwnlib.commandline.common:deprecated_main"
+libcdb = "pwnlib.commandline.common:main"
+phd = "pwnlib.commandline.common:main"
+pwnstrip = "pwnlib.commandline.common:main"
+scramble = "pwnlib.commandline.common:deprecated_main"
+shellcraft = "pwnlib.commandline.common:main"
+template = "pwnlib.commandline.common:deprecated_main"
+unhex = "pwnlib.commandline.common:deprecated_main"
+
+
[tool.distutils.bdist_wheel]
universal = 1
diff --git a/setup.py b/setup.py
index 812a0121..104b5fda 100755
--- a/setup.py
+++ b/setup.py
@@ -51,6 +51,7 @@ if sys.version_info < (3, 4):
compat['packages'] = find_packages()
compat['install_requires'] = project['dependencies']
compat['name'] = project['name']
+ compat['entry_points'] = {'console_scripts': project['scripts']}
# https://github.com/pypa/pip/issues/7953
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
@@ -77,6 +78,5 @@ setup(
'data/templates/*.mako',
] + templates,
},
- entry_points = {'console_scripts': console_scripts},
**compat
)
--
2.45.2 I'd like to remove all the useless scripts (as the PR does for Later on, we can use python packaging extras for those scripts, see #2245 (sadly, deps can only be positive, and I would honestly love |
@Arusekk I've converted your list of deprecated commands into the setup.py code. I wanted to keep the But Python 2 pip still allows to pass the --install-option. So switch to the declarative solution in v5? |
Deprecate the direct invocations to scripts before refactoring all tools to have a single entry point (Not finished in #660)
Check #2361