Skip to content

Commit

Permalink
feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed Jan 18, 2024
0 parents commit 48dc794
Show file tree
Hide file tree
Showing 23 changed files with 933 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*.manifest
*.spec
pip-log.txt
pip-delete-this-directory.txt
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
*.mo
*.pot
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
instance/
.webassets-cache
.scrapy
docs/_build/
.pybuilder/
target/
.ipynb_checkpoints
profile_default/
ipython_config.py
.pdm.toml
__pypackages__/
celerybeat-schedule
celerybeat.pid
*.sage.py
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.spyderproject
.spyproject
.ropeproject
/site
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
cython_debug/
tests/
.github/
.pre-commit-config.yaml
Makefile
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Python Package

on:
release:
types: [created]
permissions:
actions: write
jobs:
build-n-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
set -e
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
shell: bash
# - name: Version bump
# run: |
# set -e
# poetry version ${{ github.event.release.tag_name }}
# git add ./pyproject.toml
# git config --global user.name "Release Bot"
# git config --global user.email "[email protected]"
# git commit -m "Change version to ${{ github.event.release.tag_name }}" --allow-empty
# git push origin HEAD:main
# shell: bash

- name: Publish package to PyPI
run: |
set -e
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish -n --build
shell: bash
# poetry config repositories.publish ${{ inputs.PUBLISH_REGISTRY }}
# poetry publish -p ${{ secrets.PYPI_API_TOKEN }} -u ${{ inputs.PUBLISH_REGISTRY_USERNAME }} -r publish --build
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: [ "ubuntu-latest" ]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
set -e
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
# - name: Lint with flake8
# run: |
# set -e
# poetry update
# pre-commit run --from-ref HEAD~1 --to-ref HEAD
- name: Run tests
run: |
set -e
poetry update
poetry run pytest
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/aws.xml
.idea/**/contentModel.xml
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/**/gradle.xml
.idea/**/libraries
cmake-build-*/
.idea/**/mongoSettings.xml
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/replstate.xml
.idea/sonarlint/
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.idea/httpRequests
.idea/caches/build_file_checksums.ser
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*.manifest
*.spec
pip-log.txt
pip-delete-this-directory.txt
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
*.mo
*.pot
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
instance/
.webassets-cache
.scrapy
docs/_build/
.pybuilder/
target/
.ipynb_checkpoints
profile_default/
ipython_config.py
.pdm.toml
__pypackages__/
celerybeat-schedule
celerybeat.pid
*.sage.py
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.spyderproject
.spyproject
.ropeproject
/site
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
cython_debug/
.idea/
.python-version
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: check-xml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first

- repo: https://github.com/psf/black
rev: "refs/tags/23.3.0:refs/tags/23.3.0"
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args:
- "--extend-ignore=E203,E501,E503"
- "--max-line-length=88"

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.2.0"
hooks:
- id: mypy
args: [--strict, --ignore-missing-imports, --follow-imports=silent, --disable-error-code=type-abstract, --config-file=./mypy.ini]
additional_dependencies: ["types-requests", "pydantic", "overrides", "hypothesis", "pytest", "pypika", "numpy", "types-protobuf", "kubernetes"]
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM chromadb/chroma:latest as base

COPY ./ /chroma_ops

WORKDIR /chroma_ops

# install poetry
RUN pip install poetry && \
poetry install --no-dev --no-interaction --no-ansi

ENTRYPOINT ["poetry", "run","chops"]
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License

Copyright (c) 2024 Amikos Tech Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
lint:
@echo "Running pre-commit hooks"
@pre-commit run --all-files
pre-commit:
@echo "Linting last commit"
@pre-commit run --from-ref HEAD~1 --to-ref HEAD
dependencies:
@echo "Installing dependencies"
@poetry update
install:
@echo "Installing the project"
@poetry install
test:
@echo "Running tests"
@poetry run pytest
build-docker:
@echo "Building docker image"
@docker build -t chromadb-dp .
Loading

0 comments on commit 48dc794

Please sign in to comment.