fabricatio 0.4.0.dev0__tar.gz → 0.4.0.dev2__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.
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/.github/workflows/build-package.yaml +1 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/Cargo.toml +0 -1
- fabricatio-0.4.0.dev2/Makefile +33 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/PKG-INFO +1 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/pyproject.toml +10 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/pyproject.toml +10 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/pyproject.toml +10 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/pyproject.toml +11 -1
- fabricatio-0.4.0.dev2/publish_subpackages.py +146 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/pyproject.toml +1 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/toolboxes/__init__.py +1 -1
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/uv.lock +248 -8
- fabricatio-0.4.0.dev0/Makefile +0 -31
- fabricatio-0.4.0.dev0/publish_subpackages.py +0 -51
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/.github/workflows/ruff.yaml +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/.github/workflows/tests.yaml +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/Cargo.lock +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/LICENSE +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/README.md +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/correct/correct.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/correct/correct_loop.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_and_inject/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_and_inject/article_rag.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_and_inject/ask.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_and_inject/chunk_article.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_and_inject/extract_and_inject.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/extract_article/extract.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/llm_usages/llm_usage.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/make_a_rating/rating.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/make_diary/commits.json +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/make_diary/diary.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/minor/hello_fabricatio.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/minor/write_a_poem.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/propose_task/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/propose_task/propose.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/reviewer/censor.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/reviewer/review.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/rules/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/rules/draft_ruleset.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/search_bibtex/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/search_bibtex/search.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/simple_chat/chat.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/simple_rag/simple_rag.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/task_handle/handle_task.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_article/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_article/article_rag.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_article/post_process.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_article/write_article.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_outline/.gitignore +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_outline/write_outline.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/examples/write_outline/write_outline_corrected.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/LICENSE +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/README.md +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/actions/fs.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/actions/output.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/models/generic.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-actions/python/fabricatio_actions/py.typed +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/LICENSE +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/README.md +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/correct.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/capabilities/review.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/models/improve.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/models/kwargs_types.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/models/problem.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-improve/python/fabricatio_improve/py.typed +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/LICENSE +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/README.md +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/python/fabricatio_judge/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/python/fabricatio_judge/capabilities/advanced_judge.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/python/fabricatio_judge/models/advanced_judge.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-judge/python/fabricatio_judge/py.typed +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/LICENSE +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/README.md +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/actions/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/actions/rules.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/censor.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/capabilities/check.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/models/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/models/kwargs_types.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/models/patch.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/models/rule.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/packages/fabricatio-rule/python/fabricatio_rule/py.typed +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/py.typed +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/toolboxes/arithmetic.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/toolboxes/fs.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/workflows/__init__.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/python/fabricatio/workflows/rag.py +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/src/lib.rs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/as_prompt.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/binary-exploitation-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/chap_summary.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/check_string.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/claude-xml.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/clean-up-code.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/co_validation.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/create_json_obj.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/cryptography-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/dependencies.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/document-the-code.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/draft_rating_criteria.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/draft_rating_manual.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/draft_rating_weights_klee.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/draft_tool_usage_code.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/extract.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/extract_criteria_from_reasons.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/extract_reasons_from_examples.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/find-security-vulnerabilities.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/fix-bugs.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/fix_troubled_obj.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/fix_troubled_string.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/generic_string.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/improve-performance.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/liststr.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/make_choice.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/make_judgment.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/pathstr.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/rate_fine_grind.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/refactor.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/refined_query.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/research_content_summary.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/retrieved_display.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/reverse-engineering-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/review_string.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/rule_requirement.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/ruleset_requirement_breakdown.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/task_briefing.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/web-ctf-solver.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/write-git-commit.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/write-github-pull-request.hbs +0 -0
- {fabricatio-0.4.0.dev0 → fabricatio-0.4.0.dev2}/templates/built-in/write-github-readme.hbs +0 -0
@@ -105,7 +105,7 @@ jobs:
|
|
105
105
|
|
106
106
|
- name: Install deps
|
107
107
|
run: |
|
108
|
-
uv sync --no-install-project
|
108
|
+
uv sync --no-install-project --only-dev --index https://pypi.org/simple -p ${{ matrix.python-version }}
|
109
109
|
|
110
110
|
- name: Build
|
111
111
|
run: |
|
@@ -0,0 +1,33 @@
|
|
1
|
+
DIST:=dist
|
2
|
+
DATA:=extra
|
3
|
+
PY:=3.13
|
4
|
+
|
5
|
+
|
6
|
+
all:bdist
|
7
|
+
|
8
|
+
dirs:
|
9
|
+
mkdir -p $(DIST) $(DATA)
|
10
|
+
|
11
|
+
|
12
|
+
dev:
|
13
|
+
cargo build --workspace --bins -r -Z unstable-options --artifact-dir $(DATA)/scripts
|
14
|
+
rm $(DATA)/scripts/*.pdb |true
|
15
|
+
rm $(DATA)/scripts/*.dwarf |true
|
16
|
+
uvx -p $(PY) --project . maturin develop --uv -r
|
17
|
+
|
18
|
+
bdist: dirs clean dev
|
19
|
+
uvx -p $(PY) --project . maturin build --sdist -r -o $(DIST)
|
20
|
+
uv run publish_subpackages.py --no-publish
|
21
|
+
|
22
|
+
clean:
|
23
|
+
rm -rf $(DIST)/* $(DATA)/*
|
24
|
+
|
25
|
+
|
26
|
+
test:dev
|
27
|
+
uvx -p $(PY) --project . pytest tests
|
28
|
+
|
29
|
+
publish:
|
30
|
+
uv run publish_subpackages.py
|
31
|
+
|
32
|
+
|
33
|
+
.PHONY: dev bdist clean publish test
|
@@ -3,6 +3,10 @@ name = "fabricatio-actions"
|
|
3
3
|
version = "0.1.0"
|
4
4
|
description = "Add your description here"
|
5
5
|
readme = "README.md"
|
6
|
+
license = { file = "LICENSE" }
|
7
|
+
authors = [
|
8
|
+
{ name = "Whth", email = "zettainspector@foxmail.com" }
|
9
|
+
]
|
6
10
|
requires-python = ">=3.12,<3.14"
|
7
11
|
|
8
12
|
dependencies = [
|
@@ -16,4 +20,9 @@ requires = ["hatchling"]
|
|
16
20
|
build-backend = "hatchling.build"
|
17
21
|
|
18
22
|
[tool.hatch.build.targets.wheel]
|
19
|
-
sources = ["python"]
|
23
|
+
sources = ["python"]
|
24
|
+
|
25
|
+
[project.urls]
|
26
|
+
Homepage = "https://github.com/Whth/fabricatio"
|
27
|
+
Repository = "https://github.com/Whth/fabricatio"
|
28
|
+
Issues = "https://github.com/Whth/fabricatio/issues"
|
@@ -3,6 +3,10 @@ name = "fabricatio-improve"
|
|
3
3
|
version = "0.1.0"
|
4
4
|
description = "Add your description here"
|
5
5
|
readme = "README.md"
|
6
|
+
license = { file = "LICENSE" }
|
7
|
+
authors = [
|
8
|
+
{ name = "Whth", email = "zettainspector@foxmail.com" }
|
9
|
+
]
|
6
10
|
requires-python = ">=3.12,<3.14"
|
7
11
|
|
8
12
|
dependencies = [
|
@@ -17,4 +21,9 @@ requires = ["hatchling"]
|
|
17
21
|
build-backend = "hatchling.build"
|
18
22
|
|
19
23
|
[tool.hatch.build.targets.wheel]
|
20
|
-
sources = ["python"]
|
24
|
+
sources = ["python"]
|
25
|
+
|
26
|
+
[project.urls]
|
27
|
+
Homepage = "https://github.com/Whth/fabricatio"
|
28
|
+
Repository = "https://github.com/Whth/fabricatio"
|
29
|
+
Issues = "https://github.com/Whth/fabricatio/issues"
|
@@ -3,6 +3,10 @@ name = "fabricatio-judge"
|
|
3
3
|
version = "0.1.0"
|
4
4
|
description = "Add your description here"
|
5
5
|
readme = "README.md"
|
6
|
+
license = { file = "LICENSE" }
|
7
|
+
authors = [
|
8
|
+
{ name = "Whth", email = "zettainspector@foxmail.com" }
|
9
|
+
]
|
6
10
|
requires-python = ">=3.12,<3.14"
|
7
11
|
|
8
12
|
dependencies = [
|
@@ -16,4 +20,9 @@ requires = ["hatchling"]
|
|
16
20
|
build-backend = "hatchling.build"
|
17
21
|
|
18
22
|
[tool.hatch.build.targets.wheel]
|
19
|
-
sources = ["python"]
|
23
|
+
sources = ["python"]
|
24
|
+
|
25
|
+
[project.urls]
|
26
|
+
Homepage = "https://github.com/Whth/fabricatio"
|
27
|
+
Repository = "https://github.com/Whth/fabricatio"
|
28
|
+
Issues = "https://github.com/Whth/fabricatio/issues"
|
@@ -2,6 +2,10 @@
|
|
2
2
|
name = "fabricatio-rule"
|
3
3
|
version = "0.1.0"
|
4
4
|
description = "Add your description here"
|
5
|
+
license = { file = "LICENSE" }
|
6
|
+
authors = [
|
7
|
+
{ name = "Whth", email = "zettainspector@foxmail.com" }
|
8
|
+
]
|
5
9
|
readme = "README.md"
|
6
10
|
requires-python = ">=3.12,<3.14"
|
7
11
|
|
@@ -24,4 +28,10 @@ sources = ["python"]
|
|
24
28
|
fabricatio-core = { workspace = true }
|
25
29
|
fabricatio-improve = { workspace = true }
|
26
30
|
fabricatio-judge = { workspace = true }
|
27
|
-
fabricatio-capabilities = { workspace = true }
|
31
|
+
fabricatio-capabilities = { workspace = true }
|
32
|
+
|
33
|
+
|
34
|
+
[project.urls]
|
35
|
+
Homepage = "https://github.com/Whth/fabricatio"
|
36
|
+
Repository = "https://github.com/Whth/fabricatio"
|
37
|
+
Issues = "https://github.com/Whth/fabricatio/issues"
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import argparse
|
2
|
+
import subprocess
|
3
|
+
import tomllib
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import Optional, Tuple, List, Dict, Any
|
6
|
+
|
7
|
+
ROOT_DIR = Path("packages").resolve() # Default root directory
|
8
|
+
DIST = Path("dist").resolve()
|
9
|
+
|
10
|
+
|
11
|
+
def parse_pyproject(pyproject_path: Path) -> Optional[Tuple[str, str, Dict[str, Any]]]:
|
12
|
+
"""Parses the pyproject.toml file and returns build backend and project name."""
|
13
|
+
try:
|
14
|
+
with pyproject_path.open("rb") as f:
|
15
|
+
config = tomllib.load(f)
|
16
|
+
build_system = config.get("build-system", {})
|
17
|
+
build_backend = build_system.get("build-backend", "")
|
18
|
+
project_name = config.get("project", {}).get("name")
|
19
|
+
if not project_name:
|
20
|
+
print(f"⚠️ Project name not found in {pyproject_path.parent.name}")
|
21
|
+
return None
|
22
|
+
return build_backend, project_name, config
|
23
|
+
except Exception as e:
|
24
|
+
print(f"⚠️ Failed to parse pyproject.toml in {pyproject_path.parent.name}: {e}")
|
25
|
+
return None
|
26
|
+
|
27
|
+
|
28
|
+
def build_command(project_name: str, entry: Path, build_backend: str) -> List[str]:
|
29
|
+
"""Builds the command list based on the build backend."""
|
30
|
+
if build_backend == "maturin":
|
31
|
+
# The following line was present in the original code but is not valid Python.
|
32
|
+
# It appears to be a comment or a command meant for manual execution for a specific package.
|
33
|
+
# uvx --directory .\packages\fabricatio-core\ maturin publish --skip-existing
|
34
|
+
return [
|
35
|
+
["uvx", "--project", project_name, "--directory", entry.as_posix(), "maturin", "develop", "--uv", "-r", ],
|
36
|
+
|
37
|
+
["uvx", "--project", project_name, "--directory", entry.as_posix(),
|
38
|
+
|
39
|
+
"maturin", "build", "-r",
|
40
|
+
"--sdist", "-o", DIST.as_posix()]]
|
41
|
+
else:
|
42
|
+
# uvx --project fabricatio-judge --directory .\packages\fabricatio-judge\ uv build
|
43
|
+
return [["uvx", "--project", project_name, "--directory", entry.as_posix(), "uv",
|
44
|
+
"build"]] # Assuming uv publish expects the path to the package dir
|
45
|
+
|
46
|
+
|
47
|
+
def run_build_command(command: List[List[str]], project_name: str, entry: Path, build_backend: str) -> None:
|
48
|
+
"""Runs the build command."""
|
49
|
+
for c in command:
|
50
|
+
print(f"🚀 Running command: {' '.join(c)}")
|
51
|
+
try:
|
52
|
+
subprocess.run(c, check=True)
|
53
|
+
print(f"✅ Successfully built {project_name}")
|
54
|
+
except subprocess.CalledProcessError as e:
|
55
|
+
print(f"❌ Build failed for {project_name}: {e}")
|
56
|
+
except FileNotFoundError:
|
57
|
+
print(f"❌ Command '{c[0]}' not found. Make sure it's installed and in your PATH.")
|
58
|
+
|
59
|
+
|
60
|
+
def _validate_project_entry(entry: Path) -> Optional[Path]:
|
61
|
+
"""Validates if the entry is a directory and contains pyproject.toml."""
|
62
|
+
if not entry.is_dir():
|
63
|
+
return None
|
64
|
+
pyproject_path = entry / "pyproject.toml"
|
65
|
+
if not pyproject_path.is_file():
|
66
|
+
return None
|
67
|
+
return pyproject_path
|
68
|
+
|
69
|
+
|
70
|
+
def _build_project(project_name: str, entry: Path, build_backend: str) -> None:
|
71
|
+
"""Builds the specified project."""
|
72
|
+
command = build_command(project_name, entry, build_backend)
|
73
|
+
run_build_command(command, project_name, entry, build_backend)
|
74
|
+
|
75
|
+
|
76
|
+
def _publish_project(project_name: str) -> None:
|
77
|
+
"""Publishes the built packages for the project."""
|
78
|
+
for package_file in DIST.glob(f"{project_name.replace('-', '_')}*.*"):
|
79
|
+
if package_file.suffix in ('.whl', '.tar.gz'):
|
80
|
+
publish_command = ["uv", "publish", package_file.as_posix()]
|
81
|
+
print(f"🚀 Publishing: {' '.join(publish_command)}")
|
82
|
+
try:
|
83
|
+
subprocess.run(publish_command, check=True)
|
84
|
+
print(f"✅ Successfully published {package_file.name}")
|
85
|
+
except subprocess.CalledProcessError as e:
|
86
|
+
print(f"❌ Failed to publish {package_file.name}: {e}")
|
87
|
+
except FileNotFoundError:
|
88
|
+
print(f"❌ Command 'uv' not found. Make sure it's installed and in your PATH.")
|
89
|
+
|
90
|
+
|
91
|
+
def process_project(entry: Path, publish_enabled: bool) -> None:
|
92
|
+
"""Processes a single project directory: validates, builds, and optionally publishes it."""
|
93
|
+
pyproject_path = _validate_project_entry(entry)
|
94
|
+
if not pyproject_path:
|
95
|
+
return
|
96
|
+
|
97
|
+
print(f"\n🔍 Checking project: {entry.name}")
|
98
|
+
|
99
|
+
parsed_info = parse_pyproject(pyproject_path)
|
100
|
+
if not parsed_info:
|
101
|
+
return
|
102
|
+
|
103
|
+
build_backend, project_name, _ = parsed_info
|
104
|
+
print(f"📦 Project: {project_name}, Build backend: {build_backend}")
|
105
|
+
|
106
|
+
_build_project(project_name, entry, build_backend)
|
107
|
+
|
108
|
+
if publish_enabled:
|
109
|
+
_publish_project(project_name)
|
110
|
+
else:
|
111
|
+
print(f"📦 Skipping publish for {project_name} as per configuration.")
|
112
|
+
|
113
|
+
|
114
|
+
def main():
|
115
|
+
parser = argparse.ArgumentParser(description="Build and optionally publish Python subpackages.")
|
116
|
+
parser.add_argument(
|
117
|
+
"--root-dir",
|
118
|
+
type=Path,
|
119
|
+
default=ROOT_DIR,
|
120
|
+
help="The root directory containing the subpackages.",
|
121
|
+
)
|
122
|
+
parser.add_argument(
|
123
|
+
"--no-publish",
|
124
|
+
action="store_false",
|
125
|
+
dest="publish",
|
126
|
+
help="Disable publishing of the built packages.",
|
127
|
+
)
|
128
|
+
parser.set_defaults(publish=True)
|
129
|
+
|
130
|
+
args = parser.parse_args()
|
131
|
+
|
132
|
+
root_dir = args.root_dir.resolve()
|
133
|
+
publish_enabled = args.publish
|
134
|
+
|
135
|
+
DIST.mkdir(parents=True, exist_ok=True)
|
136
|
+
|
137
|
+
if not root_dir.is_dir():
|
138
|
+
print(f"❌ Root directory '{root_dir}' not found.")
|
139
|
+
return
|
140
|
+
|
141
|
+
for entry in root_dir.iterdir():
|
142
|
+
process_project(entry, publish_enabled)
|
143
|
+
|
144
|
+
|
145
|
+
if __name__ == "__main__":
|
146
|
+
main()
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
from typing import Set
|
4
4
|
|
5
|
-
from fabricatio.models.tool import ToolBox
|
6
5
|
from fabricatio.toolboxes.arithmetic import arithmetic_toolbox
|
7
6
|
from fabricatio.toolboxes.fs import fs_toolbox
|
7
|
+
from fabricatio_core.models.tool import ToolBox
|
8
8
|
|
9
9
|
basic_toolboxes: Set[ToolBox] = {arithmetic_toolbox}
|
10
10
|
|