From 6c660cc73c96962351c624f8ddc2bb7b7ed08203 Mon Sep 17 00:00:00 2001 From: Richard Bell Date: Thu, 29 Oct 2026 12:48:29 -0500 Subject: [PATCH] ci: configure Copilot cloud agent development environment Prepare Python 3.11 with locked development dependencies, optional PyArrow, and documentation tooling. Document environment usage and validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 51 +++++++++++++++++++++++ CONTRIBUTING.md | 35 ++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000..adc47530 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,51 @@ +name: Copilot Setup Steps + +on: + workflow_dispatch: + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + - pyproject.toml + - poetry.lock + - docs/requirements.txt + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + permissions: + contents: read + timeout-minutes: 20 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install Poetry + run: pipx install "poetry==2.5.1" + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: poetry + cache-dependency-path: | + pyproject.toml + poetry.lock + docs/requirements.txt + + - name: Install development dependencies and optional extras + run: | + poetry env use python + poetry install --with dev --all-extras --no-interaction + + - name: Install documentation dependencies + run: | + poetry run python -m pip freeze --exclude-editable > "$RUNNER_TEMP/copilot-constraints.txt" + poetry run python -m pip install --constraint "$RUNNER_TEMP/copilot-constraints.txt" --requirement docs/requirements.txt + poetry install --only-root --no-interaction + + - name: Verify environment + run: | + poetry run python -m pip check + poetry run python -c "import nisystemlink.clients; import pyarrow; import sphinx" + poetry run pytest --version + poetry run sphinx-build --version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a16917ee..5d33bc32 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,6 +96,41 @@ To only run the tests in one particular folder, run pytest tests/myfolder ``` +## Copilot cloud agent environment + +The [Copilot setup workflow](.github/workflows/copilot-setup-steps.yml) prepares +an Ubuntu environment with Python 3.11, Poetry, development dependencies, +the optional PyArrow extra, and documentation tooling. The project is installed +in editable mode, and commands run in the shared environment with `poetry run`. + +The setup uses `poetry.lock` for development dependencies and +[the documentation requirements](docs/requirements.txt) for Sphinx tooling. +Documentation installation is constrained to preserve the locked development +dependencies. Incompatible requirements fail setup rather than silently +changing those versions. + +Useful validation commands include: + +```sh +poetry run poe test +poetry run poe check +poetry run poe lint +poetry run poe types +poetry run poe doctest +poetry run sphinx-build -b html docs docs/_build/html +``` + +Setup performs lightweight environment checks, not the full validation suite. +Cloud, Enterprise, and web-server integration tests still require the +configuration described in this guide; the workflow does not provide service +credentials. + +The workflow supports Copilot sessions that run on GitHub Actions. After it is +merged into the default branch, it can also be run manually from the Actions +tab. Pull requests changing the workflow or its dependency inputs validate the +setup automatically. If setup fails, inspect the workflow or agent session logs; +the agent may still start with an incomplete environment. + ## Maintaining package exports Package `__init__.py` files are part of the public API surface for this library.