Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
107 changes: 32 additions & 75 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,116 +12,73 @@ on:

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.setup_uv.outputs.cache-hit }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv (+ enable cache)
id: setup_uv
uses: astral-sh/setup-uv@v6
with:
python-version: 3.12
enable-cache: true

- name: Cache virtual environment
id: cached-virtualenv
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-virtualenv.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install poetry
poetry install
- name: Sync dependencies
run: uv sync --locked --dev

- name: Prune uv cache (optimized for CI)
run: uv cache prune --ci

ruff-format:
name: ruff-format
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Restore virtual environment cache
uses: actions/cache@v4
- name: Install uv + restore cache
uses: astral-sh/setup-uv@v6
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Set path
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
enable-cache: true

- name: Check ruff version
run: ruff --version

- name: Run ruff format check
run: ruff format --check .
- name: Check ruff formatting
run: uv run ruff format --check .

ruff-lint:
name: ruff-lint
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Restore virtual environment cache
uses: actions/cache@v4
- name: Install uv + restore cache
uses: astral-sh/setup-uv@v6
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Set path
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH

- name: Check ruff version
run: ruff --version
enable-cache: true

- name: Run ruff lint
run: ruff check --output-format=github .
run: uv run ruff check --output-format=github .

mypy-type-check:
name: mypy-type-check
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Restore virtual environment cache
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Set path
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH

- name: Check mypy version
run: mypy --version

- name: Run mypy type check
run: mypy .

pytest:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Restore virtual environment cache
uses: actions/cache@v4
- name: Install uv + restore cache
uses: astral-sh/setup-uv@v6
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Set path
run: echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
enable-cache: true

- name: Run pytest
run: pytest tests/
- name: Run mypy
run: uv run --frozen mypy .

publish:
runs-on: ubuntu-latest
Expand All @@ -132,12 +89,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
java-version: "17"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Publish package
run: cd java && ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-venv-${{ hashFiles('**/uv.lock') }}

- name: Install dependencies
if: steps.cached-virtualenv.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install poetry
poetry install
pip install uv
uv sync

- name: Build documentation
run: |
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,34 @@

### Prerequisites

- Python (3.12 or higher)
- Poetry (1.8.3 or higher)
- Python (3.13 or higher)
- uv (0.8.2 or higher)

### Installation

```bash
poetry install
uv sync
```

### Run Agent

```bash
poetry run python ./adf_core_python/launcher.py
uv run python ./adf_core_python/launcher.py

# get help
poetry run python ./adf_core_python/launcher.py -h
uv run python ./adf_core_python/launcher.py -h
```

### Build

```bash
poetry build
uv build
```

### Pre Commit

```bash
poetry run task precommit
uv run ruff format .
uv run ruff check .
uv run mypy .
```
56 changes: 0 additions & 56 deletions adf_core_python/cli/cli.py

This file was deleted.

Loading
Loading