reducio 1.0.0__tar.gz
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.
- reducio-1.0.0/.github/workflows/analysis.yml +183 -0
- reducio-1.0.0/.github/workflows/installation.yml +29 -0
- reducio-1.0.0/.github/workflows/publish.yml +125 -0
- reducio-1.0.0/.github/workflows/test.yml +57 -0
- reducio-1.0.0/.gitignore +71 -0
- reducio-1.0.0/LICENSE +21 -0
- reducio-1.0.0/PKG-INFO +54 -0
- reducio-1.0.0/README.md +18 -0
- reducio-1.0.0/ROADMAP.md +170 -0
- reducio-1.0.0/docs/ADVERTISING_AUDIT.md +106 -0
- reducio-1.0.0/docs/ARCHITECTURE.md +100 -0
- reducio-1.0.0/docs/ASSESSMENT.md +283 -0
- reducio-1.0.0/docs/CI.md +114 -0
- reducio-1.0.0/docs/DESIGN.md +304 -0
- reducio-1.0.0/docs/GITHUB_CI.md +85 -0
- reducio-1.0.0/docs/METRICS.md +94 -0
- reducio-1.0.0/docs/ONBOARDING.md +117 -0
- reducio-1.0.0/docs/README.md +208 -0
- reducio-1.0.0/docs/SAFETY.md +101 -0
- reducio-1.0.0/docs/TEST_IMPLEMENTATION.md +118 -0
- reducio-1.0.0/docs/TEST_RULES.md +123 -0
- reducio-1.0.0/docs/index.html +1186 -0
- reducio-1.0.0/pyproject.toml +84 -0
- reducio-1.0.0/reducio/__init__.py +3 -0
- reducio-1.0.0/reducio/__main__.py +4 -0
- reducio-1.0.0/reducio/agents/__init__.py +17 -0
- reducio-1.0.0/reducio/agents/analyzer.py +17 -0
- reducio-1.0.0/reducio/agents/base.py +138 -0
- reducio-1.0.0/reducio/agents/deduplicator.py +194 -0
- reducio-1.0.0/reducio/agents/idiomatizer.py +243 -0
- reducio-1.0.0/reducio/agents/pattern.py +253 -0
- reducio-1.0.0/reducio/agents/quality_checker.py +309 -0
- reducio-1.0.0/reducio/analysis.py +88 -0
- reducio-1.0.0/reducio/cli.py +548 -0
- reducio-1.0.0/reducio/compare.py +190 -0
- reducio-1.0.0/reducio/config.py +67 -0
- reducio-1.0.0/reducio/diff.py +75 -0
- reducio-1.0.0/reducio/embeddings/__init__.py +16 -0
- reducio-1.0.0/reducio/embeddings/service.py +241 -0
- reducio-1.0.0/reducio/git_safety.py +56 -0
- reducio-1.0.0/reducio/llm/__init__.py +5 -0
- reducio-1.0.0/reducio/llm/router.py +148 -0
- reducio-1.0.0/reducio/metrics.py +218 -0
- reducio-1.0.0/reducio/models.py +263 -0
- reducio-1.0.0/reducio/parse.py +94 -0
- reducio-1.0.0/reducio/plan_review.py +133 -0
- reducio-1.0.0/reducio/progress.py +69 -0
- reducio-1.0.0/reducio/repo.py +110 -0
- reducio-1.0.0/reducio/reporter.py +126 -0
- reducio-1.0.0/reducio/runner.py +52 -0
- reducio-1.0.0/reducio/services.py +177 -0
- reducio-1.0.0/reducio/session.py +289 -0
- reducio-1.0.0/reducio/storage.py +42 -0
- reducio-1.0.0/reducio/utils/__init__.py +5 -0
- reducio-1.0.0/reducio/utils/code_utils.py +45 -0
- reducio-1.0.0/reducio/visual_report.py +497 -0
- reducio-1.0.0/reducio/workspace.py +204 -0
- reducio-1.0.0/scripts/pyapp_release.py +202 -0
- reducio-1.0.0/scripts/smoke_pyapp.py +181 -0
- reducio-1.0.0/scripts/smoke_pypi.py +83 -0
- reducio-1.0.0/test-python-code/README.md +21 -0
- reducio-1.0.0/test-python-code/common_variables_name.txt +32 -0
- reducio-1.0.0/test-python-code/python/duplicates/auth_validator.py +58 -0
- reducio-1.0.0/test-python-code/python/duplicates/user_validator.py +58 -0
- reducio-1.0.0/test-python-code/python/duplicates/utils/validate_email_address_dedup.py +12 -0
- reducio-1.0.0/test-python-code/python/exercise/buildArray.py +27 -0
- reducio-1.0.0/test-python-code/python/exercise/variables_methods_naming_question.py +64 -0
- reducio-1.0.0/test-python-code/python/exercise/variables_methods_naming_solution.py +76 -0
- reducio-1.0.0/test-python-code/python/function/abstract_on_pizza.py +80 -0
- reducio-1.0.0/test-python-code/python/function/descriptif_names_function.py +36 -0
- reducio-1.0.0/test-python-code/python/function/high_complexity.py +160 -0
- reducio-1.0.0/test-python-code/python/function/long_and_repetitive_function.py +97 -0
- reducio-1.0.0/test-python-code/python/function/long_function.py +101 -0
- reducio-1.0.0/test-python-code/python/function/unintended_side_effects.py +28 -0
- reducio-1.0.0/test-python-code/python/patterns/complex_conditionals.py +255 -0
- reducio-1.0.0/test-python-code/python/style/non_idiomatic.py +158 -0
- reducio-1.0.0/test-python-code/python/variable/class_naming_example.py +25 -0
- reducio-1.0.0/test-python-code/python/variable/method_naming_example.py +17 -0
- reducio-1.0.0/test-python-code/python/variable/unpronounceable_variables.py +46 -0
- reducio-1.0.0/test-python-code/python/variable/variable_name_average.py +26 -0
- reducio-1.0.0/test-python-code/python/variable/variable_naming_example.py +16 -0
- reducio-1.0.0/tests/__init__.py +1 -0
- reducio-1.0.0/tests/conftest.py +63 -0
- reducio-1.0.0/tests/e2e/__init__.py +1 -0
- reducio-1.0.0/tests/e2e/test_apply_plan.py +40 -0
- reducio-1.0.0/tests/e2e/test_cli_smoke.py +189 -0
- reducio-1.0.0/tests/e2e/test_review_contracts.py +94 -0
- reducio-1.0.0/tests/scenario/__init__.py +1 -0
- reducio-1.0.0/tests/scenario/test_test_rules.py +149 -0
- reducio-1.0.0/tests/unit/test_analysis_workflow.py +106 -0
- reducio-1.0.0/tests/unit/test_analyzer_hotspots.py +41 -0
- reducio-1.0.0/tests/unit/test_apply_guard.py +29 -0
- reducio-1.0.0/tests/unit/test_apply_idiomatize.py +49 -0
- reducio-1.0.0/tests/unit/test_cli_contracts.py +219 -0
- reducio-1.0.0/tests/unit/test_code_utils.py +8 -0
- reducio-1.0.0/tests/unit/test_compare.py +151 -0
- reducio-1.0.0/tests/unit/test_complexity.py +30 -0
- reducio-1.0.0/tests/unit/test_config.py +161 -0
- reducio-1.0.0/tests/unit/test_deduplicator.py +56 -0
- reducio-1.0.0/tests/unit/test_diff.py +33 -0
- reducio-1.0.0/tests/unit/test_distribution_smoke.py +47 -0
- reducio-1.0.0/tests/unit/test_embeddings.py +70 -0
- reducio-1.0.0/tests/unit/test_git.py +20 -0
- reducio-1.0.0/tests/unit/test_git_nonrepo.py +12 -0
- reducio-1.0.0/tests/unit/test_idiomatizer.py +182 -0
- reducio-1.0.0/tests/unit/test_known_safety_gaps.py +58 -0
- reducio-1.0.0/tests/unit/test_metrics_v2.py +119 -0
- reducio-1.0.0/tests/unit/test_models.py +52 -0
- reducio-1.0.0/tests/unit/test_parse.py +18 -0
- reducio-1.0.0/tests/unit/test_parse_regression.py +17 -0
- reducio-1.0.0/tests/unit/test_pattern_agent.py +121 -0
- reducio-1.0.0/tests/unit/test_plan_contracts.py +292 -0
- reducio-1.0.0/tests/unit/test_progress.py +100 -0
- reducio-1.0.0/tests/unit/test_pyapp_release.py +249 -0
- reducio-1.0.0/tests/unit/test_quality_checker.py +73 -0
- reducio-1.0.0/tests/unit/test_repo.py +19 -0
- reducio-1.0.0/tests/unit/test_reporter.py +101 -0
- reducio-1.0.0/tests/unit/test_router.py +53 -0
- reducio-1.0.0/tests/unit/test_session.py +84 -0
- reducio-1.0.0/tests/unit/test_session_metadata.py +37 -0
- reducio-1.0.0/tests/unit/test_site_presentation.py +139 -0
- reducio-1.0.0/tests/unit/test_visual_report.py +177 -0
- reducio-1.0.0/tests/unit/test_walk_exclusions.py +33 -0
- reducio-1.0.0/tests/unit/test_workspace.py +88 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
name: Analysis
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
overview:
|
|
15
|
+
if: github.event_name != 'pull_request'
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
persist-credentials: false
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.14'
|
|
24
|
+
- name: Install
|
|
25
|
+
run: pip install -e ".[reports]"
|
|
26
|
+
|
|
27
|
+
- name: Analyze package
|
|
28
|
+
run: reducio analyze reducio/ --report --format all --output-dir ci-reports/overview -v
|
|
29
|
+
|
|
30
|
+
- name: Validate structured result
|
|
31
|
+
run: |
|
|
32
|
+
python - <<'PY'
|
|
33
|
+
import json
|
|
34
|
+
from pathlib import Path
|
|
35
|
+
reports = list(Path("ci-reports/overview").glob("*.json"))
|
|
36
|
+
assert len(reports) == 1, "Expected one overview"
|
|
37
|
+
result = json.loads(reports[0].read_text())
|
|
38
|
+
assert result["complete"], "Analysis is incomplete"
|
|
39
|
+
assert result["total_symbols"] > 0 and result["functions"], "Parser produced no functions"
|
|
40
|
+
assert result["total_hotspots"] == len(result["hotspots"])
|
|
41
|
+
PY
|
|
42
|
+
|
|
43
|
+
- name: Quality check
|
|
44
|
+
run: |
|
|
45
|
+
reducio check reducio/ --report --output-dir ci-reports/overview
|
|
46
|
+
|
|
47
|
+
- name: Upload overview
|
|
48
|
+
id: reports
|
|
49
|
+
if: always()
|
|
50
|
+
uses: actions/upload-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: reducio-overview
|
|
53
|
+
path: ci-reports/overview/
|
|
54
|
+
if-no-files-found: warn
|
|
55
|
+
|
|
56
|
+
- name: Job summary
|
|
57
|
+
if: always()
|
|
58
|
+
env:
|
|
59
|
+
REPORT_URL: ${{ steps.reports.outputs.artifact-url }}
|
|
60
|
+
run: |
|
|
61
|
+
for report in ci-reports/overview/*.md; do
|
|
62
|
+
[ -f "$report" ] || continue
|
|
63
|
+
cat "$report" >> "$GITHUB_STEP_SUMMARY"
|
|
64
|
+
echo >> "$GITHUB_STEP_SUMMARY"
|
|
65
|
+
done
|
|
66
|
+
if [ -n "$REPORT_URL" ]; then
|
|
67
|
+
echo "[Download full reports — unzip and open the HTML dashboard]($REPORT_URL)" >> "$GITHUB_STEP_SUMMARY"
|
|
68
|
+
else
|
|
69
|
+
echo "Reports unavailable; inspect the failed step above." >> "$GITHUB_STEP_SUMMARY"
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
publish-pages:
|
|
73
|
+
needs: overview
|
|
74
|
+
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
permissions:
|
|
77
|
+
contents: read
|
|
78
|
+
pages: write
|
|
79
|
+
id-token: write
|
|
80
|
+
environment:
|
|
81
|
+
name: github-pages
|
|
82
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
83
|
+
concurrency:
|
|
84
|
+
group: github-pages
|
|
85
|
+
cancel-in-progress: false
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
with:
|
|
89
|
+
persist-credentials: false
|
|
90
|
+
|
|
91
|
+
- name: Download successful overview
|
|
92
|
+
uses: actions/download-artifact@v4
|
|
93
|
+
with:
|
|
94
|
+
name: reducio-overview
|
|
95
|
+
path: ci-reports/overview/
|
|
96
|
+
|
|
97
|
+
- name: Stage Pages site
|
|
98
|
+
shell: bash
|
|
99
|
+
run: |
|
|
100
|
+
shopt -s nullglob
|
|
101
|
+
reports=(ci-reports/overview/reducio-baseline-*.html)
|
|
102
|
+
if [ "${#reports[@]}" -ne 1 ]; then
|
|
103
|
+
echo "Expected exactly one overview dashboard" >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
mkdir -p ci-reports/pages/dashboard
|
|
107
|
+
cp docs/index.html ci-reports/pages/index.html
|
|
108
|
+
cp "${reports[0]}" ci-reports/pages/dashboard/index.html
|
|
109
|
+
|
|
110
|
+
- name: Configure Pages
|
|
111
|
+
uses: actions/configure-pages@v5
|
|
112
|
+
|
|
113
|
+
- name: Upload Pages site
|
|
114
|
+
uses: actions/upload-pages-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
path: ci-reports/pages/
|
|
117
|
+
|
|
118
|
+
- name: Deploy Pages
|
|
119
|
+
id: deployment
|
|
120
|
+
uses: actions/deploy-pages@v4
|
|
121
|
+
|
|
122
|
+
- name: Dashboard link
|
|
123
|
+
env:
|
|
124
|
+
PAGE_URL: ${{ steps.deployment.outputs.page_url }}
|
|
125
|
+
run: |
|
|
126
|
+
echo "[Open the main-branch dashboard](${PAGE_URL%/}/dashboard/)" >> "$GITHUB_STEP_SUMMARY"
|
|
127
|
+
|
|
128
|
+
comparison:
|
|
129
|
+
if: github.event_name == 'pull_request'
|
|
130
|
+
runs-on: ubuntu-latest
|
|
131
|
+
steps:
|
|
132
|
+
- uses: actions/checkout@v4
|
|
133
|
+
with:
|
|
134
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
135
|
+
fetch-depth: 0
|
|
136
|
+
persist-credentials: false
|
|
137
|
+
- uses: actions/setup-python@v5
|
|
138
|
+
with:
|
|
139
|
+
python-version: '3.14'
|
|
140
|
+
- name: Install
|
|
141
|
+
run: pip install -e ".[reports]"
|
|
142
|
+
|
|
143
|
+
- name: Resolve PR comparison
|
|
144
|
+
id: revisions
|
|
145
|
+
env:
|
|
146
|
+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
147
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
148
|
+
run: |
|
|
149
|
+
MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA")
|
|
150
|
+
echo "base=$MERGE_BASE" >> "$GITHUB_OUTPUT"
|
|
151
|
+
|
|
152
|
+
- name: Compare changed package files
|
|
153
|
+
env:
|
|
154
|
+
BASE_SHA: ${{ steps.revisions.outputs.base }}
|
|
155
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
156
|
+
run: |
|
|
157
|
+
reducio compare reducio/ --base "$BASE_SHA" --head "$HEAD_SHA" \
|
|
158
|
+
--report --format all --output-dir ci-reports/comparison -v
|
|
159
|
+
|
|
160
|
+
- name: Upload comparison
|
|
161
|
+
id: reports
|
|
162
|
+
if: always()
|
|
163
|
+
uses: actions/upload-artifact@v4
|
|
164
|
+
with:
|
|
165
|
+
name: reducio-comparison
|
|
166
|
+
path: ci-reports/comparison/
|
|
167
|
+
if-no-files-found: warn
|
|
168
|
+
|
|
169
|
+
- name: Job summary
|
|
170
|
+
if: always()
|
|
171
|
+
env:
|
|
172
|
+
REPORT_URL: ${{ steps.reports.outputs.artifact-url }}
|
|
173
|
+
run: |
|
|
174
|
+
for report in ci-reports/comparison/*.md; do
|
|
175
|
+
[ -f "$report" ] || continue
|
|
176
|
+
cat "$report" >> "$GITHUB_STEP_SUMMARY"
|
|
177
|
+
echo >> "$GITHUB_STEP_SUMMARY"
|
|
178
|
+
done
|
|
179
|
+
if [ -n "$REPORT_URL" ]; then
|
|
180
|
+
echo "[Download full reports — unzip and open the HTML dashboard]($REPORT_URL)" >> "$GITHUB_STEP_SUMMARY"
|
|
181
|
+
else
|
|
182
|
+
echo "Comparison unavailable; inspect the failed step above." >> "$GITHUB_STEP_SUMMARY"
|
|
183
|
+
fi
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Installation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
install:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: '3.14'
|
|
17
|
+
- run: pip install -e ".[embeddings]"
|
|
18
|
+
- run: reducio version
|
|
19
|
+
- run: python -c "import reducio; print(reducio.__version__)"
|
|
20
|
+
|
|
21
|
+
wheel:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.14'
|
|
28
|
+
- run: pip install build && python -m build
|
|
29
|
+
- run: pip install dist/*.whl && reducio --help
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: publish-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
pypi:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
id-token: write
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.14'
|
|
25
|
+
- run: pip install build
|
|
26
|
+
- run: python -m build
|
|
27
|
+
- name: Save the wheel being published
|
|
28
|
+
uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: published-wheel-${{ github.run_attempt }}
|
|
31
|
+
path: dist/*.whl
|
|
32
|
+
if-no-files-found: error
|
|
33
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
34
|
+
|
|
35
|
+
verify-pypi:
|
|
36
|
+
needs: pypi
|
|
37
|
+
runs-on: ubuntu-22.04
|
|
38
|
+
timeout-minutes: 30
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
with:
|
|
42
|
+
ref: ${{ github.sha }}
|
|
43
|
+
persist-credentials: false
|
|
44
|
+
- uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: '3.14'
|
|
47
|
+
- run: python -m pip install packaging
|
|
48
|
+
- uses: actions/download-artifact@v4
|
|
49
|
+
with:
|
|
50
|
+
pattern: published-wheel-*
|
|
51
|
+
path: wheels
|
|
52
|
+
- name: Verify the published wheel in isolation
|
|
53
|
+
run: python -m scripts.smoke_pypi --wheel-directory wheels --commit "$(git rev-parse HEAD)"
|
|
54
|
+
|
|
55
|
+
pyapp:
|
|
56
|
+
needs: [pypi, verify-pypi]
|
|
57
|
+
runs-on: ubuntu-22.04
|
|
58
|
+
timeout-minutes: 45
|
|
59
|
+
permissions:
|
|
60
|
+
contents: write
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
with:
|
|
64
|
+
ref: ${{ github.sha }}
|
|
65
|
+
persist-credentials: false
|
|
66
|
+
- uses: actions/setup-python@v5
|
|
67
|
+
with:
|
|
68
|
+
python-version: '3.14'
|
|
69
|
+
- run: python -m pip install packaging
|
|
70
|
+
# A failed-job rerun keeps the successful PyPI job's original artifact.
|
|
71
|
+
- uses: actions/download-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
pattern: published-wheel-*
|
|
74
|
+
path: wheels
|
|
75
|
+
- name: Identify the published package and commit
|
|
76
|
+
id: package
|
|
77
|
+
run: |
|
|
78
|
+
python scripts/pyapp_release.py metadata \
|
|
79
|
+
--wheel-directory wheels --commit "$(git rev-parse HEAD)" \
|
|
80
|
+
--output "$GITHUB_OUTPUT"
|
|
81
|
+
- name: Set up Rust stable
|
|
82
|
+
run: |
|
|
83
|
+
rustup toolchain install stable --profile minimal
|
|
84
|
+
rustup default stable
|
|
85
|
+
- name: Build PyApp executable
|
|
86
|
+
env:
|
|
87
|
+
PYAPP_PROJECT_PATH: ${{ steps.package.outputs.wheel }}
|
|
88
|
+
PYAPP_EXEC_SPEC: reducio.cli:app
|
|
89
|
+
PYAPP_PYTHON_VERSION: '3.14'
|
|
90
|
+
PYAPP_DISTRIBUTION_VARIANT_CPU: v1
|
|
91
|
+
PYAPP_PROJECT_FEATURES: reports,embeddings
|
|
92
|
+
PYAPP_SELF_COMMAND: none
|
|
93
|
+
PYAPP_VERSION: '0.29.0'
|
|
94
|
+
BINARY_NAME: ${{ steps.package.outputs.binary_name }}
|
|
95
|
+
run: |
|
|
96
|
+
curl --fail --silent --show-error --location \
|
|
97
|
+
"https://github.com/ofek/pyapp/releases/download/v${PYAPP_VERSION}/source.tar.gz" \
|
|
98
|
+
--output "$RUNNER_TEMP/pyapp-source.tar.gz"
|
|
99
|
+
mkdir -p "$RUNNER_TEMP/pyapp-source"
|
|
100
|
+
tar -xzf "$RUNNER_TEMP/pyapp-source.tar.gz" \
|
|
101
|
+
--directory "$RUNNER_TEMP/pyapp-source" --strip-components=1
|
|
102
|
+
cargo build --release --locked \
|
|
103
|
+
--manifest-path "$RUNNER_TEMP/pyapp-source/Cargo.toml" \
|
|
104
|
+
--target x86_64-unknown-linux-gnu
|
|
105
|
+
mkdir -p executable
|
|
106
|
+
install -m 755 \
|
|
107
|
+
"$RUNNER_TEMP/pyapp-source/target/x86_64-unknown-linux-gnu/release/pyapp" \
|
|
108
|
+
"executable/$BINARY_NAME"
|
|
109
|
+
- name: Smoke-test the executable and optional features
|
|
110
|
+
env:
|
|
111
|
+
BINARY_NAME: ${{ steps.package.outputs.binary_name }}
|
|
112
|
+
PACKAGE_VERSION: ${{ steps.package.outputs.version }}
|
|
113
|
+
run: |
|
|
114
|
+
python scripts/smoke_pyapp.py \
|
|
115
|
+
"executable/$BINARY_NAME" "$PACKAGE_VERSION"
|
|
116
|
+
- name: Publish executable to GitHub Releases
|
|
117
|
+
env:
|
|
118
|
+
GH_TOKEN: ${{ github.token }}
|
|
119
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
120
|
+
RELEASE_COMMIT: ${{ steps.package.outputs.commit }}
|
|
121
|
+
run: |
|
|
122
|
+
python scripts/pyapp_release.py publish \
|
|
123
|
+
--wheel-directory wheels --commit "$RELEASE_COMMIT" \
|
|
124
|
+
--tag "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
|
|
125
|
+
--asset-directory executable --summary "$GITHUB_STEP_SUMMARY"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
tags: ['v*']
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: '3.14'
|
|
20
|
+
|
|
21
|
+
- name: Install
|
|
22
|
+
run: pip install -e ".[dev,embeddings,reports]"
|
|
23
|
+
|
|
24
|
+
- name: Tests
|
|
25
|
+
run: pytest tests/ -v
|
|
26
|
+
|
|
27
|
+
- name: Assert fixture corpus unmodified
|
|
28
|
+
run: git diff --exit-code test-python-code/
|
|
29
|
+
|
|
30
|
+
- name: CLI smoke
|
|
31
|
+
run: reducio --help && reducio version
|
|
32
|
+
|
|
33
|
+
lint:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: '3.14'
|
|
40
|
+
- run: pip install -e ".[dev]"
|
|
41
|
+
- run: ruff check reducio/
|
|
42
|
+
- run: black --check reducio/
|
|
43
|
+
- run: mypy reducio/ --ignore-missing-imports
|
|
44
|
+
|
|
45
|
+
build:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
needs: [test, lint]
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
- uses: actions/setup-python@v5
|
|
51
|
+
with:
|
|
52
|
+
python-version: '3.14'
|
|
53
|
+
- run: pip install build && python -m build
|
|
54
|
+
- uses: actions/upload-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: dist
|
|
57
|
+
path: dist/
|
reducio-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# If you prefer the allow list template instead of the deny list, see community template:
|
|
2
|
+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
|
3
|
+
#
|
|
4
|
+
# Binaries for programs and plugins
|
|
5
|
+
*.exe
|
|
6
|
+
*.exe~
|
|
7
|
+
*.dll
|
|
8
|
+
*.so
|
|
9
|
+
*.dylib
|
|
10
|
+
/reducio$
|
|
11
|
+
!/reducio/
|
|
12
|
+
|
|
13
|
+
# Test binary, built with `go test -c`
|
|
14
|
+
*.test
|
|
15
|
+
|
|
16
|
+
# Code coverage profiles and other test artifacts
|
|
17
|
+
*.out
|
|
18
|
+
.coverage
|
|
19
|
+
coverage.*
|
|
20
|
+
*.coverprofile
|
|
21
|
+
profile.cov
|
|
22
|
+
|
|
23
|
+
# Dependency directories (remove the comment below to include it)
|
|
24
|
+
# vendor/
|
|
25
|
+
|
|
26
|
+
# Go workspace file
|
|
27
|
+
go.work
|
|
28
|
+
go.work.sum
|
|
29
|
+
|
|
30
|
+
# env file
|
|
31
|
+
.env
|
|
32
|
+
|
|
33
|
+
# Editor/IDE
|
|
34
|
+
# .idea/
|
|
35
|
+
# .vscode/
|
|
36
|
+
|
|
37
|
+
# Python
|
|
38
|
+
__pycache__/
|
|
39
|
+
*.py[cod]
|
|
40
|
+
*$py.class
|
|
41
|
+
*.so
|
|
42
|
+
.Python
|
|
43
|
+
build/
|
|
44
|
+
develop-eggs/
|
|
45
|
+
dist/
|
|
46
|
+
downloads/
|
|
47
|
+
eggs/
|
|
48
|
+
.eggs/
|
|
49
|
+
lib/
|
|
50
|
+
lib64/
|
|
51
|
+
parts/
|
|
52
|
+
sdist/
|
|
53
|
+
var/
|
|
54
|
+
wheels/
|
|
55
|
+
*.egg-info/
|
|
56
|
+
.installed.cfg
|
|
57
|
+
*.egg
|
|
58
|
+
.venv/
|
|
59
|
+
venv/
|
|
60
|
+
ENV/
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
.mypy_cache/
|
|
63
|
+
.ruff_cache/
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
AGENTS.md
|
|
67
|
+
.reducio*
|
|
68
|
+
.reducio/
|
|
69
|
+
# Preserve ignored reports/configuration from before the rename.
|
|
70
|
+
.reducto*
|
|
71
|
+
ci-reports/
|
reducio-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Karsten
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
reducio-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: reducio
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Semantic code compression engine
|
|
5
|
+
Project-URL: Repository, https://github.com/mementomorri/reducio
|
|
6
|
+
Project-URL: Documentation, https://github.com/mementomorri/reducio/blob/main/docs/README.md
|
|
7
|
+
Author: Alex Karsten
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Requires-Python: >=3.14
|
|
13
|
+
Requires-Dist: gitpython>=3.1.0
|
|
14
|
+
Requires-Dist: litellm>=1.0.0
|
|
15
|
+
Requires-Dist: pydantic>=2.0.0
|
|
16
|
+
Requires-Dist: pyyaml>=6.0
|
|
17
|
+
Requires-Dist: tenacity>=8.0.0
|
|
18
|
+
Requires-Dist: tree-sitter-python>=0.21.0
|
|
19
|
+
Requires-Dist: tree-sitter>=0.21.0
|
|
20
|
+
Requires-Dist: typer>=0.12.0
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: coverage[toml]>=7.10.6; extra == 'dev'
|
|
24
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-mock>=3.11.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
30
|
+
Provides-Extra: embeddings
|
|
31
|
+
Requires-Dist: chromadb>=1.5.0; extra == 'embeddings'
|
|
32
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == 'embeddings'
|
|
33
|
+
Provides-Extra: reports
|
|
34
|
+
Requires-Dist: plotly<8,>=6; extra == 'reports'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# reducio
|
|
38
|
+
|
|
39
|
+
**Semantic code compression for Python codebases.**
|
|
40
|
+
|
|
41
|
+
Install, usage, and architecture: **[docs/README.md](docs/README.md)**
|
|
42
|
+
What's shipped vs planned: **[ROADMAP.md](ROADMAP.md)**
|
|
43
|
+
|
|
44
|
+
Start with the [GitHub CI setup guide](docs/GITHUB_CI.md) for reports and revision
|
|
45
|
+
comparisons. The other supported routes are PyPI and a GitHub Releases executable;
|
|
46
|
+
the distribution, CLI, and Python import are all **`reducio`**.
|
|
47
|
+
The first publication is pending; see [installation status](docs/README.md#2-pypi).
|
|
48
|
+
Counting rules: [Metrics v2](docs/METRICS.md).
|
|
49
|
+
|
|
50
|
+
Requires **Python 3.14+**. Only **`.py`** files in the target repository are analyzed.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
[MIT](LICENSE) © 2026 Alex Karsten
|
reducio-1.0.0/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# reducio
|
|
2
|
+
|
|
3
|
+
**Semantic code compression for Python codebases.**
|
|
4
|
+
|
|
5
|
+
Install, usage, and architecture: **[docs/README.md](docs/README.md)**
|
|
6
|
+
What's shipped vs planned: **[ROADMAP.md](ROADMAP.md)**
|
|
7
|
+
|
|
8
|
+
Start with the [GitHub CI setup guide](docs/GITHUB_CI.md) for reports and revision
|
|
9
|
+
comparisons. The other supported routes are PyPI and a GitHub Releases executable;
|
|
10
|
+
the distribution, CLI, and Python import are all **`reducio`**.
|
|
11
|
+
The first publication is pending; see [installation status](docs/README.md#2-pypi).
|
|
12
|
+
Counting rules: [Metrics v2](docs/METRICS.md).
|
|
13
|
+
|
|
14
|
+
Requires **Python 3.14+**. Only **`.py`** files in the target repository are analyzed.
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
|
|
18
|
+
[MIT](LICENSE) © 2026 Alex Karsten
|