Skip to content

Commit

Permalink
Makefile clean utility to remove cython cached objects (apache#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
MehulBatra authored Jul 5, 2024
1 parent 7afd6d6 commit 52b2548
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ test-coverage:
poetry run coverage report -m --fail-under=90
poetry run coverage html
poetry run coverage xml


clean:
@echo "Cleaning up Cython and Python cached files"
@rm -rf build dist *.egg-info
@find . -name "*.so" -exec echo Deleting {} \; -delete
@find . -name "*.pyc" -exec echo Deleting {} \; -delete
@find . -name "__pycache__" -exec echo Deleting {} \; -exec rm -rf {} +
@find . -name "*.pyd" -exec echo Deleting {} \; -delete
@find . -name "*.pyo" -exec echo Deleting {} \; -delete
@echo "Cleanup complete"
10 changes: 10 additions & 0 deletions mkdocs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ In contrast to the name suggest, it doesn't run the checks on the commit. If thi

You can bump the integrations to the latest version using `pre-commit autoupdate`. This will check if there is a newer version of `{black,mypy,isort,...}` and update the yaml.

## Cleaning

Removal of old cached files generated during the Cython build process:

```bash
make clean
```

Helps prevent build failures and unexpected behavior by removing outdated files, ensuring that only up-to-date sources are used & the build environment is always clean.

## Testing

For Python, `pytest` is used a testing framework in combination with `coverage` to enforce 90%+ code coverage.
Expand Down

0 comments on commit 52b2548

Please sign in to comment.