You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Poetry for Dependency Management and TestContainers for Integration Testing (#134)
In this PR:
- Uses Poetry for Dependency Management
- Replaces the Makefile with Python scripts that can be run from Poetry
- Implements TestContainers with a Docker Compose file for integration
testing
---------
Co-authored-by: Robert Shelton <robert.b.shelton.42@gmail.com>
Co-authored-by: Tyler Hutcherson <tyler.hutcherson@redis.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,45 +28,49 @@ Here's how to get started with your code contribution:
28
28
pull request.
29
29
30
30
### Dev Environment
31
-
There is a provided `requirements.txt` and `requirements-dev.txt` file you can use to install required libraries with `pip` into your virtual environment.
31
+
RedisVL uses [Poetry](https://python-poetry.org/) for dependency management.
32
+
33
+
Follow the instructions to [install Poetry](https://python-poetry.org/docs/#installation).
34
+
35
+
Then install the required libraries:
32
36
33
-
Or use the local package editable install method:
34
37
```bash
35
-
python -m venv .venv
36
-
source .venv/bin/activate
37
-
pip install -e '.[all,dev]'
38
+
poetry install --all-extras
38
39
```
39
40
40
-
Then to deactivate the env:
41
-
```
42
-
source deactivate
43
-
```
44
41
45
42
### Linting and Tests
46
43
47
44
Check formatting, linting, and typing:
48
45
```bash
49
-
make check
46
+
poetry run format
47
+
poetry run sort-imports
48
+
poetry run mypy
50
49
```
51
50
51
+
#### TestContainers
52
+
53
+
RedisVL uses Testcontainers Python for integration tests. Testcontainers is an open-source framework for provisioning throwaway, on-demand containers for development and testing use cases.
54
+
55
+
To run Testcontainers-based tests you need a local Docker installation such as:
-[Docker Engine on Linux](https://docs.docker.com/engine/install/)
58
+
59
+
#### Running the Tests
60
+
52
61
Tests (with vectorizers):
53
62
```bash
54
-
make test-cov
63
+
poetry run test-cov
55
64
```
56
65
57
-
**NOTE**: Some tests require the `REDIS_URL` environment variable to be set (e.g. `export REDIS_URL=redis://localhost:6379`).
58
-
59
66
Tests w/out vectorizers:
60
67
```bash
61
-
SKIP_VECTORIZERS=true make test-cov
68
+
SKIP_VECTORIZERS=true poetry run test-cov
62
69
```
63
70
64
-
> Dev requirements are needed here to be able to run tests and linting.
65
-
> See other commands in the [Makefile](Makefile)
66
-
67
-
### Docker Tips
71
+
### Getting Redis
68
72
69
-
Make sure to have [Redis](https://redis.io) accessible with Search & Query features enabled on [Redis Cloud](https://redis.com/try-free) or locally in docker with [Redis Stack](https://redis.io/docs/getting-started/install-stack/docker/):
73
+
In order for your applications to use RedisVL, you must have [Redis](https://redis.io) accessible with Search & Query features enabled on [Redis Cloud](https://redis.com/try-free) or locally in docker with [Redis Stack](https://redis.io/docs/getting-started/install-stack/docker/):
70
74
71
75
```bash
72
76
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
0 commit comments