Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Makefile again #264

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ Then install the required libraries:
poetry install --all-extras
```

### Optional Makefile

If you use `make`, we've created shortcuts for running the commands in this document.

| Command | Description |
|---------|-------------|
| make install | Installs all dependencies using Poetry|
| make redis-start | Starts Redis Stack in a Docker container on ports 6379 and 8001 |
| make redis-stop | Stops the Redis Stack Docker container |
| make format | Runs code formatting and import sorting |
| make check-types | Runs mypy type checking |
| make lint | Runs formatting, import sorting, and type checking |
| make test | Runs tests, excluding those that require API keys and/or remote network calls)|
| make test-all | Runs all tests, including those that require API keys and/or remote network calls)|
| make check | Runs all linting targets and a subset of tests |
| make docs-build | Builds the documentation |
| make docs-serve | Serves the documentation locally |
| make clean | Removes all generated files (cache, coverage, build artifacts, etc.) |

### Linting and Tests

Check formatting, linting, and typing:
Expand Down
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.PHONY: install format lint test clean redis-start redis-stop check-types integration-test docs-build docs-serve check

install:
poetry install --all-extras

redis-start:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest

redis-stop:
docker stop redis-stack

format:
poetry run format
poetry run sort-imports

check-types:
poetry run check-mypy

lint: format check-types

test:
SKIP_RERANKERS=true SKIP_VECTORIZERS=true poetry run test-cov

test-all:
poetry run test-cov

check: lint test

docs-build:
poetry run build-docs

docs-serve:
poetry run serve-docs

clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name ".coverage" -delete
find . -type d -name "htmlcov" -exec rm -rf {} +
find . -type d -name "dist" -exec rm -rf {} +
find . -type d -name "build" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name "_build" -exec rm -rf {} +
Loading