Skip to content
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
34 changes: 13 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,48 +194,40 @@ $ hatch version

#### Run the linter

Every time you change the code, it's a good practice to run the linter, that will ensure your code is well formatted
and the static checker is happy with the typing:
Every time you change the code, it's a good practice to format the code and perform linting (with automatic fixes):

```console
$ hatch run lint:all
$ hatch run fmt
```

If you see Hatch reporting problems, you can try fixing them with:
To check for static type errors, run:

```console
$ hatch run lint:fmt
```

You can also run the code formatter and the static checker separated:

```console
$ hatch run lint:style
```

and

```console
$ hatch run lint:typing
$ hatch run test:types
```

#### Run the tests

It's important your tests pass before contributing code. To run all the tests locally:

```console
$ hatch run test
$ hatch run test:all
```

> [!IMPORTANT] The command above will run ALL the tests, including integration tests; some of those often need you to
> run a certain service in background (e.g. a Vector Database) or provide credentials to external services (e.g. OpenAI)
> in order to pass.

If you want to run only a portion of the tests, for example including integration tests, Hatch will happily take the
same options you would pass to `pytest` directly, in this case a marker with the option `-m`:
To run the unit tests only, run:

```console
$ hatch run test:unit
```

For integration tests, run:

```console
$ hatch run test -m"not integration"
$ hatch run test:integration
```

#### Create a new integration
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For example, to run the tests suite for the Chroma document store, from the root

```sh
$ cd integrations/chroma
$ hatch run test
$ hatch run test:all
```

Hatch will take care of setting up an isolated Python environment and run the tests.
Expand Down
13 changes: 9 additions & 4 deletions integrations/amazon_bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ pip install hatch

With `hatch` installed, to run all the tests:
```
hatch run test
hatch run test:all
```
> Note: there are no integration tests for this project.

To run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## License
Expand Down
14 changes: 10 additions & 4 deletions integrations/amazon_sagemaker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pip install hatch

With `hatch` installed, to run all the tests:
```
hatch run test
hatch run test:all
```

> Note: You need to export your AWS credentials for Sagemaker integration tests to run (`AWS_ACCESS_KEY_ID` and
Expand All @@ -39,12 +39,18 @@ hatch run test:unit

To only run integration tests:
```
hatch run test -m "integration"
hatch run test:integration
```

To run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## License
Expand Down
13 changes: 9 additions & 4 deletions integrations/anthropic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ pip install hatch

With `hatch` installed, to run all the tests:
```
hatch run test
hatch run test:all
```
> Note: there are no integration tests for this project.

To run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## Examples
Expand Down
2 changes: 1 addition & 1 deletion integrations/chroma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PyPI - Version](https://img.shields.io/pypi/v/chroma-haystack.svg)](https://pypi.org/project/chroma-haystack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/chroma-haystack.svg)](https://pypi.org/project/chroma-haystack)
[![test](https://github.com/masci/chroma-haystack/actions/workflows/test.yml/badge.svg)](https://github.com/masci/chroma-haystack/actions/workflows/test.yml)
[![test](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/chroma.yml/badge.svg)](https://github.com/deepset-ai/haystack-core-integrations/actions/workflows/chroma.yml)

-----

Expand Down
27 changes: 9 additions & 18 deletions integrations/cohere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,30 @@ pip install hatch

With `hatch` installed, to run all the tests:
```
hatch run test
hatch run test:all
```
> Note: integration tests will be skipped unless the env var COHERE_API_KEY is set. The api key needs to be valid
> in order to pass the tests.

To only run unit tests:
```
hatch run test -m"not integration"
hatch run test:unit
```

To only run embedders tests:
For integration tests, run:
```
hatch run test -m"embedders"
hatch run test:integration
```

To only run generators tests:
To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run test -m"generators"
hatch run fmt
```

To only run ranker tests:
```
hatch run test -m"ranker"
```
To check for static type errors, run:

Markers can be combined, for example you can run only integration tests for embedders with:
```
hatch run test -m"integrations and embedders"
```

To run the linters `ruff` and `mypy`:
```
hatch run lint:all
```console
$ hatch run test:types
```

## License
Expand Down
2 changes: 1 addition & 1 deletion integrations/deepeval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For more information about the deepeval evaluation framework, please refer to th
## Testing

```console
hatch run test
hatch run test:all
```

## Examples
Expand Down
2 changes: 1 addition & 1 deletion integrations/elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker-compose up
Then run tests:

```console
hatch run test
hatch run test:all
```

## License
Expand Down
12 changes: 9 additions & 3 deletions integrations/google_vertex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ pip install hatch
With `hatch` installed, to run all the tests:

```
hatch run test
hatch run test:all
```

To run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:

```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## License
Expand Down
12 changes: 9 additions & 3 deletions integrations/langfuse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,18 @@ pip install hatch

With `hatch` installed, run all the tests:
```
hatch run test
hatch run test:all
```

Run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## License
Expand Down
21 changes: 14 additions & 7 deletions integrations/mongodb_atlas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,26 @@ pip install mongodb-atlas-haystack
pip install hatch
```

To run the linters `ruff` and `mypy`:
To run all the tests:
```
hatch run lint:all
hatch run test:all
```

To run all the tests:
> Note: you need your own MongoDB Atlas account to run the tests: you can make one here:
> https://www.mongodb.com/cloud/atlas/register. Once you have it, export the connection string
> to the env var `MONGO_CONNECTION_STRING`. If you forget to do so, all the tests will be skipped.

To format your code and perform linting using Ruff (with automatic fixes), run:
```
hatch run fmt
```
hatch run test

To check for static type errors, run:

```console
$ hatch run test:types
```

Note: you need your own MongoDB Atlas account to run the tests: you can make one here:
https://www.mongodb.com/cloud/atlas/register. Once you have it, export the connection string
to the env var `MONGO_CONNECTION_STRING`. If you forget to do so, all the tests will be skipped.

## License

Expand Down
12 changes: 9 additions & 3 deletions integrations/nvidia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pip install hatch
With `hatch` installed, to run all the tests:

```
hatch run test
hatch run test:all
```

> Note: integration tests will be skipped unless the env var NVIDIA_API_KEY is set. The api key needs to be valid
Expand All @@ -41,10 +41,16 @@ To only run unit tests:
hatch run test:unit
```

To run the linters `ruff` and `mypy`:
To format your code and perform linting using Ruff (with automatic fixes), run:

```
hatch run lint:all
hatch run fmt
```

To check for static type errors, run:

```console
$ hatch run test:types
```

## License
Expand Down
2 changes: 1 addition & 1 deletion integrations/ollama/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ docker exec ollama ollama pull <your model here>
Then run tests:

```console
hatch run test
hatch run test:all
```

The default model used here is ``orca-mini`` for generation and ``nomic-embed-text`` for embeddings
2 changes: 1 addition & 1 deletion integrations/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker-compose up
Then run tests:

```console
hatch run test
hatch run test:all
```

## License
Expand Down
8 changes: 1 addition & 7 deletions integrations/pgvector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgr
then run the tests:

```console
hatch run test
```

To run the coverage report:

```console
hatch run cov
hatch run test:all
```

## License
Expand Down
2 changes: 1 addition & 1 deletion integrations/pinecone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pip install pinecone-haystack
## Testing

```console
hatch run test
hatch run test:all
```

## License
Expand Down
2 changes: 1 addition & 1 deletion integrations/qdrant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pip install qdrant-haystack
The test suites use Qdrant's in-memory instance. No additional steps required.

```console
hatch run test
hatch run test:all
```

## License
Expand Down
2 changes: 1 addition & 1 deletion integrations/ragas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For more information about the Ragas evaluation framework, please refer to their
## Testing

```console
hatch run test
hatch run test:all
```

## Examples
Expand Down
2 changes: 1 addition & 1 deletion integrations/unstructured/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ docker run -p 8000:8000 -d --rm --name unstructured-api quay.io/unstructured-io/
Then run tests:

```console
hatch run test
hatch run test:all
```
Loading