Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check .
- run: ruff format --check .

test-sdk:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install hatch
- name: Run tests
working-directory: packages/flopro-sdk
run: hatch run test

test-adk:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install hatch
- name: Run tests
working-directory: packages/flopro-adk
run: hatch run test

build:
runs-on: ubuntu-latest
needs: [lint, test-sdk, test-adk]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- name: Build flopro-sdk
run: python -m build packages/flopro-sdk
- name: Build flopro-adk
run: python -m build packages/flopro-adk
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release to PyPI

on:
push:
tags:
- "flopro-sdk/v*"
- "flopro-adk/v*"

jobs:
determine-package:
runs-on: ubuntu-latest
outputs:
package-dir: ${{ steps.parse.outputs.package-dir }}
package-name: ${{ steps.parse.outputs.package-name }}
steps:
- name: Parse tag
id: parse
run: |
TAG="${GITHUB_REF#refs/tags/}"
PACKAGE_NAME="${TAG%%/v*}"
echo "package-dir=packages/${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"
echo "package-name=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"

build:
needs: determine-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- name: Build package
run: python -m build ${{ needs.determine-package.outputs.package-dir }}
- uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ needs.determine-package.outputs.package-dir }}/dist/

publish:
needs: [determine-package, build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/${{ needs.determine-package.outputs.package-name }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__/
*.pyc
.venv/
.pytest_cache/
*.egg-info/
dist/
build/
5 changes: 5 additions & 0 deletions packages/flopro-adk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

- Initial release
3 changes: 3 additions & 0 deletions packages/flopro-adk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flopro-adk

FloPro Agent Development Kit. Depends on flopro-sdk.
2 changes: 2 additions & 0 deletions packages/flopro-adk/flopro_adk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
33 changes: 33 additions & 0 deletions packages/flopro-adk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "flopro-adk"
version = "0.1.0"
description = "FloPro Agent Development Kit"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = ["flopro-sdk>=0.1.0"]

[project.urls]
Homepage = "https://github.com/amzn/FloPro"

[tool.hatch.envs.default]
dependencies = [
"pytest",
"ruff",
]
pre-install-commands = [
"pip install -e {root:uri}/../flopro-sdk",
]

[tool.hatch.envs.default.scripts]
test = "pytest -v"
lint = "ruff check ."
format-check = "ruff format --check ."

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
testpaths = ["tests"]
Empty file.
6 changes: 6 additions & 0 deletions packages/flopro-adk/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0


def test_import_adk():
import flopro_adk # noqa: F401
5 changes: 5 additions & 0 deletions packages/flopro-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

- Initial release
3 changes: 3 additions & 0 deletions packages/flopro-sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flopro-sdk

Core SDK for FloPro.
2 changes: 2 additions & 0 deletions packages/flopro-sdk/flopro_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
29 changes: 29 additions & 0 deletions packages/flopro-sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "flopro-sdk"
version = "0.1.0"
description = "FloPro Core SDK"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/amzn/FloPro"

[tool.hatch.envs.default]
dependencies = [
"pytest",
"ruff",
]

[tool.hatch.envs.default.scripts]
test = "pytest -v"
lint = "ruff check ."
format-check = "ruff format --check ."

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
testpaths = ["tests"]
Empty file.
6 changes: 6 additions & 0 deletions packages/flopro-sdk/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0


def test_import_sdk():
import flopro_sdk # noqa: F401
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.ruff]
target-version = "py310"
Loading