Skip to content

Latest commit

 

History

History
79 lines (45 loc) · 3.52 KB

File metadata and controls

79 lines (45 loc) · 3.52 KB

Contributing

Installing development versions

If you want to explore a potential code change, investigate a bug, or just want to try unreleased features, you can also install specific git shas.

Some example commands:

pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git
pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@example-branch-name
pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@44fc7ed

uv add git+https://github.com/pinecone-io/pinecone-python-client.git@44fc7ed

Developing locally with uv

uv is a fast Python package and project manager that combines virtualenv usage with dependency management, to provide a consistent experience for project maintainers and contributors who need to develop the pinecone-python-client as a library.

Step 1. Fork the Pinecone python client repository

On the GitHub repository page page, click the fork button at the top of the screen and create a personal fork of the repository:

Create a GitHub fork of the Pinecone Python client

It will take a few seconds for your fork to be ready. When it's ready, clone your fork of the Pinecone python client repository to your machine.

Change directory into the repository, as we'll be setting up a virtualenv from within the root of the repository.

Step 2. Install uv

Visit the uv site for installation instructions.

Step 3. Install dependencies

Run uv sync --extra grpc --extra asyncio from the root of the project.

Step 4. Enable pre-commit hooks.

Run uv run pre-commit install to enable checks to run when you commit so you don't have to find out during your CI run that minor lint issues need to be addressed.

Common tasks

Debugging

See the debugging guide. If you find an issue and would like to report it as a github issue, make sure you do not leak your API key that may be included in debug outputs.

Running tests

  • Unit tests: make test-unit
  • Run the tests in a single file: uv run pytest tests/unit/data/test_bulk_import.py

For more information on testing, see the Testing guide. External contributors should not worry about running integration tests as they make live calls to Pinecone and will incur significant costs.

Running the type checker

If you are adding new code, you should make an effort to annotate it with type hints.

You can run the type-checker to check for issues with:

uv run mypy pinecone

Running the ruff linter / formatter

These should automatically trigger if you have enabled pre-commit hooks with uv run pre-commit install. But in case you want to trigger these yourself, you can run them like this:

uv run ruff check --fix # lint rules
uv run ruff format      # formatting

If you experience any issues please file a new issue.

Submitting a Pull Request

Once you have a change in your fork you feel good about, confirm you are able to run unit tests, pass the ruff and mypy type-checking steps, please submit a Pull Request. All code contributed to the pinecone-python-client repository is licensed under the Apache 2.0 license.