-
Notifications
You must be signed in to change notification settings - Fork 9.7k
feat: system-aware tiered parallel pytest with cross-platform hardening #2877
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
4fbaa2c
127ac67
a227754
42571cc
b12061f
b87e7c6
8bb0ca4
55819c7
4c2a128
1ce7a90
1c95074
ba72907
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -433,12 +433,16 @@ resolve_template() { | |
| local presets_dir="$repo_root/.specify/presets" | ||
| if [ -d "$presets_dir" ]; then | ||
| local registry_file="$presets_dir/.registry" | ||
| if [ -f "$registry_file" ] && command -v python3 >/dev/null 2>&1; then | ||
| if [ -f "$registry_file" ] && (command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1); then | ||
| # Read preset IDs sorted by priority (lower number = higher precedence). | ||
| # The python3 call is wrapped in an if-condition so that set -e does not | ||
| # abort the function when python3 exits non-zero (e.g. invalid JSON). | ||
| # The python call is wrapped in an if-condition so that set -e does not | ||
| # abort the function when the interpreter exits non-zero (e.g. invalid JSON). | ||
| local sorted_presets="" | ||
| if sorted_presets=$(SPECKIT_REGISTRY="$registry_file" python3 -c " | ||
| local python_cmd="python3" | ||
| if ! command -v "$python_cmd" >/dev/null 2>&1; then | ||
| python_cmd="python" | ||
| fi | ||
| if sorted_presets=$(SPECKIT_REGISTRY="$registry_file" "$python_cmd" -c " | ||
|
Comment on lines
+436
to
+445
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. Resolved by ba72907. |
||
| import json, sys, os | ||
| try: | ||
| with open(os.environ['SPECKIT_REGISTRY']) as f: | ||
|
|
@@ -451,28 +455,29 @@ except Exception: | |
| sys.exit(1) | ||
| " 2>/dev/null); then | ||
| if [ -n "$sorted_presets" ]; then | ||
| # python3 succeeded and returned preset IDs — search in priority order | ||
| # Python interpreter succeeded and returned preset IDs — search in priority order | ||
| while IFS= read -r preset_id; do | ||
| preset_id="${preset_id%$'\r'}" | ||
| local candidate="$presets_dir/$preset_id/templates/${template_name}.md" | ||
| [ -f "$candidate" ] && echo "$candidate" && return 0 | ||
| done <<< "$sorted_presets" | ||
|
Comment on lines
+458
to
463
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. Resolved by ba72907. |
||
| fi | ||
| # python3 succeeded but registry has no presets — nothing to search | ||
| # Python interpreter succeeded but registry has no presets — nothing to search | ||
| else | ||
| # python3 failed (missing, or registry parse error) — fall back to unordered directory scan | ||
| for preset in "$presets_dir"/*/; do | ||
| # Interpreter invocation failed (missing, or registry parse error) — fall back to deterministic directory scan | ||
| while IFS= read -r preset; do | ||
| [ -d "$preset" ] || continue | ||
| local candidate="$preset/templates/${template_name}.md" | ||
| [ -f "$candidate" ] && echo "$candidate" && return 0 | ||
| done | ||
| done < <(find "$presets_dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | LC_ALL=C sort) | ||
|
Comment on lines
+467
to
+472
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. Resolved by ba72907. |
||
| fi | ||
| else | ||
| # Fallback: alphabetical directory order (no python3 available) | ||
| for preset in "$presets_dir"/*/; do | ||
| # Fallback: alphabetical directory order (no usable python interpreter available) | ||
| while IFS= read -r preset; do | ||
| [ -d "$preset" ] || continue | ||
| local candidate="$preset/templates/${template_name}.md" | ||
| [ -f "$candidate" ] && echo "$candidate" && return 0 | ||
| done | ||
| done < <(find "$presets_dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | LC_ALL=C sort) | ||
| fi | ||
|
LahkLeKey marked this conversation as resolved.
|
||
| fi | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.