Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Latest commit

 

History

History
83 lines (69 loc) · 2.48 KB

CONTRIBUTING.md

File metadata and controls

83 lines (69 loc) · 2.48 KB

Building

Install dependencies

  1. Install Rust compiler

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Install protobuf compiler

    # Linux
     sudo apt-get install protobuf-compiler
    
    # mac OS
    brew install protobuf

    Or alternatively install from source: https://github.com/protocolbuffers/protobuf/releases/tag/v22.2

    Note: If you are still getting an error like Could not find protoc installation - set the PROTOC environment variable to the protoc binary you just installed.

    export PROTOC=/path/to/protoc
  3. Install lib-ssl

    If you are getting an error like Could not find directory of OpenSSL installation, you need to install lib-ssl.

    linux

     sudo apt-get update && sudo apt-get install -y  pkg-config libssl-dev

    mac OS

     brew install openssl
  4. Generate OpenAPI client (Optional, usually done automatically at build time)

    Pinecone uses an OpenAPI spec for control-plane operations like create_index(). The OpenAPI client is automatically generated using openapi-generator during project build. This process uses Docker to docker run OpenAPI's generator image.
    If you don't have docker installed, or you don't want to use docker - you can download the generated code from the latest release. Simply extract the index_service.zip file into the index_service/ folder at the root of the project.

Building from source

Python package

Using the pyproject.toml file

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install as editable package
cd pinecone 
pip install -e .

# optionallly, install test dependencies and run tests:
pip install -e .[test]
pytest ../tests/unit

Using maturin

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install maturin
pip install maturin

# Install pinecone package for development
cd pinecone
maturin develop

Building a wheel for deployment

cd pinecone
maturin build --release

Building rust library for linking with other languages

cargo build

Contributing

TBD