From 68fd7af9ed0143cf0b21a9b26b81d1a81ced8718 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sun, 10 May 2026 20:38:08 -0700 Subject: [PATCH] Convert to generated README infrastructure Signed-off-by: Jeongseok Lee --- .github/ISSUE_TEMPLATE/config.yml | 2 + .github/ISSUE_TEMPLATE/report-issue.yml | 30 +++++++++++ .github/ISSUE_TEMPLATE/suggest-resource.yml | 58 +++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 18 +++++++ .github/dependabot.yml | 7 +++ .github/workflows/protect-readme.yml | 39 ++++++++++++++ .github/workflows/validate-and-generate.yml | 15 ++++++ CONTRIBUTING.md | 35 +++++++++++++ README.md | 25 ++++++++- awesome-list.yaml | 3 ++ data/readme.yaml | 47 +++++++++++++++++ scripts/generate_readme.py | 5 ++ scripts/validate_entries.py | 5 ++ 13 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/report-issue.yml create mode 100644 .github/ISSUE_TEMPLATE/suggest-resource.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/protect-readme.yml create mode 100644 .github/workflows/validate-and-generate.yml create mode 100644 CONTRIBUTING.md create mode 100644 awesome-list.yaml create mode 100644 data/readme.yaml create mode 100644 scripts/generate_readme.py create mode 100644 scripts/validate_entries.py diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..99d680b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,2 @@ +blank_issues_enabled: false + diff --git a/.github/ISSUE_TEMPLATE/report-issue.yml b/.github/ISSUE_TEMPLATE/report-issue.yml new file mode 100644 index 0000000..b182459 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/report-issue.yml @@ -0,0 +1,30 @@ +name: Report an Issue +description: Report a broken link, incorrect information, or other issue +labels: ["bug"] +body: + - type: dropdown + id: type + attributes: + label: Issue Type + options: + - Broken link + - Incorrect information + - Missing information + - Other + validations: + required: true + + - type: input + id: entry + attributes: + label: Affected Entry + description: Which resource or section is affected? + + - type: textarea + id: description + attributes: + label: Description + description: Describe the issue. + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/suggest-resource.yml b/.github/ISSUE_TEMPLATE/suggest-resource.yml new file mode 100644 index 0000000..65a0e67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/suggest-resource.yml @@ -0,0 +1,58 @@ +name: Suggest a Resource +description: Suggest a resource to add to this awesome list +title: "[Suggestion] " +labels: ["suggestion"] +body: + - type: input + id: name + attributes: + label: Resource Name + validations: + required: true + + - type: input + id: url + attributes: + label: URL + description: Primary project, paper, article, or landing-page URL. + validations: + required: true + + - type: input + id: github + attributes: + label: GitHub Repository + description: "GitHub `owner/repo` slug if available. Leave blank for non-GitHub resources." + placeholder: owner/repo + + - type: input + id: category + attributes: + label: Category + description: Existing section or subsection where this resource belongs. + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + description: Short factual description. + validations: + required: true + + - type: textarea + id: why + attributes: + label: Why should it be included? + description: Explain why this is a strong fit for the list. + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: Publicly accessible + - label: Not a duplicate of an existing entry + - label: Has a meaningful description + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..00215e4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ + + +## What does this PR do? + +## Checklist + +- [ ] I edited YAML/source files, not `README.md` directly +- [ ] Entry added in the correct section or subsection +- [ ] `python3 scripts/validate_entries.py` passes +- [ ] `python3 scripts/generate_readme.py` run and `README.md` committed +- [ ] Commits are signed off (`git commit --signoff`) + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c73a811 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + diff --git a/.github/workflows/protect-readme.yml b/.github/workflows/protect-readme.yml new file mode 100644 index 0000000..a70e0dd --- /dev/null +++ b/.github/workflows/protect-readme.yml @@ -0,0 +1,39 @@ +name: Protect README + +on: + pull_request: + paths: + - "README.md" + +jobs: + check-readme: + runs-on: ubuntu-latest + steps: + - name: Block direct README edits + if: github.event.pull_request.user.type != 'Bot' + uses: actions/github-script@v9 + with: + script: | + const files = await github.paginate(github.rest.pulls.listFiles, { + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + per_page: 100, + }); + + const hasSourceChanges = files.some(f => + f.filename === 'awesome-list.yaml' || + f.filename.startsWith('data/') || + f.filename.startsWith('scripts/') || + f.filename.startsWith('schema/') + ); + + if (!hasSourceChanges) { + core.setFailed( + 'README.md must not be edited directly.\n\n' + + 'This repository uses a data-first workflow and auto-generates README.md from YAML files.\n\n' + + 'To suggest a new resource, open an issue instead:\n' + + `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/new/choose` + ); + } + diff --git a/.github/workflows/validate-and-generate.yml b/.github/workflows/validate-and-generate.yml new file mode 100644 index 0000000..70642a9 --- /dev/null +++ b/.github/workflows/validate-and-generate.yml @@ -0,0 +1,15 @@ +name: Validate Data + +on: + pull_request: + paths: + - "awesome-list.yaml" + - "data/**" + - "scripts/**" + +jobs: + validate: + uses: jslee02/awesome-list-infra/.github/workflows/validate-data.yml@main + with: + dependencies: "pyyaml git+https://github.com/jslee02/awesome-list-infra.git" + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b0e3240 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contribution Guidelines + +## Suggesting a New Resource + +Please use the GitHub issue form for new suggestions: + +- Open `Suggest a Resource` +- Fill in the category, description, and repository fields as completely as you can +- Search existing issues and entries first to avoid duplicates + +## Fixing an Existing Entry + +This repository uses a data-first workflow: + +- YAML files are the source of truth +- `README.md` is generated from YAML data + +If you are opening a direct PR: + +1. Edit the relevant YAML/source file, not `README.md` +2. Keep entries in the correct section and order +3. Run `python3 scripts/validate_entries.py` +4. Run `python3 scripts/generate_readme.py` +5. Commit the regenerated `README.md` +6. Sign off commits with `git commit --signoff` + +## General Rules + +- Keep descriptions short, factual, and easy to scan +- Use the appropriate category and subsection +- Check spelling and grammar +- Remove trailing whitespace + +Thank you for the contribution. + diff --git a/README.md b/README.md index d1385f2..9c720b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,19 @@ # Awesome Python Binding Generators for C++ -## C/C++ to Python +[![Awesome](https://awesome.re/badge.svg)](https://awesome.re) + +A curated list of resources for Python Binding Generators for C++. + +## Contents + +- [C/C++ to Python](#cc-to-python) + - [Boost.Python](#boostpython) + - [pybind11](#pybind11) + - [ETC](#etc) +- [C/C++ to other languages](#cc-to-other-languages) + - [Crystal](#crystal) + +## [C/C++ to Python](#contents) ### Boost.Python @@ -19,8 +32,16 @@ * Cpp2Py - Reflection tools based on clang [[github](https://github.com/TRIQS/cpp2py) ![TRIQS/cpp2py](https://img.shields.io/github/stars/TRIQS/cpp2py.svg?style=social&label=Star&maxAge=2592000)] * [cppyy](https://cppyy.readthedocs.io) - Python-C++ bindings interface based on Cling/LLVM [[bitbucket](https://bitbucket.org/wlav/cppyy)] -## C/C++ to other languages +## [C/C++ to other languages](#contents) ### Crystal * Bindgen - Binding and wrapper generator for C/C++ libraries [[github](https://github.com/Papierkorb/bindgen) ![Papierkorb/bindgen](https://img.shields.io/github/stars/Papierkorb/bindgen.svg?style=social&label=Star&maxAge=2592000)] + +## [Contributing](#contents) + +Contributions are very welcome. Please read the [contribution guidelines](CONTRIBUTING.md) first. Also, please feel free to report any error. + +## [License](#contents) + +[![CC0](https://licensebuttons.net/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/) diff --git a/awesome-list.yaml b/awesome-list.yaml new file mode 100644 index 0000000..6fdc08b --- /dev/null +++ b/awesome-list.yaml @@ -0,0 +1,3 @@ +title: Awesome Python Binding Generators for C++ +description: A curated list of resources for Python Binding Generators for C++. +repository: jslee02/awesome-cpp-python-binding-generator diff --git a/data/readme.yaml b/data/readme.yaml new file mode 100644 index 0000000..9251a79 --- /dev/null +++ b/data/readme.yaml @@ -0,0 +1,47 @@ +sections: +- title: C/C++ to Python + content: + - '' + sections: + - title: Boost.Python + content: + - '' + - '* [AutoWIG](https://autowig.readthedocs.io) - Automatic wrapper and interface + generator [[github](https://github.com/StatisKit/AutoWIG) ![StatisKit/AutoWIG](https://img.shields.io/github/stars/StatisKit/AutoWIG.svg?style=social&label=Star&maxAge=2592000)]' + - '* chimera - Utility for generating Boost.Python and pybind11 bindings from + C/C++ code [[github](https://github.com/personalrobotics/chimera) ![personalrobotics/chimera](https://img.shields.io/github/stars/personalrobotics/chimera.svg?style=social&label=Star&maxAge=2592000)]' + - '' + sections: [] + - title: pybind11 + content: + - '' + - '* [Binder](http://cppbinder.readthedocs.io/en/latest/) - Binder, tool for automatic + generation of Python bindings [[github](https://github.com/RosettaCommons/binder) + ![RosettaCommons/binder](https://img.shields.io/github/stars/RosettaCommons/binder.svg?style=social&label=Star&maxAge=2592000)]' + - '* cppwg - An automatic wrapper generator for C++ [[github](https://github.com/jmsgrogan/cppwg) + ![jmsgrogan/cppwg](https://img.shields.io/github/stars/jmsgrogan/cppwg.svg?style=social&label=Star&maxAge=2592000)]' + - '* [Py++](http://pypp11.readthedocs.io/en/latest/) (deprecated) - Py++ for generating + pybind11 code [[github](https://github.com/ISoirar/pypp11) ![ISoirar/pypp11](https://img.shields.io/github/stars/ISoirar/pypp11.svg?style=social&label=Star&maxAge=2592000)]' + - '' + sections: [] + - title: ETC + content: + - '' + - '* clif - Wrapper generator foundation to wrap C++ for Python and other languages + using LLVM [[github](https://github.com/google/clif) ![google/clif](https://img.shields.io/github/stars/google/clif.svg?style=social&label=Star&maxAge=2592000)]' + - '* Cpp2Py - Reflection tools based on clang [[github](https://github.com/TRIQS/cpp2py) + ![TRIQS/cpp2py](https://img.shields.io/github/stars/TRIQS/cpp2py.svg?style=social&label=Star&maxAge=2592000)]' + - '* [cppyy](https://cppyy.readthedocs.io) - Python-C++ bindings interface based + on Cling/LLVM [[bitbucket](https://bitbucket.org/wlav/cppyy)]' + - '' + sections: [] +- title: C/C++ to other languages + content: + - '' + sections: + - title: Crystal + content: + - '' + - '* Bindgen - Binding and wrapper generator for C/C++ libraries [[github](https://github.com/Papierkorb/bindgen) + ![Papierkorb/bindgen](https://img.shields.io/github/stars/Papierkorb/bindgen.svg?style=social&label=Star&maxAge=2592000)]' + sections: [] diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py new file mode 100644 index 0000000..0ce6a1f --- /dev/null +++ b/scripts/generate_readme.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from awesome_list_infra.readme import generate_main + +raise SystemExit(generate_main()) + diff --git a/scripts/validate_entries.py b/scripts/validate_entries.py new file mode 100644 index 0000000..fff9503 --- /dev/null +++ b/scripts/validate_entries.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +from awesome_list_infra.readme import validate_main + +raise SystemExit(validate_main()) +