Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
16211ad
feat: Add pyproject.toml and pre-commit
cdcore09 Mar 28, 2024
455e044
refactor: Update with pre-commit
cdcore09 Mar 28, 2024
ddfe333
refactor: Remove extra whitespace
cdcore09 Mar 28, 2024
1aa706f
feat: Add codespell-whitelist for pre-commit and fix spellings in REA…
cdcore09 Mar 28, 2024
2f6fd08
feat: Add requirements file
cdcore09 Mar 28, 2024
6968b2d
feat: Add CI for main and dev branches
cdcore09 Mar 28, 2024
6584cbc
refactor: Fix PEP8 issues with README, requirements, and ci files
cdcore09 Mar 28, 2024
4e22f4a
refactor: Move vectordb to src and update __init__
cdcore09 Mar 28, 2024
70b053a
refactor: Update the pyproject.toml to dynamically handle versions
cdcore09 Mar 28, 2024
eaefab8
docs: Add Makefile and JupyterBook requirements
cdcore09 Mar 28, 2024
3eca243
docs: Add community health files
cdcore09 Mar 28, 2024
1f89aa9
docs: Add getting started/intro documentation
cdcore09 Mar 28, 2024
239a83c
feat: Add Codespaces functionality
cdcore09 Mar 28, 2024
dc2d639
feat: Add apt file to install important pkgs to Codespace
cdcore09 Mar 28, 2024
9c63a1f
fix: Add shell library installs to postBuild
cdcore09 Mar 28, 2024
7195b56
fix: Add shell package install to devcontainer
cdcore09 Mar 28, 2024
d883e9d
refactor: Delete .devcontainer/apt.txt
cdcore09 Mar 28, 2024
69666bf
refactor: Install env pkgs in postBuild
cdcore09 Mar 28, 2024
a6f31c9
refactor: Delete .devcontainer/environment.yml
cdcore09 Mar 28, 2024
96f6694
refactor: Install dev tools in postBuild
cdcore09 Mar 28, 2024
ce51bca
chore: Pre-commit fixes
cdcore09 Mar 28, 2024
58ec24c
fix: Add modules to __init__
cdcore09 Mar 28, 2024
211c433
fix: Set Python version to 3.8
cdcore09 Mar 28, 2024
77318d3
refactor: Add conda support
cdcore09 Mar 28, 2024
cafe7a6
refactor: Add Dockerfile and update devcontainer.json
cdcore09 Mar 28, 2024
8b657e5
refactor: Remove pre-commit and nox from postBuild
cdcore09 Mar 28, 2024
385cc24
fix: Update Dockerfile to build Conda env
cdcore09 Apr 8, 2024
20e9d1a
chore: Update ci.yml
cdcore09 Apr 8, 2024
508e753
refactor: Update Dockerfile to use pangeo/base-notebook and install a…
cdcore09 Apr 19, 2024
275857f
refactor: Update requirement specs
cdcore09 Apr 19, 2024
c93a9df
feat: Create auto-build docker image
cdcore09 Apr 19, 2024
1fd079c
fix: Check pkgs available on conda-forge
cdcore09 Apr 19, 2024
a1f7e92
refactor: Use docker image instead of Dockerfile in devcontainer.json
cdcore09 Apr 19, 2024
f454312
feat: Install support for GitHub repo install
cdcore09 Apr 19, 2024
4255800
fix: Remove git installation
cdcore09 Apr 19, 2024
84ecb1c
fix: Update project name in ci.yml and add build-essentials to Docker…
cdcore09 Apr 20, 2024
e4c32a1
docs: Update docs to include codespaces, docker, and conda instructions
cdcore09 Apr 20, 2024
d46357a
fix: Update install.rst organization
cdcore09 May 14, 2024
b5b6546
feat: Update docker image in devcontainer.json
cdcore09 May 17, 2024
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
1 change: 1 addition & 0 deletions .codespell-whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kagisearch
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"image": "ghcr.io/swarm-io-internal/data-science-lite:latest",

"customizations": {
"vscode": {
"extensions": [
"ms-toolsai.jupyter",
"ms-python.python"
]
}
},
"postCreateCommand": "sh .devcontainer/postBuild.sh"
}
4 changes: 4 additions & 0 deletions .devcontainer/postBuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These commands will be run after the devcontainer is built.

python3 -m pip install git+https://github.com/vioshyvo/mrpt/
python3 -m pip install -e . # Install vectordb locally
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Raise pull requests for version updates
# to pip against the `main` branch
target-branch: "main"
32 changes: 32 additions & 0 deletions .github/matchers/pylint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"problemMatcher": [
{
"severity": "warning",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
],
"owner": "pylint-warning"
},
{
"severity": "error",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
],
"owner": "pylint-error"
}
]
}
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Any commit to master branch re-builds images, re-runs tests, and pushes SHA tags to DockerHub
name: Build
on:
push:
branches:
- main
- dev
- pre-commit
paths-ignore:
- 'LICENSE'
- 'README.md'
workflow_dispatch:

env:
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: ${{ github.repository_owner }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}

jobs:
build-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
IMAGE: [docker]
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Get date tag
id: get_date
run: |
DATE_TAG="$( date -u '+%Y.%m.%d' )"
echo "date_tag=$DATE_TAG" >> $GITHUB_OUTPUT

- name: Get registry and org
id: registry_org
run: |
ORG=$(echo "${{ env.DOCKER_ORG }}" | tr '[:upper:]' '[:lower:]')
echo "image_base=${{ env.DOCKER_REGISTRY }}/${ORG}" >> $GITHUB_OUTPUT

# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up disk space
run: |
df -h
docker image ls
sudo apt clean
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ steps.registry_org.outputs.image_base }}/${{ matrix.IMAGE }}
tags: |
# set latest tag for default branch
type=raw,value=latest
type=raw,value=${{ steps.get_date.outputs.date_tag }}

- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Inspect Image
run: |
docker run ${{ steps.registry_org.outputs.image_base }}/${{ matrix.IMAGE }}:latest conda list
docker images ls

- name: Test Image
run: |
docker run -u 1000 -w /srv/test -v $PWD:/srv/test ${{ steps.registry_org.outputs.image_base }}/${{ matrix.IMAGE }}:latest
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3
PROJECT_NAME: "vectordb"

jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout vectordb
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Record State
run: |
pwd
echo github.ref is: ${{ github.ref }}
echo GITHUB_SHA is: $GITHUB_SHA
echo github.event_name is: ${{ github.event_name }}
echo github workspace: ${{ github.workspace }}
pip --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov torch wheel

# We only want to install this on one run, because otherwise we'll have
# duplicate annotations.
- name: Install error reporter
if: ${{ matrix.python-version == '3.10' }}
run: |
python -m pip install pytest-github-actions-annotate-failures

- name: Install vectordb
run: |
pip install -e ".[dev]"
pip show ${{ env.PROJECT_NAME }}

- name: Test with pytest
run: |
pytest -vvv --cov=${{ env.PROJECT_NAME }} --cov-report=xml --cov-report=term tests/

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,4 @@ cython_debug/
#.idea/


*~
*~
85 changes: 85 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
exclude: |
(?x)^(
tests/utils/
)

ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/psf/black
rev: "24.2.0"
hooks:
- id: black-jupyter

- repo: https://github.com/asottile/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: "v1.9.0"
# hooks:
# - id: mypy
# files: src
# args: ["--ignore-missing-imports"]
# additional_dependencies:
# - pytest

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell
args: ["--write-changes", "--ignore-words", ".codespell-whitelist"]

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.language_info.version]

- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml
Loading