From f50fef1c1ad6ceeaa16f7b57bfe5543ba01d63ac Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Mon, 31 Mar 2025 21:48:44 -0700 Subject: [PATCH 1/2] cleanup whats_left.py --- whats_left.py | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/whats_left.py b/whats_left.py index 7c1c30ba6c..1323358568 100755 --- a/whats_left.py +++ b/whats_left.py @@ -62,46 +62,13 @@ def parse_args(): args = parse_args() - -# modules suggested for deprecation by PEP 594 (www.python.org/dev/peps/pep-0594/) -# some of these might be implemented, but they are not a priority -PEP_594_MODULES = { - "aifc", - "asynchat", - "asyncore", - "audioop", - "binhex", - "cgi", - "cgitb", - "chunk", - "crypt", - "formatter", - "fpectl", - "imghdr", - "imp", - "macpath", - "msilib", - "nntplib", - "nis", - "ossaudiodev", - "parser", - "pipes", - "smtpd", - "sndhdr", - "spwd", - "sunau", - "telnetlib", - "uu", - "xdrlib", -} - # CPython specific modules (mostly consisting of templates/tests) CPYTHON_SPECIFIC_MODS = { 'xxmodule', 'xxsubtype', 'xxlimited', '_xxtestfuzz', '_testbuffer', '_testcapi', '_testimportmultiple', '_testinternalcapi', '_testmultiphase', '_testlimitedcapi' } -IGNORED_MODULES = {"this", "antigravity"} | PEP_594_MODULES | CPYTHON_SPECIFIC_MODS +IGNORED_MODULES = {"this", "antigravity"} | CPYTHON_SPECIFIC_MODS sys.path = [ path From 92b77b39fd08948a2be79babd56e90c88c09938c Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Mon, 31 Mar 2025 22:16:15 -0700 Subject: [PATCH 2/2] add features flag --- whats_left.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/whats_left.py b/whats_left.py index 1323358568..82df5cabe1 100755 --- a/whats_left.py +++ b/whats_left.py @@ -55,6 +55,12 @@ def parse_args(): action="store_true", help="print output as JSON (instead of line by line)", ) + parser.add_argument( + "--features", + action="store", + help="which features to enable when building RustPython (default: ssl)", + default="ssl", + ) args = parser.parse_args() return args @@ -413,9 +419,9 @@ def remove_one_indent(s): f.write(output + "\n") -subprocess.run(["cargo", "build", "--release", "--features=ssl"], check=True) +subprocess.run(["cargo", "build", "--release", f"--features={args.features}"], check=True) result = subprocess.run( - ["cargo", "run", "--release", "--features=ssl", "-q", "--", GENERATED_FILE], + ["cargo", "run", "--release", f"--features={args.features}", "-q", "--", GENERATED_FILE], env={**os.environ.copy(), "RUSTPYTHONPATH": "Lib"}, text=True, capture_output=True,