Skip to content

Commit

Permalink
Merge branch 'main' into csande/KOALA-2352-task-effect-assign-team
Browse files Browse the repository at this point in the history
  • Loading branch information
csande authored Feb 5, 2025
2 parents 4bfa013 + 2317dd9 commit 7abd3cb
Show file tree
Hide file tree
Showing 19 changed files with 2,112 additions and 2,949 deletions.
6 changes: 3 additions & 3 deletions .github/actions/install-canvas/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ runs:
uses: actions/cache@v4
with:
path: .venv
key: ${{runner.os}}-py${{env.PYTHON_VERSION}}-venv-${{ hashFiles('**/poetry.lock') }}
key: ${{runner.os}}-py${{env.PYTHON_VERSION}}-venv-${{ hashFiles('**/uv.lock') }}

# Install project dependencies (bypassing the project, because we don't want to cache the Canvas code).
- name: Install Dependencies
run: poetry install --no-interaction --no-root
run: uv sync --no-install-workspace
shell: bash
if: steps.cache-deps.outputs.cache-hit != 'true'

# Install the project to make sure everything works and is synced.
- name: Install Canvas
shell: bash
run: poetry install --no-interaction
run: uv sync
54 changes: 0 additions & 54 deletions .github/actions/install-python-and-poetry/action.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/actions/install-python-and-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Install Python and uv"
description: "Installs Python using .python-version file's version, and uv with the given version"

inputs:
UV_VERSION:
description: "uv version to install"
required: false
default: "0.5.23"
PYTHON_VERSION:
description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset."
required: false
default: ""
CHECK_LATEST:
description: "If check-latest is set to true, the action first checks if the cached version is the latest one"
required: false
default: false
runs:
using: "composite"
steps:
- name: Set up Python
id: python-setup
uses: actions/setup-python@v5
with:
python-version: ${{inputs.PYTHON_VERSION}}
python-version-file: ".python-version"
check-latest: ${{inputs.CHECK_LATEST}}

- name: Set Python version in the environment
run: |
echo "PYTHON_VERSION=${{ steps.python-setup.outputs.python-version }}" >> $GITHUB_ENV
shell: bash

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ${{ inputs.UV_VERSION }}
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ jobs:
version: [ 3.11, 3.12 ]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-python-and-poetry
- uses: ./.github/actions/install-python-and-uv
with:
PYTHON_VERSION: ${{ matrix.version }}
- uses: ./.github/actions/install-canvas

# Run Pytest unit tests via Poetry.
# Run Pytest unit tests via uv.
- name: Run Pytest unit tests
env:
CUSTOMER_IDENTIFIER: "ci-unit-tests"
INTEGRATION_TEST_URL: "https://api-test-clinic.canvasmedical.com"
INTEGRATION_TEST_CLIENT_ID: ${{ secrets.INTEGRATION_TEST_CLIENT_ID }}
INTEGRATION_TEST_CLIENT_SECRET: ${{ secrets.INTEGRATION_TEST_CLIENT_SECRET }}
run: poetry run pytest -m "not integtest" --ff --verbosity 2
run: uv run pytest -m "not integtest" --ff --verbosity 2

# Run Pytest integration tests via Poetry.
# Run Pytest integration tests via uv.
- name: Run Pytest integration tests
if: matrix.version == '3.12'
env:
CUSTOMER_IDENTIFIER: "ci-integration-tests"
INTEGRATION_TEST_URL: "https://api-test-clinic.canvasmedical.com"
INTEGRATION_TEST_CLIENT_ID: ${{ secrets.INTEGRATION_TEST_CLIENT_ID }}
INTEGRATION_TEST_CLIENT_SECRET: ${{ secrets.INTEGRATION_TEST_CLIENT_SECRET }}
run: poetry run pytest -m "integtest" --ff --verbosity 2
run: uv run pytest -m "integtest" --ff --verbosity 2

- name: Install pipx
run: pip install pipx
Expand All @@ -46,7 +46,7 @@ jobs:
env:
CUSTOMER_IDENTIFIER: "ci-distribution"
run: |
poetry build
uv build
pipx install dist/*.whl
canvas --version
rm -rf dist/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: set-sha
uses: ./.github/actions/set-sha

- uses: ./.github/actions/install-python-and-poetry
- uses: ./.github/actions/install-python-and-uv
- uses: ./.github/actions/install-canvas

- name: Run the pre-commit hooks
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.PROJECT_AND_REPO_PAT }}
- uses: ./.github/actions/install-python-and-poetry
- uses: ./.github/actions/install-python-and-uv
- uses: ./.github/actions/install-canvas

- name: Python Semantic Release
Expand All @@ -39,7 +39,7 @@ jobs:
run: |
git config --global user.name "$GIT_COMMITTER_NAME"
git config --global user.email "$GIT_COMMITTER_EMAIL"
poetry run semantic-release --strict -vv $([ "${{ inputs.dry-run }}" == "true" ] && echo "--noop") version
uv run semantic-release --strict -vv $([ "${{ inputs.dry-run }}" == "true" ] && echo "--noop") version
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -49,4 +49,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.PROJECT_AND_REPO_PAT }}
run: |
poetry run semantic-release --strict -vv $([ "${{ inputs.dry-run }}" == "true" ] && echo "--noop") publish --tag ${{ steps.release.outputs.tag }}
uv run semantic-release --strict -vv $([ "${{ inputs.dry-run }}" == "true" ] && echo "--noop") publish --tag ${{ steps.release.outputs.tag }}
25 changes: 7 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,11 @@ repos:
args: [--in-place, --all]
exclude: |
(?x)(
poetry.lock
uv.lock
)$
- repo: https://github.com/python-poetry/poetry
rev: 1.8.5
hooks:
- id: poetry-check
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$
- id: poetry-lock
args: [--no-update]
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.9.4
hooks:
- id: ruff
args: [ --fix ]
Expand Down Expand Up @@ -91,7 +81,7 @@ repos:
- id: check-yaml

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
exclude: |
Expand All @@ -100,18 +90,17 @@ repos:
canvas_cli/templates/
)
# https://github.com/python-poetry/poetry/issues/7184
entry: |
bash -c "
python -m pip install --upgrade pip setuptools wheel \
&& poetry install --no-ansi \
&& exec poetry run mypy --show-traceback $@
python -m pip install --upgrade pip setuptools wheel uv \
&& uv sync \
&& exec uv run mypy --show-traceback $@
"
- repo: local
hooks:
- id: check-protobufs-definitions
name: Check Protobufs Definitions
entry: poetry run ./bin/generate-protobufs
entry: uv run ./bin/generate-protobufs
language: system
pass_filenames: false
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
# CHANGELOG


## v0.17.0 (2025-02-04)

### Bug Fixes

- Embed the synchronizer process within the plugin runner
([#333](https://github.com/canvas-medical/canvas-plugins/pull/333),
[`ab576f2`](https://github.com/canvas-medical/canvas-plugins/commit/ab576f2918a3a39530afa0dc8a81bbf6cc61c7cd))

### Chores

- Auto-update pre-commit hooks ([#268](https://github.com/canvas-medical/canvas-plugins/pull/268),
[`2df702e`](https://github.com/canvas-medical/canvas-plugins/commit/2df702ec61c39437a8186564491417824d4d2e2c))

- Bump ipython from 8.31.0 to 8.32.0
([#385](https://github.com/canvas-medical/canvas-plugins/pull/385),
[`c47ab8a`](https://github.com/canvas-medical/canvas-plugins/commit/c47ab8a2e0a4f27b40eb3780949fb42a65fca3fa))

- Bump pytest-asyncio from 0.25.2 to 0.25.3 in the development-patches group
([#384](https://github.com/canvas-medical/canvas-plugins/pull/384),
[`78e3d12`](https://github.com/canvas-medical/canvas-plugins/commit/78e3d1272d9fec9947b8fa607e5f673bd77e8863))

- Bump rapidfuzz from 3.11.0 to 3.12.1
([#379](https://github.com/canvas-medical/canvas-plugins/pull/379),
[`0bc2b0a`](https://github.com/canvas-medical/canvas-plugins/commit/0bc2b0a71c14f3a4fbc169b24deea491bb97a261))

- Bump the development-minors group across 1 directory with 2 updates
([#383](https://github.com/canvas-medical/canvas-plugins/pull/383),
[`b01f109`](https://github.com/canvas-medical/canvas-plugins/commit/b01f1093cf8f9a07c57bbd99b0728a284d19cc59))

- Proper fix integration tests ([#375](https://github.com/canvas-medical/canvas-plugins/pull/375),
[`0563dc2`](https://github.com/canvas-medical/canvas-plugins/commit/0563dc205751fe0df108d2a506ab4be38dfb8434))

### Features

- Migrate from poetry to uv ([#355](https://github.com/canvas-medical/canvas-plugins/pull/355),
[`268decd`](https://github.com/canvas-medical/canvas-plugins/commit/268decd3d1ca001afe6016a365953fe1aeb222c7))


## v0.16.0 (2025-01-29)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion canvas_cli/apps/plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def validate_package(package: Path) -> Path:


def _build_package(package: Path) -> Path:
"""Runs `poetry build` on `package` and returns the built archive, ignoring symlinks, hidden folders, and hidden files."""
"""Compresses `package` and returns the built archive, ignoring symlinks, hidden folders, and hidden files."""
package = package.resolve()

if not package.exists() or not package.is_dir():
Expand Down
10 changes: 8 additions & 2 deletions canvas_sdk/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from canvas_sdk.utils.http import Http
from canvas_sdk.utils.http import Http, batch_get, batch_patch, batch_post, batch_put

__all__ = ("Http",)
__all__ = (
"Http",
"batch_get",
"batch_patch",
"batch_post",
"batch_put",
)
Loading

0 comments on commit 7abd3cb

Please sign in to comment.