Skip to content

Commit

Permalink
chore: update build scripts for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Nov 29, 2023
1 parent ec6591c commit 5bfbd78
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ assert input_exp.evaluate(ctx) == output_exp.evaluate(ctx)
<!-- ### Visualize a Tree -- needs mathy plugin in docs.sh -->
<!-- ### Generate Problems -- needs example snippet -->

## 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.
Expand Down
2 changes: 1 addition & 1 deletion tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tools/codecov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e
. .env/bin/activate
pip install codecov
python -m codecov
python3 -m codecov
2 changes: 1 addition & 1 deletion tools/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tools/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5bfbd78

Please sign in to comment.