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

feat: moving workflows to uv

parent 1157987d
No related branches found
No related tags found
No related merge requests found
......@@ -22,24 +22,26 @@ jobs:
- name: Cache Poetry
uses: actions/cache@v4
with:
path: ~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
path: ~/.uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry
${{ runner.os }}-uv-
- name: Install uv
run: |
pipx install poetry==$POETRY_VERSION
curl -LsSf https://astral.sh/uv/install.sh | sh
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# cache: uv
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
run: uv venv --python 3.13
cache: uv
- name: Install dependencies
run: |
poetry install --all-extras
run: uv pip install -e .[dev]
- name: Build docs
run: |
poetry run sphinx-build -M html docs/source docs/build
uv run sphinx-build -M html docs/source docs/build
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
......
......@@ -21,21 +21,18 @@ jobs:
- name: Cache Poetry
uses: actions/cache@v4
with:
path: ~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
path: ~/.uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry
${{ runner.os }}-uv-
- name: Install uv
run: |
pipx install poetry==$POETRY_VERSION
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
run: uv venv --python 3.13
cache: uv
- name: Install dependencies
run: |
poetry install
run: uv pip install -e .[dev]
- name: Analyzing the code with our lint
run: |
make lint
......@@ -11,16 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
run: uv venv --python 3.13
cache: uv
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
run: poetry install
run: uv pip install -e .[dev]
- name: Build
run: poetry build
run: uv build
publish:
needs: build
......@@ -28,15 +26,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 2.0.1
run: uv venv --python 3.13
cache: uv
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
run: uv pip install -e .[dev]
- name: Build
run: uv build
- name: Publish to PyPI
run: |
poetry config repositories.remote https://upload.pypi.org/legacy/
poetry --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_API_TOKEN"
uv config repositories.remote https://upload.pypi.org/legacy/
uv --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_API_TOKEN"
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
......@@ -32,7 +32,7 @@ repos:
language: python
types: [ text ]
args: [ "--write-changes", "--ignore-words-list", "asend" ]
exclude: "poetry.lock"
exclude: "uv.lock"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
......
......@@ -27,6 +27,7 @@ While we encourage you to initiate a draft Pull Request early to get feedback on
1. Fork on GitHub:
Go to the [repository's page](https://github.com/aurelio-labs/semantic-router) on GitHub:
Click the "Fork" button in the top-right corner of the page.
2. Clone Your Fork:
After forking, you'll be taken to your new fork of the repository on GitHub. Copy the URL of your fork from the address bar or by clicking the "Code" button and copying the URL under "Clone with HTTPS" or "Clone with SSH".
Open your terminal or command prompt.
......@@ -34,18 +35,20 @@ While we encourage you to initiate a draft Pull Request early to get feedback on
```
git clone https://github.com/<your-gh-username>/<semantic-router>.git
```
3. Ensure you have poetry installed: `pip install poetry`.
4. Then navigate to the cloned folder, create a virtualenv, and install via poetry (which defaults to an editable installation):
3. Ensure you have [`uv` installed](https://docs.astral.sh/uv/getting-started/installation/), for macos and linux use `curl -LsSf https://astral.sh/uv/install.sh | sh`.
4. Then navigate to the cloned folder, create a virtualenv, and install via `uv`:
```
# Move into the cloned folder
cd semantic-router/
# Create a virtual environment
python3 -m venv venv
uv venv --python 3.13
# Activate the environment
source venv/bin/activate
source .venv/bin/activate
# Install via poetry with all extras relevant to perform unit tests
poetry install --all-extras
# Install via uv with all extras relevant to perform unit tests
uv pip install -e .[dev]
```
format:
poetry run black --target-version py313 -l 88 .
poetry run ruff --select I --fix .
uv run black --target-version py313 -l 88 .
uv run ruff --select I --fix .
PYTHON_FILES=.
lint: PYTHON_FILES=.
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')
lint lint_diff:
poetry run black --target-version py313 -l 88 $(PYTHON_FILES) --check
poetry run ruff check .
poetry run mypy $(PYTHON_FILES)
uv run black --target-version py313 -l 88 $(PYTHON_FILES) --check
uv run ruff check .
uv run mypy $(PYTHON_FILES)
test:
poetry run pytest -vv --cov=semantic_router --cov-report=term-missing --cov-report=xml --exitfirst --maxfail=1
uv run pytest -vv --cov=semantic_router --cov-report=term-missing --cov-report=xml --exitfirst --maxfail=1
test_functional:
poetry run pytest -vv -s --exitfirst --maxfail=1 tests/functional
uv run pytest -vv -s --exitfirst --maxfail=1 tests/functional
test_unit:
poetry run pytest -vv --exitfirst --maxfail=1 tests/unit
uv run pytest -vv --exitfirst --maxfail=1 tests/unit
test_integration:
poetry run pytest -vv --exitfirst --maxfail=1 tests/integration
uv run pytest -vv --exitfirst --maxfail=1 tests/integration
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