Skip to content

Commit

Permalink
chore: introduce towncrier
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRAG committed Feb 26, 2025
1 parent 72ec8da commit 340f61e
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 43 deletions.
28 changes: 27 additions & 1 deletion CONTRIBUTING-PYTHON.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,30 @@ make lint-fix

## Changelog

Currently the CHANGELOG.md is managed manually. Please include a changelog entry in the appropriate package's CHANGELOG.md file when you add a new feature or fix a bug.
We use [towncrier](https://towncrier.readthedocs.io/en/stable/index.html) to manage the changelog.

Changelog entries should be in the past tense, and they should be as specific as possible. Some examples of good changelog entries:

- Added a new action provider to interact with Fancy Protocl
- Fixed a bug preventing wallet balances to be formatted correctly

Changelog entries are stored in the `changelog.d` directory. Each changelog entry is stored as a markdown file named after the type of change it is and the issue number it is associated with. For example, a bug fix associated with issue #123 would be stored in `changelog.d/123.bugfix.md`. If your change does not have an associated issue, you can first create the Pull Request, and then use the PR number in the changelog entry filename.

To add a changelog entry, you can create the changelog entry file yourself, or use `towncrier` to create it for you. For example, to create a changelog entry for a bug fix in `coinbase-agentkit` associated with issue #123, run the following command from the package you are making a change to:

```bash
cd python/coinbase-agentkit

# Create a new changelog entry file for a bugfix relating to issue #123
poetry run towncrier create --content "Fixed a bug" 123.bugfix.md

# Or, create a new changelog entry for a feature relating to issue #124
poetry run towncrier create --content "Added a new feature" 124.feature.md
```

This will create a new changelog entry in the `changelog.d` directory, which should be committed along the changes in your Pull Request.

The types of changes you can add are:

- `feature`
- `bugfix`
1 change: 1 addition & 0 deletions python/coinbase-agentkit/changelog.d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
21 changes: 20 additions & 1 deletion python/coinbase-agentkit/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions python/coinbase-agentkit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ myst-parser = "^4.0.0"
ruff-lsp = "^0.0.58"
python-lsp-server = "^1.12.0"
tweepy = "^4.15.0"
towncrier = "^24.8.0"

[build-system]
requires = ["poetry-core"]
Expand Down Expand Up @@ -56,3 +57,16 @@ line-ending = "auto"

[tool.ruff.lint.isort]
known-first-party = ["coinbase_agentkit, cdp"]

[tool.towncrier]
package = "coinbase_agentkit"
package_dir = "coinbase_agentkit"
filename = "CHANGELOG.md"
directory = "changelog.d/"
start_string = "# Coinbase AgentKit Changelog"

[tool.towncrier.fragment.feature]
name = "Added"

[tool.towncrier.fragment.bugfix]
name = "Fixed"
1 change: 1 addition & 0 deletions python/create-onchain-agent/changelog.d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
97 changes: 63 additions & 34 deletions python/create-onchain-agent/poetry.lock

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions python/create-onchain-agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[project]
[tool.poetry]
name = "create-onchain-agent"
version = "0.1.3"
description = "CLI to create an onchain agent project"
authors = [
{name = "Carson Roscoe",email = "[email protected]"}
]
authors = ["Carson Roscoe <[email protected]>"]
readme = "README.md"
requires-python = ">=3.10"
license = "Apache-2.0"
keywords = ["coinbase", "sdk", "crypto", "cdp", "agentkit", "ai", "agent"]
packages = [{ include = "create_onchain_agent" }]

[tool.poetry.dependencies]
Expand All @@ -19,9 +18,25 @@ requests = "^2.32.3"
platformdirs = "^4.3.6"
prompt-toolkit = "^3.0.50"

[tool.poetry.group.dev.dependencies]
towncrier = "^24.8.0"

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
create-onchain-agent = "create_onchain_agent.cli:create_project"

[tool.towncrier]
package = "create_onchain_agent"
package_dir = "create_onchain_agent"
filename = "CHANGELOG.md"
directory = "changelog.d/"
start_string = "# Coinbase Create Onchain Agent Changelog"

[tool.towncrier.fragment.feature]
name = "Added"

[tool.towncrier.fragment.bugfix]
name = "Fixed"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
23 changes: 21 additions & 2 deletions python/framework-extensions/langchain/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions python/framework-extensions/langchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ sphinx-autodoc-typehints = "^2.4.4"
myst-parser = "^4.0.0"
ruff-lsp = "^0.0.58"
python-lsp-server = "^1.12.0"
towncrier = "^24.8.0"

[build-system]
requires = ["poetry-core"]
Expand Down Expand Up @@ -53,3 +54,16 @@ line-ending = "auto"

[tool.ruff.lint.isort]
known-first-party = ["coinbase_agentkit"]

[tool.towncrier]
package = "coinbase_agentkit_langchain"
package_dir = "coinbase_agentkit_langchain"
filename = "CHANGELOG.md"
directory = "changelog.d/"
start_string = "# Coinbase AgentKit Framework Extension - Langchain Changelog"

[tool.towncrier.fragment.feature]
name = "Added"

[tool.towncrier.fragment.bugfix]
name = "Fixed"

0 comments on commit 340f61e

Please sign in to comment.