-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add tool for easier test updates #6089
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
Changes from 1 commit
7c0a8fe
69ed76b
dc3a6de
5c09ef0
ad061b2
a6f2324
302b3d1
db74d2f
11694e3
d8b4e26
2308a5a
2fb6842
db5eb4b
af1c28d
42365d2
fdce40b
32baa80
fb7324d
f4056ac
4296b59
e2aa220
74b47a0
51c6ad9
01a90ef
a0e56ae
43a63a8
3e2c1f1
789cf6e
3e9872c
d0763e4
e00bb28
8a5875e
6c615cc
c0e90cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # upstream_version: v3.13.7 | ||
| # Copyright 2007 Google Inc. | ||
| # Licensed to PSF under a Contributor Agreement. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # upstream_version: v3.13.7 | ||
| # Author: Fred L. Drake, Jr. | ||
| # fdrake@acm.org | ||
| # | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # upstream_version: v3.13.7 | ||
| s = """Gur Mra bs Clguba, ol Gvz Crgref | ||
|
|
||
| Ornhgvshy vf orggre guna htyl. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # **R**ust**P**ython **A**utomatic **U**pdater (rpau) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/argparse.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/ast.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/decimal.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/heapq.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/ipaddress.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/numbers.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/os.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/pprint.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/queue.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| path = "Lib/this.py" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
|
|
||
| COL_OFFSET = 4 | ||
| INDENT1 = " " * COL_OFFSET | ||
| INDENT2 = " " * COL_OFFSET * 2 | ||
| INDENT2 = INDENT1 * 2 | ||
| COMMENT = "TODO: RUSTPYTHON" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 This would be nice to have an easy override for (CI may be-able to add more details dynamically that way)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ofc, I have plans to make pretty much everything configurable via argparse |
||
|
|
||
| ROOT_DIR = pathlib.Path(__file__).parents[2] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [project] | ||
| name = "rpau" | ||
| version = "0.1.0" | ||
| description = "Tool for automaticly update Lib & Tests from CPython" | ||
| readme = "README.md" | ||
| authors = [ | ||
| { name = "RustPython Team", email = "" } | ||
| ] | ||
| requires-python = ">=3.12" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Explicit requirement here is a good improvement! 🔖 Before we forget, this sort of design decision should be documented, probably in the adjacent |
||
| dependencies = [] | ||
|
|
||
| [project.scripts] | ||
| rpau = "rpau:main" | ||
|
|
||
| [build-system] | ||
| requires = ["uv_build>=0.8.11,<0.9.0"] | ||
| build-backend = "uv_build" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,75 @@ | ||||||||||||||||
| import functools | ||||||||||||||||
| from concurrent.futures import ProcessPoolExecutor | ||||||||||||||||
| from typing import TYPE_CHECKING | ||||||||||||||||
|
|
||||||||||||||||
| import tomllib | ||||||||||||||||
|
|
||||||||||||||||
| from rpau.cli import build_argparse | ||||||||||||||||
| from rpau.logger import build_root_logger, get_logger | ||||||||||||||||
| from rpau.logic import run | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused import to satisfy ruff/flake8 (F401)
Apply this diff: -from rpau.logger import build_root_logger, get_logger
+from rpau.logger import build_root_logger📝 Committable suggestion
Suggested change
🧰 Tools🪛 Flake8 (7.2.0)[error] 8-8: 'rpau.logger.get_logger' imported but unused (F401) 🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| if TYPE_CHECKING: | ||||||||||||||||
| import pathlib | ||||||||||||||||
| import re | ||||||||||||||||
| from collections.abc import Iterator | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def iter_confs( | ||||||||||||||||
| conf_dir: "pathlib.Path", *, include: "re.Pattern", exclude: "re.Pattern" | ||||||||||||||||
| ) -> "Iterator[pathlib.Path]": | ||||||||||||||||
| for conf_file in conf_dir.rglob("**/*.toml"): | ||||||||||||||||
| if not conf_file.is_file(): | ||||||||||||||||
| continue | ||||||||||||||||
|
|
||||||||||||||||
| uri = conf_file.as_uri().removeprefix("file://") | ||||||||||||||||
| if not include.match(uri): | ||||||||||||||||
| continue | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 NIT - consider leveraging the logger more in while prototyping automation, it would be helpful to have the option for a debug messages for the skipped files. consider something like:
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| if exclude.match(uri): | ||||||||||||||||
| continue | ||||||||||||||||
|
|
||||||||||||||||
| yield conf_file | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def main() -> None: | ||||||||||||||||
| parser = build_argparse() | ||||||||||||||||
| args = parser.parse_args() | ||||||||||||||||
|
|
||||||||||||||||
| logger = build_root_logger(level=args.log_level) | ||||||||||||||||
| logger.debug(f"{args=}") | ||||||||||||||||
|
|
||||||||||||||||
| if args.cache: | ||||||||||||||||
| logger.debug(f"Ensuring {args.cache_dir} exists") | ||||||||||||||||
| cache_dir = args.cache_dir | ||||||||||||||||
| cache_dir.mkdir(parents=True, exist_ok=True) | ||||||||||||||||
| else: | ||||||||||||||||
| cache_dir = None | ||||||||||||||||
|
|
||||||||||||||||
| conf_dir = args.conf_dir | ||||||||||||||||
| with ProcessPoolExecutor(args.workers) as executor: | ||||||||||||||||
| for conf_file in iter_confs( | ||||||||||||||||
| conf_dir, include=args.include, exclude=args.exclude | ||||||||||||||||
| ): | ||||||||||||||||
| try: | ||||||||||||||||
| conf = tomllib.loads(conf_file.read_text()) | ||||||||||||||||
| except tomllib.TOMLDecodeError as err: | ||||||||||||||||
| logger.warn(f"{conf_file}: {err}") | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 NIT - consider logging built-in frame dump feature consider the debug friendly style:
Suggested change
logging functions like (the |
||||||||||||||||
| continue | ||||||||||||||||
|
|
||||||||||||||||
| try: | ||||||||||||||||
| path = conf.pop("path") | ||||||||||||||||
| except KeyError: | ||||||||||||||||
| logger.warn(f"{conf_file}: has no 'path' key. skipping") | ||||||||||||||||
| continue | ||||||||||||||||
|
|
||||||||||||||||
| version = conf.pop("version", args.default_version) | ||||||||||||||||
| func = functools.partial( | ||||||||||||||||
| run, | ||||||||||||||||
| path=path, | ||||||||||||||||
| conf=conf, | ||||||||||||||||
| cache_dir=cache_dir, | ||||||||||||||||
| version=version, | ||||||||||||||||
| output_dir=args.output_dir, | ||||||||||||||||
| base_upstream_url=args.base_upstream_url, | ||||||||||||||||
| ) | ||||||||||||||||
| executor.submit(func) | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to assist automation, it would be helpful to collect the results of the runs (especially when being selective with the |
||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Prototype is off to a good start. 🧹 Of course it will probably need cleaned up more in the future for maintainability, but it is much better than before already. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,134 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| import argparse | ||||||||||||||||||||||||||||||||||||||||||||||||
| import logging | ||||||||||||||||||||||||||||||||||||||||||||||||
| import os | ||||||||||||||||||||||||||||||||||||||||||||||||
| import pathlib | ||||||||||||||||||||||||||||||||||||||||||||||||
| import re | ||||||||||||||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| class CustomArgumentParser(argparse.ArgumentParser): | ||||||||||||||||||||||||||||||||||||||||||||||||
| class _CustomHelpFormatter(argparse.ArgumentDefaultsHelpFormatter): | ||||||||||||||||||||||||||||||||||||||||||||||||
| def _get_help_string(self, action): | ||||||||||||||||||||||||||||||||||||||||||||||||
| help_msg = super()._get_help_string(action) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if action.dest != "help": | ||||||||||||||||||||||||||||||||||||||||||||||||
| env_name = f"{self._prog}_{action.dest}".upper() | ||||||||||||||||||||||||||||||||||||||||||||||||
| env_value = os.environ.get(env_name, "") | ||||||||||||||||||||||||||||||||||||||||||||||||
| help_msg += f" [env: {env_name}={env_value}]" | ||||||||||||||||||||||||||||||||||||||||||||||||
| return help_msg | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, *, formatter_class=_CustomHelpFormatter, **kwargs): | ||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__(formatter_class=formatter_class, **kwargs) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def _add_action(self, action): | ||||||||||||||||||||||||||||||||||||||||||||||||
| action.default = os.environ.get( | ||||||||||||||||||||||||||||||||||||||||||||||||
| f"{self.prog}_{action.dest}".upper(), action.default | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| return super()._add_action(action) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Env overrides ignore types (Path/int/bool), causing subtle bugs Overriding defaults from env injects raw strings for every action. This breaks typed options like - def _add_action(self, action):
- action.default = os.environ.get(
- f"{self.prog}_{action.dest}".upper(), action.default
- )
- return super()._add_action(action)
+ def _add_action(self, action):
+ env_name = f"{self.prog}_{action.dest}".upper()
+ env_val = os.environ.get(env_name, None)
+ if env_val is not None:
+ # Coerce env string to the expected type
+ if isinstance(action, argparse.BooleanOptionalAction):
+ val = env_val.lower() in {"1", "true", "yes", "on"}
+ elif action.type is not None:
+ val = action.type(env_val)
+ else:
+ val = env_val
+ # Validate against choices if provided
+ if action.choices and val not in action.choices:
+ raise argparse.ArgumentError(
+ action, f"{env_name} must be one of {list(action.choices)}"
+ )
+ action.default = val
+ return super()._add_action(action)If you prefer not to use 📝 Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 NIT - I agree with @coderabbitai on this, if the code is going to implement a custom type-aware arg-parser anyway, might as well be consistent with the types.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @reactive-firewall Thank you for the agreement! You're absolutely right - since we're already implementing a custom argument parser with environment variable support, maintaining type consistency is crucial. The current implementation would cause silent bugs where boolean flags become strings, integer workers become strings, and Path objects become strings, which could lead to confusing runtime errors downstream. The type-aware coercion ensures the environment variables work exactly as if they were passed via command line arguments. |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def get_cache_dir(prog: str) -> pathlib.Path: | ||||||||||||||||||||||||||||||||||||||||||||||||
| home = pathlib.Path.home() | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if sys.platform.startswith("win"): | ||||||||||||||||||||||||||||||||||||||||||||||||
| local_appdata = pathlib.Path( | ||||||||||||||||||||||||||||||||||||||||||||||||
| os.getenv("LOCALAPPDATA", home / "AppData" / "Local") | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| path = local_appdata / prog / prog / "Cache" | ||||||||||||||||||||||||||||||||||||||||||||||||
| elif sys.platform == "darwin": | ||||||||||||||||||||||||||||||||||||||||||||||||
| path = home / "Library" / "Caches" / prog | ||||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||||
| cache_home = pathlib.Path(os.getenv("XDG_CACHE_HOME", home / ".cache")) | ||||||||||||||||||||||||||||||||||||||||||||||||
| path = cache_home / prog | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| return path | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def build_argparse() -> argparse.ArgumentParser: | ||||||||||||||||||||||||||||||||||||||||||||||||
| parser = CustomArgumentParser( | ||||||||||||||||||||||||||||||||||||||||||||||||
| prog="rpau", description="Automatic update code from CPython" | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Cache | ||||||||||||||||||||||||||||||||||||||||||||||||
| cache_group = parser.add_argument_group("Cache options") | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| cache_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--cache", | ||||||||||||||||||||||||||||||||||||||||||||||||
| action=argparse.BooleanOptionalAction, | ||||||||||||||||||||||||||||||||||||||||||||||||
| default=True, | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Whether reading from or writing to the cache is allowed", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| cache_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--cache-dir", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default=get_cache_dir(parser.prog), | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Path to the cache directory", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="PATH", | ||||||||||||||||||||||||||||||||||||||||||||||||
| type=pathlib.Path, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Output | ||||||||||||||||||||||||||||||||||||||||||||||||
| output_group = parser.add_argument_group("Output option") | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| output_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "-o", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--output-dir", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default=pathlib.Path(__file__).parents[4], | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Output dir", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="PATH", | ||||||||||||||||||||||||||||||||||||||||||||||||
| type=pathlib.Path, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Filter | ||||||||||||||||||||||||||||||||||||||||||||||||
| filter_group = parser.add_argument_group("Filter options") | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| filter_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "-i", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--include", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default=".*", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="RE pattern used to include files and/or directories", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="PATTERN", | ||||||||||||||||||||||||||||||||||||||||||||||||
| type=re.compile, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| filter_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "-e", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--exclude", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default="^$", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="RE pattern used to omit files and/or directories", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="PATTERN", | ||||||||||||||||||||||||||||||||||||||||||||||||
| type=re.compile, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Global | ||||||||||||||||||||||||||||||||||||||||||||||||
| global_group = parser.add_argument_group("Global options") | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| global_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--log-level", | ||||||||||||||||||||||||||||||||||||||||||||||||
| choices=logging.getLevelNamesMapping(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| default="WARNING", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Log level", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| global_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "-j", "--workers", default=1, help="Number of processes", type=int | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| global_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "-c", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--conf-dir", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default=pathlib.Path(__file__).parents[2] / "confs", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Path to conf dir", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="PATH", | ||||||||||||||||||||||||||||||||||||||||||||||||
| type=pathlib.Path, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| global_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--base-upstream-url", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default="https://raw.githubusercontent.com/python/cpython/refs/tags", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Base upstream url of CPython", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="URL", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| global_group.add_argument( | ||||||||||||||||||||||||||||||||||||||||||||||||
| "--default-version", | ||||||||||||||||||||||||||||||||||||||||||||||||
| default="v3.13.7", | ||||||||||||||||||||||||||||||||||||||||||||||||
| help="Fallback version of cpython if none specified in conf", | ||||||||||||||||||||||||||||||||||||||||||||||||
| metavar="VERSION_TAG", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| return parser | ||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this crazy idea to store patch files in the repo for patches like this. similar to what Termux is doing for their packages, for example:
https://github.com/termux/termux-packages/blob/9865d958666e04f16201a0774a646f37b6082c80/packages/python/0001-fix-hardcoded-paths.patch
That's probably out of scope for this PR tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, your idea is not so crazy,
Cis NOTRustafter all, it might be needed, but yeah, totally out-of-scope for this PR.what about an empty patch folder for now? TL;DR
🤔 I think patches for stuff like this might be the right idea, git can even generate them for us, especially if it we can make them configureable (knobs like: os/arch pair, patch-id, cpython version, and context lines needed (for preventing regressions in the future, etc.) come to mind) for now we could just have a patch folder (empty, but as a placeholder)