-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lifei/show-readable-error-message-when-api-k…
…ey-not-specified * main: chore: setup workspace for exchange (#105)
- Loading branch information
Showing
63 changed files
with
5,895 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish | ||
|
||
# A release on goose will also publish exchange, if it has updated | ||
# This means in some cases we may need to make a bump in goose without other changes to release exchange | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get current version from pyproject.toml | ||
id: get_version | ||
run: | | ||
echo "VERSION=$(grep -m 1 'version =' "pyproject.toml" | awk -F'"' '{print $2}')" >> $GITHUB_ENV | ||
- name: Extract tag version | ||
id: extract_tag | ||
run: | | ||
TAG_VERSION=$(echo "${{ github.event.release.tag_name }}" | sed -E 's/v(.*)/\1/') | ||
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV | ||
- name: Check if tag matches version from pyproject.toml | ||
id: check_tag | ||
run: | | ||
if [ "${{ env.TAG_VERSION }}" != "${{ env.VERSION }}" ]; then | ||
echo "::error::Tag version (${{ env.TAG_VERSION }}) does not match version in pyproject.toml (${{ env.VERSION }})." | ||
exit 1 | ||
fi | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v1 | ||
with: | ||
version: "latest" | ||
|
||
- name: Build Package | ||
run: | | ||
uv build -o dist --package goose-ai | ||
uv build -o dist --package ai-exchange | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
# Contributing | ||
|
||
<p> | ||
<a href="#prerequisites">Prerequisites</a> • | ||
<a href="#developing-and-testing">Developing and testing</a> • | ||
<a href="#building-from-source">Building from source</a> • | ||
<a href="#developing-goose-plugins">Developing goose-plugins</a> • | ||
<a href="#running-ai-exchange-from-source">Running ai-exchange from source</a> • | ||
<a href="#evaluations">Evaluations</a> • | ||
<a href="#conventional-commits">Conventional Commits</a> | ||
</p> | ||
|
||
We welcome Pull Requests for general contributions. If you have a larger new feature or any questions on how to develop a fix, we recommend you open an [issue][issues] before starting. | ||
|
||
## Prerequisites | ||
|
||
Goose uses [uv][uv] for dependency management, and formats with [ruff][ruff]. | ||
Clone goose and make sure you have installed `uv` to get started. When you use | ||
`uv` below in your local goose directly, it will automatically setup the virtualenv | ||
and install dependencies. | ||
|
||
We provide a shortcut to standard commands using [just][just] in our `justfile`. | ||
|
||
Goose uses [uv][uv] for dependency management, and formats with [ruff][ruff] - install UV first: https://pypi.org/project/uv/ | ||
## Development | ||
|
||
## Developing and testing | ||
Now that you have a local environment, you can make edits and run our tests! | ||
|
||
Now that you have a local environment, you can make edits and run our tests. | ||
### Run Goose | ||
|
||
### Creating plugins | ||
If you've made edits and want to try them out, use | ||
|
||
Goose is highly configurable through plugins - it reads in modules that its dependencies install (e.g.`goose-plugins`) and uses those that start with certain prefixes (e.g. `goose.toolkit`) to inject their functionality. For example, you will note that Goose's CLI is actually merged with additional CLI methods that are exported from `goose-plugins`. | ||
``` | ||
uv run goose session start | ||
``` | ||
|
||
If you are building a net new feature, you should try to fit it inside a plugin. Goose and `goose-plugins` both support plugins, but there's an important difference in how contributions to each are reviewed. Use the guidelines below to decide where to contribute: | ||
or other `goose` commands. | ||
|
||
**When to Add to Goose**: | ||
If you want to run your local changes but in another directory, you can use the path in | ||
the virtualenv created by uv: | ||
|
||
Plugins added directly to Goose are subject to rigorous review. This is because they are part of the core system and need to meet higher standards for stability, performance, and maintainability, often being validated through benchmarking. | ||
``` | ||
alias goosedev=`uv run which goose` | ||
``` | ||
|
||
**When to Add to `goose-plugins`:** | ||
You can then run `goosedev` from another dir and it will use your current changes. | ||
|
||
Plugins in `goose-plugins` undergo less detailed reviews and are more modular or experimental. They can prove their value through usage or iteration over time and may be eventually moved over to Goose. | ||
### Run Tests | ||
|
||
To see how to add a toolkit, see the [toolkits documentation][adding-toolkit]. | ||
To run the test suite against your edges, use `pytest`: | ||
|
||
### Running tests | ||
```sh | ||
uv run pytest tests -m "not integration" | ||
``` | ||
|
@@ -49,58 +48,17 @@ or, as a shortcut, | |
just test | ||
``` | ||
|
||
## Building from source | ||
|
||
If you want to develop features on `goose`: | ||
|
||
1. Clone Goose: | ||
```bash | ||
git clone [email protected]:block-open-source/goose.git ~/Development/goose | ||
``` | ||
2. Get `uv` with `brew install uv` | ||
3. Set up your Python virtualenv: | ||
```bash | ||
cd ~/Development/goose | ||
uv sync | ||
uv venv | ||
``` | ||
4. Run the `source` command that follows the `uv venv` command to activate the virtualenv. | ||
5. Run Goose: | ||
```bash | ||
uv run goose session start # or any of goose's commands (e.g. goose --help) | ||
``` | ||
## Exchange | ||
|
||
### Running from source | ||
The lower level generation behind goose is powered by the [`exchange`][ai-exchange] package, also in this repo. | ||
|
||
When you build from source you may want to run it from elsewhere. | ||
|
||
1. Run `uv sync` as above | ||
2. Run ```export goose_dev=`uv run which goose` ``` | ||
3. You can use that from anywhere in your system, for example `cd ~/ && $goose_dev session start`, or from your path if you like (advanced users only) to be running the latest. | ||
|
||
## Developing goose-plugins | ||
|
||
1. Clone the `goose-plugins` repo: | ||
```bash | ||
git clone [email protected]:block-open-source/goose-plugins.git ~/Development/goose-plugins | ||
``` | ||
2. Follow the steps for creating a virtualenv in the `goose` section above | ||
3. Install `goose-plugins` in `goose`. This means any changes to `goose-plugins` in this folder will immediately be reflected in `goose`: | ||
```bash | ||
uv add --editable ~/Development/goose-plugins | ||
``` | ||
4. Make your changes in `goose-plugins`, add the toolkit to the `profiles.yaml` file and run `uv run goose session --start` to see them in action. | ||
|
||
## Running ai-exchange from source | ||
|
||
goose depends heavily on the [`ai-exchange`][ai-exchange] project, you can clone that repo and then work on both by running: | ||
Thanks to `uv` workspaces, any changes you make to `exchange` will be reflected in using your local goose. To run tests | ||
for exchange, head to `packages/exchange` and run tests just like above | ||
|
||
```sh | ||
uv add --editable <path/to/cloned/exchange> | ||
uv run pytest tests -m "not integration" | ||
``` | ||
|
||
then when you run goose with `uv run goose session start` it will be running it all from source. | ||
|
||
## Evaluations | ||
|
||
Given that so much of Goose involves interactions with LLMs, our unit tests only go so far to confirming things work as intended. | ||
|
Oops, something went wrong.