From a2f1e92699d54b4059f1efc9f6f463d68724c893 Mon Sep 17 00:00:00 2001 From: Paul Prescod Date: Fri, 18 Dec 2020 07:42:46 -0800 Subject: [PATCH] Add contributing docs --- CONTRIBUTING.md | 55 ++++++++++++++++++++++++++++++++++++ proof-of-concept/test_pof.sh | 18 ++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..7178db511 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +Contributing +============ + +Contributions are welcome, and they are greatly appreciated! Every +little bit helps. + +You can contribute in many ways: + +Types of Contributions +---------------------- + +### Report Bugs + +Report bugs at . + +When reporting a bug, please include: + +- Your operating system name and version. +- Any details about your local setup that might be helpful in + troubleshooting. +- Detailed steps to reproduce the bug. + +### Donate to HPy + +Become a financial contributor and help us sustain the HPy community: [Contribute to HPy](https://opencollective.com/hpy/contribute). + +### Fix Bugs or Implement Features + +Look through the GitHub issues for bugs or proposals being discussed +or ready for implementation. + +### Write Documentation + +HPy could always use more documentation, whether as part of the +official HPy docs, in docstrings, or even on the web in blog +posts, articles, and such. + +Get Started! +------------ + +You can test your environment by running + +```bash +proof-of-concept/test_pof.sh wheel universal +``` + +This should build HPy and a proof of concept (demo) extension and +then run a pytest that validates both. + +Until we get around to more comprehensive documentation, you +can reverse engineer how the system works by looking at these +files: + +- `proof-of-concept/test_pof.sh` +- `proof-of-concept/setup.py` diff --git a/proof-of-concept/test_pof.sh b/proof-of-concept/test_pof.sh index 40cae87c8..d7e0dd963 100755 --- a/proof-of-concept/test_pof.sh +++ b/proof-of-concept/test_pof.sh @@ -105,6 +105,24 @@ setup_py_install() { # ======== main code ======= +# validate arguments +if [[ "$#" -lt 1 || ( "$#" -lt 2 && "$1" != "clean") ]]; then + echo "Usage: $0 COMMAND [TARGET_ABI]" >&2 + echo "Commands:" >&2 + echo " wheel TARGET_ABI: build a wheel, install and test" + echo " setup_py_install TARGET_ABI: install poc using 'setup.py install' & run tests" >&2 + echo " clean: clean build artifacts" >&2 + echo "Target ABIs:" >&2 + echo " universal: Binary intended for any Python implementation" >&2 + echo " cpython : Binary optimized for CPython" >&2 + exit 1 +fi + +if [ ! -d "proof-of-concept" ] ; then + echo "Script must be run in the repo root" >&2 + exit 1 +fi + # call the function mentioned as the first arg COMMAND="$1" shift