Skip to content

Commit a095251

Browse files
author
nightcityblade
committed
docs: update contributing guide
1 parent 22a12e4 commit a095251

1 file changed

Lines changed: 45 additions & 13 deletions

File tree

CONTRIBUTING.md

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The development requirements are listed in the `requirements-devel.txt` file. In
66
pip install -r requirements-devel.txt
77
```
88

9-
The newest client versions sometimes require upcoming Weaviate core features. We recommend using Docker (see https://docs.weaviate.io/deploy/installation-guides/docker-installation) to run a local instance of the `latest Weaviate core <https://hub.docker.com/r/semitechnologies/weaviate/tags>`_ for client development.
9+
The newest client versions sometimes require upcoming Weaviate core features. We recommend using Docker (see https://docs.weaviate.io/deploy/installation-guides/docker-installation) to run a local instance of the [latest Weaviate core](https://hub.docker.com/r/semitechnologies/weaviate/tags) for client development.
1010

1111
#### Installation
1212

@@ -31,6 +31,18 @@ pip install git+https://github.com/weaviate/weaviate-python-client.git@BRANCH_NA
3131
If any static analysis tools such as Pylance fail, try installing the package with:
3232
`--config-settings editable_mode=compat` suffix. (e.g. `pip install -e . --config-settings editable_mode=compat`)
3333

34+
### Project structure
35+
36+
The client is organized around the v4 collections API. When adding or updating code, prefer the existing v4-style collection interfaces rather than the legacy v3 client patterns.
37+
38+
Commonly changed areas include:
39+
40+
- `weaviate/collections/` for the v4 collection APIs and typed request/response classes.
41+
- `weaviate/connect/` for connection and transport behavior.
42+
- `test/` for unit tests that do not require a running Weaviate instance.
43+
- `mock_tests/` for tests that simulate Weaviate responses.
44+
- `integration/` for tests that require a local Weaviate instance.
45+
3446
### Testing
3547

3648
To set up the testing environment, install the test requirements with:
@@ -41,24 +53,36 @@ pip install -r requirements-test.txt
4153

4254
There are three kinds of tests:
4355
- Unit tests test individual client components.
44-
- Integration tests use a running weaviate instance to test the client.
45-
- Mock tests simulate a weaviate instance to return specific values.
56+
- Integration tests use a running Weaviate instance to test the client.
57+
- Mock tests simulate a Weaviate instance to return specific values.
58+
59+
For most pull requests, run the smallest relevant test target first, for example:
60+
61+
```shell
62+
pytest test/path_to_changed_test.py
63+
pytest mock_tests/path_to_changed_test.py
64+
```
4665

47-
To run the integration tests,
66+
To run the full local test groups:
67+
68+
```shell
69+
pytest test
70+
pytest mock_tests
71+
```
72+
73+
To run the integration tests:
4874

4975
1. Ensure that you have Docker installed.
50-
2. Start the weaviate instances, changing `WEAVIATE_VERSION` to your weaviate docker image target
76+
2. Start the Weaviate instances, changing `WEAVIATE_VERSION` to your Weaviate Docker image target.
5177

5278
```shell
5379
./ci/start_weaviate.sh WEAVIATE_VERSION
5480
```
5581

5682
3. Run the tests.
5783

58-
```
84+
```shell
5985
pytest integration
60-
pytest mock_tests
61-
pytest test
6286
```
6387

6488
### Linting
@@ -72,12 +96,21 @@ We use the following tools to ensure a high code quality:
7296

7397
Note that all plugins are listed in the `requirements-devel.txt` file and are installed in the first step.
7498

99+
Before opening a pull request, run the linters on the files you changed:
100+
101+
```shell
102+
ruff format $FOLDER_WITH_CHANGES
103+
ruff check $FOLDER_WITH_CHANGES
104+
flake8 $FOLDER_WITH_CHANGES
105+
```
106+
75107
### Creating a Pull Request
76108

77109
- The main branch is what is released and developed currently.
78-
- You can create a feature-branch that is named: feature/YOUR-FEATURE-NAME.
79-
- Your feature branch always has the main branch as a starting point.
80-
- When you are done with your feature you should create a pull request into the main branch.
110+
- Create a focused branch from `main`, for example `feature/YOUR-FEATURE-NAME`, `fix/YOUR-BUG-FIX`, or `docs/YOUR-DOCS-UPDATE`.
111+
- Keep the pull request focused on one change and include tests or documentation updates when relevant.
112+
- Run the relevant tests and linters before requesting review.
113+
- Create the pull request into the main branch.
81114
- The main branch is protected.
82115

83116
### Contributor License Agreement
@@ -86,6 +119,5 @@ Contributions to Weaviate python client must be accompanied by a Contributor Lic
86119

87120
The process works as follows:
88121

89-
- You contribute by opening a [pull request](#pull-request).
122+
- You contribute by opening a [pull request](#creating-a-pull-request).
90123
- If your account has no CLA, a DocuSign link will be added as a comment to the pull request.
91-

0 commit comments

Comments
 (0)