fc-data 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datasmith/__init__.py +330 -0
- datasmith/__init__.pyi +194 -0
- datasmith/agents/__init__.py +31 -0
- datasmith/agents/classifiers.py +272 -0
- datasmith/agents/codex.py +25 -0
- datasmith/agents/config.py +108 -0
- datasmith/agents/extractors.py +197 -0
- datasmith/agents/installed/README.md +52 -0
- datasmith/agents/installed/__init__.py +22 -0
- datasmith/agents/installed/base.py +240 -0
- datasmith/agents/installed/claude.py +134 -0
- datasmith/agents/installed/codex.py +91 -0
- datasmith/agents/installed/gemini.py +118 -0
- datasmith/agents/installed/none.py +27 -0
- datasmith/agents/sandbox.py +547 -0
- datasmith/agents/synthesizer.py +439 -0
- datasmith/agents/templates/AGENTS.md.j2 +150 -0
- datasmith/agents/templates/sandbox_verify.py +428 -0
- datasmith/docker/__init__.py +31 -0
- datasmith/docker/context.py +112 -0
- datasmith/docker/images.py +158 -0
- datasmith/docker/publish.py +56 -0
- datasmith/docker/templates/Dockerfile.base +26 -0
- datasmith/docker/templates/Dockerfile.pr +42 -0
- datasmith/docker/templates/Dockerfile.repo +11 -0
- datasmith/docker/templates/docker_build_base.sh +780 -0
- datasmith/docker/templates/docker_build_env.sh +309 -0
- datasmith/docker/templates/docker_build_final.sh +106 -0
- datasmith/docker/templates/docker_build_pkg.sh +99 -0
- datasmith/docker/templates/docker_build_run.sh +124 -0
- datasmith/docker/templates/entrypoint.sh +62 -0
- datasmith/docker/templates/parser.py +1405 -0
- datasmith/docker/templates/profile.sh +199 -0
- datasmith/docker/templates/pytest_runner.py +692 -0
- datasmith/docker/templates/run-tests.sh +197 -0
- datasmith/docker/verifiers.py +131 -0
- datasmith/filters.py +154 -0
- datasmith/github/__init__.py +22 -0
- datasmith/github/client.py +333 -0
- datasmith/github/hooks.py +50 -0
- datasmith/github/links.py +110 -0
- datasmith/github/models.py +206 -0
- datasmith/github/render.py +173 -0
- datasmith/github/search.py +66 -0
- datasmith/github/templates/comment.md.j2 +5 -0
- datasmith/github/templates/final.md.j2 +66 -0
- datasmith/github/templates/issues.md.j2 +21 -0
- datasmith/github/templates/repo.md.j2 +1 -0
- datasmith/preflight.py +162 -0
- datasmith/publish/__init__.py +13 -0
- datasmith/publish/huggingface.py +104 -0
- datasmith/publish/pipeline.py +60 -0
- datasmith/publish/records.py +91 -0
- datasmith/py.typed +1 -0
- datasmith/resolution/__init__.py +14 -0
- datasmith/resolution/blocklist.py +145 -0
- datasmith/resolution/cache.py +120 -0
- datasmith/resolution/constants.py +277 -0
- datasmith/resolution/dependency_resolver.py +174 -0
- datasmith/resolution/git_utils.py +378 -0
- datasmith/resolution/import_analyzer.py +66 -0
- datasmith/resolution/metadata_parser.py +412 -0
- datasmith/resolution/models.py +41 -0
- datasmith/resolution/orchestrator.py +522 -0
- datasmith/resolution/package_filters.py +312 -0
- datasmith/resolution/python_manager.py +110 -0
- datasmith/runners/__init__.py +15 -0
- datasmith/runners/base.py +112 -0
- datasmith/runners/classify_prs.py +48 -0
- datasmith/runners/render_problems.py +113 -0
- datasmith/runners/resolve_packages.py +66 -0
- datasmith/runners/scrape_commits.py +166 -0
- datasmith/runners/scrape_repos.py +44 -0
- datasmith/runners/synthesize_images.py +310 -0
- datasmith/update/__init__.py +5 -0
- datasmith/update/cli.py +169 -0
- datasmith/update/offline.py +173 -0
- datasmith/update/pipeline.py +497 -0
- datasmith/utils/__init__.py +18 -0
- datasmith/utils/core.py +67 -0
- datasmith/utils/db.py +156 -0
- datasmith/utils/tokens.py +65 -0
- fc_data-0.2.0.dist-info/METADATA +441 -0
- fc_data-0.2.0.dist-info/RECORD +87 -0
- fc_data-0.2.0.dist-info/WHEEL +4 -0
- fc_data-0.2.0.dist-info/entry_points.txt +2 -0
- fc_data-0.2.0.dist-info/licenses/LICENSE +28 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Generate baseline ASV results (HEAD of current repo) once.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
# Ensure artifacts written by the container are world-readable on the host
|
|
5
|
+
umask 022
|
|
6
|
+
|
|
7
|
+
show_help() {
|
|
8
|
+
cat <<EOF
|
|
9
|
+
Usage: $(basename "$0") [LOG_PATH] [ADDITIONAL_ASV_ARGS]
|
|
10
|
+
|
|
11
|
+
Options:
|
|
12
|
+
LOG_PATH Full path for logging/results (required)
|
|
13
|
+
ADDITIONAL_ASV_ARGS Additional arguments to pass to ASV (optional)
|
|
14
|
+
-h, --help Show this help message and exit
|
|
15
|
+
|
|
16
|
+
Description:
|
|
17
|
+
This script generates baseline ASV results for the current repository HEAD.
|
|
18
|
+
It sets up the environment, runs benchmarks, bundles results into a tar.gz,
|
|
19
|
+
and then deletes unwanted intermediate files inside LOG_DIR.
|
|
20
|
+
EOF
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
24
|
+
show_help
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if [ -z "${1:-}" ]; then
|
|
29
|
+
echo "Error: LOG_PATH argument required." >&2
|
|
30
|
+
show_help
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
RAW_LOG_DIR="$1"
|
|
35
|
+
# Ensure the directory exists before resolving its absolute path
|
|
36
|
+
mkdir -p "$RAW_LOG_DIR"
|
|
37
|
+
LOG_DIR=$(realpath "$RAW_LOG_DIR")
|
|
38
|
+
ADDITIONAL_ASV_ARGS="${2:-}"
|
|
39
|
+
RESULTS_DIR="${LOG_DIR}/results"
|
|
40
|
+
HTML_DIR="${LOG_DIR}/html"
|
|
41
|
+
TARBALL="${LOG_DIR}.tar.gz"
|
|
42
|
+
BASE_SHA_FILE="${LOG_DIR}/sha.txt"
|
|
43
|
+
BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
|
|
44
|
+
|
|
45
|
+
source /etc/profile.d/asv_build_vars.sh || true
|
|
46
|
+
|
|
47
|
+
CURR_DIR="$(pwd)"
|
|
48
|
+
cd /workspace/repo
|
|
49
|
+
|
|
50
|
+
# Best-effort: ensure asv_runner available in task env
|
|
51
|
+
micromamba run -n "$ENV_NAME" uv pip install -q --upgrade asv_runner || true
|
|
52
|
+
|
|
53
|
+
mkdir -p "$LOG_DIR" "$RESULTS_DIR" "$HTML_DIR"
|
|
54
|
+
|
|
55
|
+
COMMIT_SHA="$(git rev-parse HEAD)"
|
|
56
|
+
MACHINE="dockertest"
|
|
57
|
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
58
|
+
|
|
59
|
+
# compute the paths as you already do
|
|
60
|
+
TEST_CONF="$(dirname "$CONF_NAME")/asv.test.conf.json"
|
|
61
|
+
|
|
62
|
+
# make sure the Python process can see them
|
|
63
|
+
export CONF_NAME TEST_CONF RESULTS_DIR HTML_DIR BRANCH_NAME REPO_ROOT
|
|
64
|
+
|
|
65
|
+
# Create a temp constraints file and make pip use it for every install
|
|
66
|
+
|
|
67
|
+
(python - <<'PY'
|
|
68
|
+
import json, os, sys
|
|
69
|
+
from asv.config import Config
|
|
70
|
+
|
|
71
|
+
conf_path = os.environ["CONF_NAME"]
|
|
72
|
+
out_path = os.environ["TEST_CONF"]
|
|
73
|
+
results = os.environ["RESULTS_DIR"]
|
|
74
|
+
html = os.environ["HTML_DIR"]
|
|
75
|
+
|
|
76
|
+
conf = Config.load(conf_path)
|
|
77
|
+
conf.results_dir = results
|
|
78
|
+
conf.html_dir = html
|
|
79
|
+
|
|
80
|
+
# Write out a plain JSON config as before
|
|
81
|
+
fields = [
|
|
82
|
+
"version","project","project_url","repo","repo_subdir","branches",
|
|
83
|
+
"pythons","matrix","exclude","include","environment_type",
|
|
84
|
+
"conda_channels","conda_environment_file","benchmark_dir","env_dir",
|
|
85
|
+
"results_dir","html_dir","show_commit_url","hash_length",
|
|
86
|
+
"build_command","install_command","uninstall_command",
|
|
87
|
+
"regressions_first_commits","regressions_thresholds","plugins"
|
|
88
|
+
]
|
|
89
|
+
data = {k: getattr(conf, k) for k in fields if hasattr(conf, k)}
|
|
90
|
+
data['version'] = 1
|
|
91
|
+
repo_root = os.environ.get('REPO_ROOT')
|
|
92
|
+
if repo_root:
|
|
93
|
+
data['repo'] = repo_root
|
|
94
|
+
|
|
95
|
+
if "environment_type" in data:
|
|
96
|
+
data["environment_type"] = "existing"
|
|
97
|
+
|
|
98
|
+
data["branches"] = [os.environ["BRANCH_NAME"]]
|
|
99
|
+
with open(out_path, "w", encoding="utf-8") as f:
|
|
100
|
+
json.dump(data, f, indent=2)
|
|
101
|
+
PY
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# use the basename $TEST_CONF
|
|
105
|
+
echo "[profile] Running ASV baseline on $COMMIT_SHA"
|
|
106
|
+
# cd into the dirname $TEST_CONF directory
|
|
107
|
+
OLD_DIR="$(pwd)"
|
|
108
|
+
REAL_TEST_CONF="$(realpath "$TEST_CONF")"
|
|
109
|
+
cd "$(dirname "$TEST_CONF")"
|
|
110
|
+
micromamba run -n "$ENV_NAME" asv machine --yes --config "$REAL_TEST_CONF" \
|
|
111
|
+
--machine "$MACHINE" \
|
|
112
|
+
--num_cpu "1" \
|
|
113
|
+
--ram "4GB" | tee "${LOG_DIR}.machine.log"
|
|
114
|
+
|
|
115
|
+
ASV_ARGS=(--config "$REAL_TEST_CONF" -a "rounds=1" -a "repeat=0" --python=same --machine="$MACHINE" --append-samples --show-stderr --set-commit-hash="$COMMIT_SHA")
|
|
116
|
+
# Add additional ASV args if provided (string, might be blank)
|
|
117
|
+
if [ -n "$ADDITIONAL_ASV_ARGS" ]; then
|
|
118
|
+
# shellcheck disable=SC2206
|
|
119
|
+
ASV_ARGS+=($ADDITIONAL_ASV_ARGS)
|
|
120
|
+
fi
|
|
121
|
+
micromamba run -n "$ENV_NAME" asv run "${ASV_ARGS[@]}" | tee "${LOG_DIR}.asv.log" || true
|
|
122
|
+
# Always run just-discover to enumerate benchmarks (coverage removed)
|
|
123
|
+
echo "[profile] Discovering benchmarks"
|
|
124
|
+
micromamba run -n "$ENV_NAME" asv run --bench just-discover --config "$REAL_TEST_CONF" --python=same --machine="$MACHINE" | tee "${LOG_DIR}.asv.log" || true
|
|
125
|
+
# asv publish --config "$REAL_TEST_CONF" | tee "${LOG_DIR}.publish.log" || true
|
|
126
|
+
cd "$OLD_DIR"
|
|
127
|
+
|
|
128
|
+
# Record base SHA for robust compare later
|
|
129
|
+
echo "$COMMIT_SHA" > "$BASE_SHA_FILE"
|
|
130
|
+
|
|
131
|
+
# Bundle everything once
|
|
132
|
+
if [ ! -d "$LOG_DIR" ]; then
|
|
133
|
+
echo "[profile] WARN: log directory missing at $LOG_DIR; skipping tarball" >&2
|
|
134
|
+
else
|
|
135
|
+
if [ -f "$TEST_CONF" ]; then
|
|
136
|
+
TEST_CONF_BASENAME="$(basename "$TEST_CONF")"
|
|
137
|
+
cp "$TEST_CONF" "$LOG_DIR/$TEST_CONF_BASENAME" || \
|
|
138
|
+
echo "[profile] WARN: failed copying $TEST_CONF into $LOG_DIR; tarball will omit it" >&2
|
|
139
|
+
else
|
|
140
|
+
echo "[profile] WARN: expected ASV test config at $TEST_CONF; tarball will omit it" >&2
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
tmp_tar="$(mktemp "$(dirname "$TARBALL")/tmp.tar.XXXXXX")"
|
|
144
|
+
|
|
145
|
+
if tar -czf "$tmp_tar" -C "$(dirname "$LOG_DIR")" "$(basename "$LOG_DIR")"; then
|
|
146
|
+
mv "$tmp_tar" "$TARBALL"
|
|
147
|
+
chmod 644 "$TARBALL" || true
|
|
148
|
+
echo "[profile] Baseline written to $TARBALL"
|
|
149
|
+
else
|
|
150
|
+
rm -f "$tmp_tar"
|
|
151
|
+
echo "[profile] WARN: failed to create $TARBALL" >&2
|
|
152
|
+
fi
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
echo "[profile] Write the list of benchmarks to /workspace/repo/asv_benchmarks.txt"
|
|
156
|
+
cat > get_benchmarks.py << 'EOF'
|
|
157
|
+
from asv.config import Config
|
|
158
|
+
from asv.benchmarks import Benchmarks
|
|
159
|
+
import argparse
|
|
160
|
+
parser = argparse.ArgumentParser()
|
|
161
|
+
parser.add_argument('test_conf', type=str, help='Path to ASV test config file')
|
|
162
|
+
parser.add_argument('--out_file', type=str, help='Output file for list of benchmarks')
|
|
163
|
+
args = parser.parse_args()
|
|
164
|
+
conf = Config.load(args.test_conf)
|
|
165
|
+
bm = Benchmarks.load(conf)
|
|
166
|
+
# print("\n".join(sorted(bm._all_benchmarks.keys())))
|
|
167
|
+
with open(args.out_file, 'w') as f:
|
|
168
|
+
for b in sorted(bm._all_benchmarks.keys()):
|
|
169
|
+
f.write(b + '\n')
|
|
170
|
+
EOF
|
|
171
|
+
|
|
172
|
+
if [ ! -f /workspace/repo/asv_benchmarks.txt ]; then
|
|
173
|
+
micromamba run -n "$ENV_NAME" python get_benchmarks.py "$TEST_CONF" --out_file /workspace/repo/asv_benchmarks.txt
|
|
174
|
+
echo "[profile] Write the list of benchmarks to /workspace/repo/asv_benchmarks.txt"
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
echo "[profile] Cleaning up intermediate files..."
|
|
178
|
+
|
|
179
|
+
# Delete the get_benchmarks.py script
|
|
180
|
+
rm get_benchmarks.py
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# Delete logs
|
|
184
|
+
rm -f "${LOG_DIR}.machine.log" \
|
|
185
|
+
"${LOG_DIR}.asv.log"
|
|
186
|
+
|
|
187
|
+
# Delete ASV config copy
|
|
188
|
+
rm -f "$TEST_CONF"
|
|
189
|
+
|
|
190
|
+
# Delete benchmark result directories
|
|
191
|
+
rm -rf "$RESULTS_DIR" "$HTML_DIR" "$LOG_DIR"
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
# Optionally delete the commit SHA text file if not needed later
|
|
195
|
+
# (comment out the next line if you want to keep sha.txt)
|
|
196
|
+
rm -f "$BASE_SHA_FILE"
|
|
197
|
+
|
|
198
|
+
cd "$CURR_DIR"
|
|
199
|
+
echo "[profile] Cleanup complete. Remaining artifact: $TARBALL"
|