Skip to content
Snippets Groups Projects
Commit b8d344e7 authored by James Briggs's avatar James Briggs
Browse files

feat: poetry and ci updates

parent dd94fb8a
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ name: Release Docs ...@@ -2,7 +2,7 @@ name: Release Docs
on: on:
release: release:
types: [released] types: [ released ]
jobs: jobs:
build-docs: build-docs:
...@@ -14,44 +14,44 @@ jobs: ...@@ -14,44 +14,44 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- "3.13" - "3.13"
env: env:
POETRY_VERSION: "1.8.4" POETRY_VERSION: "2.0.1"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Cache Poetry - name: Cache Poetry
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/.poetry path: ~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-poetry- ${{ runner.os }}-poetry-
- name: Install poetry - name: Install poetry
run: | run: |
pipx install poetry==$POETRY_VERSION pipx install poetry==$POETRY_VERSION
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: poetry cache: poetry
- name: Install dependencies - name: Install dependencies
run: | run: |
poetry install --all-extras poetry install --all-extras
- name: Build docs - name: Build docs
run: | run: |
poetry run sphinx-build -M html docs/source docs/build poetry run sphinx-build -M html docs/source docs/build
- name: Authenticate to Google Cloud - name: Authenticate to Google Cloud
id: auth id: auth
uses: google-github-actions/auth@v2 uses: google-github-actions/auth@v2
with: with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Upload Docs - name: Upload Docs
run: | run: |
gcloud storage rsync docs/build/html gs://docs-bucket-production/semantic-router --recursive --delete-unmatched-destination-objects gcloud storage rsync docs/build/html gs://docs-bucket-production/semantic-router --recursive --delete-unmatched-destination-objects
# - name: Upload Docs # - name: Upload Docs
# id: upload-directory # id: upload-directory
# uses: google-github-actions/upload-cloud-storage@v2 # uses: google-github-actions/upload-cloud-storage@v2
# with: # with:
# path: docs/build/html # path: docs/build/html
# destination: docs-bucket-production/semantic-router # destination: docs-bucket-production/semantic-router
# parent: false # parent: false
\ No newline at end of file
...@@ -2,11 +2,12 @@ name: lint ...@@ -2,11 +2,12 @@ name: lint
on: on:
push: push:
branches: [main] branches: [ main ]
pull_request: pull_request:
env: env:
POETRY_VERSION: "1.8.4" POETRY_VERSION: "2.0.1"
jobs: jobs:
build: build:
...@@ -14,27 +15,27 @@ jobs: ...@@ -14,27 +15,27 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- "3.13" - "3.13"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache Poetry - name: Cache Poetry
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/.poetry path: ~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-poetry- ${{ runner.os }}-poetry-
- name: Install poetry - name: Install poetry
run: | run: |
pipx install poetry==$POETRY_VERSION pipx install poetry==$POETRY_VERSION
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: poetry cache: poetry
- name: Install dependencies - name: Install dependencies
run: | run: |
poetry install poetry install
- name: Analyzing the code with our lint - name: Analyzing the code with our lint
run: | run: |
make lint make lint
...@@ -3,7 +3,7 @@ name: Release ...@@ -3,7 +3,7 @@ name: Release
on: on:
push: push:
tags: tags:
- '*' - '*'
jobs: jobs:
build: build:
...@@ -33,7 +33,7 @@ jobs: ...@@ -33,7 +33,7 @@ jobs:
python-version: '3.13' python-version: '3.13'
- name: Install Poetry - name: Install Poetry
run: | run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.8.4 curl -sSL https://install.python-poetry.org | python - -y --version 2.0.1
- name: Publish to PyPI - name: Publish to PyPI
run: | run: |
poetry config repositories.remote https://upload.pypi.org/legacy/ poetry config repositories.remote https://upload.pypi.org/legacy/
......
...@@ -3,8 +3,9 @@ name: Test ...@@ -3,8 +3,9 @@ name: Test
on: on:
pull_request: pull_request:
env: env:
POETRY_VERSION: "1.8.4" POETRY_VERSION: "2.0.1"
jobs: jobs:
build: build:
...@@ -12,47 +13,47 @@ jobs: ...@@ -12,47 +13,47 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- "3.10" - "3.10"
- "3.11" - "3.11"
- "3.12" - "3.12"
- "3.13" - "3.13"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Cache Poetry - name: Cache Poetry
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/.poetry path: ~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-poetry- ${{ runner.os }}-poetry-
- name: Install poetry - name: Install poetry
run: | run: |
pipx install poetry==$POETRY_VERSION pipx install poetry==$POETRY_VERSION
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: poetry cache: poetry
- name: Install dependencies - name: Install dependencies
run: | run: |
poetry install --all-extras poetry install --all-extras
- name: Install nltk - name: Install nltk
run: | run: |
pip install nltk pip install nltk
- name: Download nltk data - name: Download nltk data
run: | run: |
python -m nltk.downloader punkt stopwords wordnet punkt_tab python -m nltk.downloader punkt stopwords wordnet punkt_tab
- name: Pytest All - name: Pytest All
env: env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
run: | run: |
make test make test
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with: with:
file: ./coverage.xml file: ./coverage.xml
fail_ci_if_error: false fail_ci_if_error: false
default_language_version: default_language_version:
python: python3.13 python: python3.13
repos: repos:
- repo: meta - repo: meta
hooks: hooks:
- id: check-hooks-apply - id: check-hooks-apply
- id: check-useless-excludes - id: check-useless-excludes
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.9.1 rev: 23.9.1
hooks: hooks:
- id: black - id: black
- repo: https://github.com/asottile/blacken-docs - repo: https://github.com/asottile/blacken-docs
rev: 1.16.0 rev: 1.16.0
hooks: hooks:
- id: blacken-docs - id: blacken-docs
additional_dependencies: [black==22.10.0] additional_dependencies: [ black==22.10.0 ]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0 rev: v9.11.0
hooks: hooks:
- id: commitlint - id: commitlint
stages: [commit-msg] stages: [ commit-msg ]
additional_dependencies: ['@commitlint/config-conventional'] additional_dependencies: [ '@commitlint/config-conventional' ]
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.4 rev: v2.2.4
hooks: hooks:
- id: codespell - id: codespell
name: Run codespell to check for common misspellings in files name: Run codespell to check for common misspellings in files
language: python language: python
types: [ text ] types: [ text ]
args: [ "--write-changes", "--ignore-words-list", "asend" ] args: [ "--write-changes", "--ignore-words-list", "asend" ]
exclude: "poetry.lock" exclude: "poetry.lock"
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.4.0
hooks: hooks:
- id: check-vcs-permalinks - id: check-vcs-permalinks
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ] args: [ --markdown-linebreak-ext=md ]
- id: debug-statements - id: debug-statements
- id: no-commit-to-branch - id: no-commit-to-branch
- id: check-merge-conflict - id: check-merge-conflict
- id: check-toml - id: check-toml
- id: check-yaml - id: check-yaml
args: [ '--unsafe' ] # for mkdocs.yml args: [ '--unsafe' ] # for mkdocs.yml
- id: detect-private-key - id: detect-private-key
- repo: https://github.com/commitizen-tools/commitizen - repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0 rev: v3.13.0
hooks: hooks:
- id: commitizen - id: commitizen
- id: commitizen-branch - id: commitizen-branch
stages: stages:
- post-commit - post-commit
- push - push
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.290 rev: v0.0.290
hooks: hooks:
- id: ruff - id: ruff
types_or: [python, pyi, jupyter] types_or: [ python, pyi, jupyter ]
# - repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/PyCQA/bandit
# rev: v1.8.0 rev: 1.7.6
# hooks: hooks:
# - id: mypy - id: bandit
# args: [--ignore-missing-imports] args: [ '-lll' ]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: ['-lll']
...@@ -13,9 +13,9 @@ sys.path.insert(0, os.path.abspath("../..")) # Source code dir relative to this ...@@ -13,9 +13,9 @@ sys.path.insert(0, os.path.abspath("../..")) # Source code dir relative to this
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Semantic Router" project = "Semantic Router"
copyright = "2024, Aurelio AI" copyright = "2025, Aurelio AI"
author = "Aurelio AI" author = "Aurelio AI"
release = "0.1.0.dev5" release = "0.1.0.dev6"
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
[tool.poetry] [tool.poetry]
name = "semantic-router" name = "semantic-router"
version = "0.1.0.dev5" version = "0.1.0.dev6"
description = "Super fast semantic router for AI decision making" description = "Super fast semantic router for AI decision making"
authors = ["Aurelio AI <hello@aurelio.ai>"] authors = ["Aurelio AI <hello@aurelio.ai>"]
readme = "README.md" readme = "README.md"
...@@ -17,7 +17,7 @@ numpy = "^1.25.2" ...@@ -17,7 +17,7 @@ numpy = "^1.25.2"
colorlog = "^6.8.0" colorlog = "^6.8.0"
pyyaml = "^6.0.1" pyyaml = "^6.0.1"
aurelio-sdk = {version = "^0.0.16"} aurelio-sdk = {version = "^0.0.16"}
pinecone-text = {version = ">=0.7.1,<0.10.0", optional = true} pinecone-text = {version = ">=0.7.1", optional = true}
torch = {version = ">=2.1.0,<2.6.0", optional = true, python = "<3.13" } torch = {version = ">=2.1.0,<2.6.0", optional = true, python = "<3.13" }
transformers = {version = ">=4.36.2", optional = true, python = "<3.13" } transformers = {version = ">=4.36.2", optional = true, python = "<3.13" }
tokenizers = {version = ">=0.19", optional = true, python = "<3.13" } tokenizers = {version = ">=0.19", optional = true, python = "<3.13" }
......
...@@ -3,4 +3,4 @@ from semantic_router.route import Route ...@@ -3,4 +3,4 @@ from semantic_router.route import Route
__all__ = ["SemanticRouter", "HybridRouter", "Route", "RouterConfig"] __all__ = ["SemanticRouter", "HybridRouter", "Route", "RouterConfig"]
__version__ = "0.1.0.dev5" __version__ = "0.1.0.dev6"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment