From 4391bf485ff8bcf3d246195d91408fb0de159ae3 Mon Sep 17 00:00:00 2001 From: Zhiheng Wang Date: Tue, 24 Mar 2026 12:08:03 -0700 Subject: [PATCH 1/3] feat: Add monorepo scaffold with flopro-sdk and flopro-adk packages Set up the initial monorepo folder structure following the FloPro open-source developer setup guide. Includes: - packages/flopro-sdk: Core SDK with no external dependencies - packages/flopro-adk: Agent Development Kit depending on flopro-sdk - Workspace-root pyproject.toml with hatch environment config - Placeholder directories for docs, examples, tools, and .github --- packages/flopro-adk/CHANGELOG.md | 5 +++++ packages/flopro-adk/README.md | 3 +++ packages/flopro-adk/flopro_adk/__init__.py | 2 ++ packages/flopro-adk/pyproject.toml | 15 +++++++++++++++ packages/flopro-adk/tests/__init__.py | 0 packages/flopro-sdk/CHANGELOG.md | 5 +++++ packages/flopro-sdk/README.md | 3 +++ packages/flopro-sdk/flopro_sdk/__init__.py | 2 ++ packages/flopro-sdk/pyproject.toml | 14 ++++++++++++++ packages/flopro-sdk/tests/__init__.py | 0 pyproject.toml | 16 ++++++++++++++++ 11 files changed, 65 insertions(+) create mode 100644 packages/flopro-adk/CHANGELOG.md create mode 100644 packages/flopro-adk/README.md create mode 100644 packages/flopro-adk/flopro_adk/__init__.py create mode 100644 packages/flopro-adk/pyproject.toml create mode 100644 packages/flopro-adk/tests/__init__.py create mode 100644 packages/flopro-sdk/CHANGELOG.md create mode 100644 packages/flopro-sdk/README.md create mode 100644 packages/flopro-sdk/flopro_sdk/__init__.py create mode 100644 packages/flopro-sdk/pyproject.toml create mode 100644 packages/flopro-sdk/tests/__init__.py create mode 100644 pyproject.toml diff --git a/packages/flopro-adk/CHANGELOG.md b/packages/flopro-adk/CHANGELOG.md new file mode 100644 index 0000000..3742d31 --- /dev/null +++ b/packages/flopro-adk/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.1.0 + +- Initial release diff --git a/packages/flopro-adk/README.md b/packages/flopro-adk/README.md new file mode 100644 index 0000000..438ac38 --- /dev/null +++ b/packages/flopro-adk/README.md @@ -0,0 +1,3 @@ +# flopro-adk + +FloPro Agent Development Kit. Depends on flopro-sdk. diff --git a/packages/flopro-adk/flopro_adk/__init__.py b/packages/flopro-adk/flopro_adk/__init__.py new file mode 100644 index 0000000..04f8b7b --- /dev/null +++ b/packages/flopro-adk/flopro_adk/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/flopro-adk/pyproject.toml b/packages/flopro-adk/pyproject.toml new file mode 100644 index 0000000..2295760 --- /dev/null +++ b/packages/flopro-adk/pyproject.toml @@ -0,0 +1,15 @@ +[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" diff --git a/packages/flopro-adk/tests/__init__.py b/packages/flopro-adk/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/packages/flopro-sdk/CHANGELOG.md b/packages/flopro-sdk/CHANGELOG.md new file mode 100644 index 0000000..3742d31 --- /dev/null +++ b/packages/flopro-sdk/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.1.0 + +- Initial release diff --git a/packages/flopro-sdk/README.md b/packages/flopro-sdk/README.md new file mode 100644 index 0000000..aa4b8a7 --- /dev/null +++ b/packages/flopro-sdk/README.md @@ -0,0 +1,3 @@ +# flopro-sdk + +Core SDK for FloPro. diff --git a/packages/flopro-sdk/flopro_sdk/__init__.py b/packages/flopro-sdk/flopro_sdk/__init__.py new file mode 100644 index 0000000..04f8b7b --- /dev/null +++ b/packages/flopro-sdk/flopro_sdk/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/flopro-sdk/pyproject.toml b/packages/flopro-sdk/pyproject.toml new file mode 100644 index 0000000..2a7ca73 --- /dev/null +++ b/packages/flopro-sdk/pyproject.toml @@ -0,0 +1,14 @@ +[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" diff --git a/packages/flopro-sdk/tests/__init__.py b/packages/flopro-sdk/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..28af96a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "flopro" +version = "0.1.0" +description = "FloPro - Monorepo root" +license = "Apache-2.0" +requires-python = ">=3.10" + +[tool.hatch.envs.default] +dependencies = [ + "flopro-sdk @ {root:uri}/packages/flopro-sdk", + "flopro-adk @ {root:uri}/packages/flopro-adk", +] From 8f92cea807a41eb062df971bc2fce4d81fa5f64f Mon Sep 17 00:00:00 2001 From: Zhiheng Wang Date: Tue, 24 Mar 2026 13:21:49 -0700 Subject: [PATCH 2/3] refactor: Move hatch envs to package-level pyproject files Simplify root pyproject.toml to shared ruff config only. Each package now owns its own hatch env with dev dependencies, test/lint scripts, and pytest config. This follows monorepo best practice where packages are independently buildable and testable. --- packages/flopro-adk/pyproject.toml | 18 ++++++++++++++++++ packages/flopro-sdk/pyproject.toml | 15 +++++++++++++++ pyproject.toml | 18 ++---------------- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/packages/flopro-adk/pyproject.toml b/packages/flopro-adk/pyproject.toml index 2295760..3656b82 100644 --- a/packages/flopro-adk/pyproject.toml +++ b/packages/flopro-adk/pyproject.toml @@ -13,3 +13,21 @@ 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"] diff --git a/packages/flopro-sdk/pyproject.toml b/packages/flopro-sdk/pyproject.toml index 2a7ca73..b1be770 100644 --- a/packages/flopro-sdk/pyproject.toml +++ b/packages/flopro-sdk/pyproject.toml @@ -12,3 +12,18 @@ 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"] diff --git a/pyproject.toml b/pyproject.toml index 28af96a..d8743ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,2 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "flopro" -version = "0.1.0" -description = "FloPro - Monorepo root" -license = "Apache-2.0" -requires-python = ">=3.10" - -[tool.hatch.envs.default] -dependencies = [ - "flopro-sdk @ {root:uri}/packages/flopro-sdk", - "flopro-adk @ {root:uri}/packages/flopro-adk", -] +[tool.ruff] +target-version = "py310" From bcefa9fcf69e792eaa970d2aab5a137550361997 Mon Sep 17 00:00:00 2001 From: Zhiheng Wang Date: Tue, 24 Mar 2026 13:33:51 -0700 Subject: [PATCH 3/3] ci: Add GitHub Actions for CI and PyPI release Add CI workflow with ruff lint, pytest across Python 3.10-3.12, and build verification for both flopro-sdk and flopro-adk packages. Add release workflow with tag-triggered PyPI publish using trusted publishing. Tags use pattern flopro-sdk/v* and flopro-adk/v* for independent per-package releases. Add placeholder test_import.py for each package and .gitignore. --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++ .github/workflows/release.yml | 53 ++++++++++++++++++++ .gitignore | 7 +++ packages/flopro-adk/tests/test_import.py | 6 +++ packages/flopro-sdk/tests/test_import.py | 6 +++ 5 files changed, 135 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 packages/flopro-adk/tests/test_import.py create mode 100644 packages/flopro-sdk/tests/test_import.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ef3f97e --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ae05ed7 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..714a467 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +.venv/ +.pytest_cache/ +*.egg-info/ +dist/ +build/ diff --git a/packages/flopro-adk/tests/test_import.py b/packages/flopro-adk/tests/test_import.py new file mode 100644 index 0000000..aa627bb --- /dev/null +++ b/packages/flopro-adk/tests/test_import.py @@ -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 diff --git a/packages/flopro-sdk/tests/test_import.py b/packages/flopro-sdk/tests/test_import.py new file mode 100644 index 0000000..01de05f --- /dev/null +++ b/packages/flopro-sdk/tests/test_import.py @@ -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