diff --git a/README.md b/README.md index de0cecd..da24b31 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,22 @@ assert input_exp.evaluate(ctx) == output_exp.evaluate(ctx) +## Development + +Install the prerequisites in a virtual environment (python3 required) + +```bash +sh tools/setup.sh +``` + +Run the test suite and view code-coverage statistics + +```bash +sh tools/test.sh +``` + +The tests cover ~90% of the code so they're a good reference for how to use the various APIs. + ## Semantic Versioning Before Mathy Core reaches v1.0 the project is not guaranteed to have a consistent API, which means that types and classes may move around or be removed. That said, we try to be predictable when it comes to breaking changes, so the project uses semantic versioning to help users avoid breakage. diff --git a/tools/build.sh b/tools/build.sh index 9cc3b05..205b45b 100644 --- a/tools/build.sh +++ b/tools/build.sh @@ -3,4 +3,4 @@ set -e . .env/bin/activate echo "Build python package..." -python setup.py sdist bdist_wheel +python3 setup.py sdist bdist_wheel diff --git a/tools/codecov.sh b/tools/codecov.sh index 475134a..bb898f7 100644 --- a/tools/codecov.sh +++ b/tools/codecov.sh @@ -2,4 +2,4 @@ set -e . .env/bin/activate pip install codecov -python -m codecov +python3 -m codecov diff --git a/tools/deploy.sh b/tools/deploy.sh index 9c9c4c1..28b33b3 100644 --- a/tools/deploy.sh +++ b/tools/deploy.sh @@ -10,7 +10,7 @@ echo "--- Install requirements" pip install twine wheel pip install -r requirements.txt echo "--- Buid dists" -python setup.py sdist bdist_wheel +python3 setup.py sdist bdist_wheel echo "--- Upload to PyPi" # NOTE: ignore errors on upload because our CI is dumb and tries to upload # even if the version has already been uploaded. This isn't great, but diff --git a/tools/docs.sh b/tools/docs.sh index 1b4b1d6..a4d1fee 100644 --- a/tools/docs.sh +++ b/tools/docs.sh @@ -2,5 +2,5 @@ set -e . .env/bin/activate mathy_pydoc mathy_core.tokenizer.Tokenizer++ mathy_core.parser++ mathy_core.tree++ mathy_core.expressions++ mathy_core.rules.associative_swap++ mathy_core.rules.balanced_move++ mathy_core.rules.commutative_swap++ mathy_core.rules.constants_simplify++ mathy_core.rules.distributive_factor_out++ mathy_core.rules.distributive_multiply_across++ mathy_core.rules.variable_multiply++ mathy_core.layout++ mathy_core.problems++ > /tmp/pathy_api.md -python tools/docs.py /tmp/pathy_api.md README.md +python3 tools/docs.py /tmp/pathy_api.md README.md npx prettier README.md --write \ No newline at end of file diff --git a/tools/setup.sh b/tools/setup.sh index e4ebc34..e993e8e 100644 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -5,7 +5,7 @@ set -e DIR=.env if [ ! -d "${DIR}" ]; then pip install virtualenv --upgrade - python -m virtualenv .env -p python3 + python3 -m virtualenv .env -p python3 fi . .env/bin/activate