Skip to content

Commit e615270

Browse files
codebydivineclaude
andcommitted
build: complete migration to Poetry build system
- Convert pyproject.toml from setuptools to pure Poetry configuration - Update build backend to poetry-core.masonry.api - Add Poetry installation instructions to README - Update setup-pre-commit.sh to use Poetry commands - Ensure consistent dependency management across the project 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent a4ddab6 commit e615270

File tree

3 files changed

+26
-28
lines changed

3 files changed

+26
-28
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ A clean, intuitive Python client for The Graph Token API with elegant EVM/SVM se
1313
### Installation
1414

1515
```bash
16+
# For end users
1617
pip install divine-thegraph-token-api
18+
19+
# For development
20+
poetry install
1721
```
1822

1923
### Basic Usage

pyproject.toml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["poetry-core"]
3+
build-backend = "poetry.core.masonry.api"
44

5-
[project]
5+
[tool.poetry]
66
name = "divine-thegraph-token-api"
77
version = "0.1.28"
8-
authors = [
9-
{ name = "DIVINE", email = "[email protected]" },
10-
]
118
description = "A Python client for The Graph Token API with elegant EVM/SVM separation and excellent test coverage"
9+
authors = ["DIVINE <[email protected]>"]
1210
readme = "README.md"
1311
license = "MIT"
14-
requires-python = ">=3.13"
15-
classifiers = [
16-
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.13",
18-
"Operating System :: OS Independent",
19-
"Development Status :: 4 - Beta",
20-
"Intended Audience :: Developers",
21-
"Topic :: Software Development :: Libraries :: Python Modules",
22-
"Typing :: Typed",
23-
]
12+
packages = [{include = "thegraph_token_api", from = "src"}]
13+
14+
[tool.poetry.urls]
15+
Homepage = "https://github.com/divinescreener/thegraph-token-api"
16+
Issues = "https://github.com/divinescreener/thegraph-token-api/issues"
2417

2518
[tool.poetry.dependencies]
19+
python = ">=3.13"
2620
divine-typed-requests = ">=0.1.25"
2721
divine-type-enforcer = ">=0.1.9"
2822
httpx = {extras = ["http2"], version = "^0.28.1"}
@@ -39,13 +33,6 @@ ruff = "^0.12.4"
3933
mypy = "^1.17.0"
4034
bandit = { extras = ["toml"], version = "^1.8.6" }
4135

42-
[project.urls]
43-
Homepage = "https://github.com/divinescreener/thegraph-token-api"
44-
Issues = "https://github.com/divinescreener/thegraph-token-api/issues"
45-
46-
[tool.setuptools.packages.find]
47-
where = ["src"]
48-
4936
[tool.pytest.ini_options]
5037
pythonpath = ["src"]
5138
testpaths = ["tests"]

setup-pre-commit.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33

44
echo "Setting up pre-commit hooks for divine-thegraph-token-api..."
55

6+
# Check if Poetry is available
7+
if ! command -v poetry &> /dev/null; then
8+
echo "❌ Poetry is not installed. Please install Poetry first:"
9+
echo " curl -sSL https://install.python-poetry.org | python3 -"
10+
exit 1
11+
fi
12+
613
# Install dev dependencies (including pre-commit)
7-
echo "Installing dev dependencies..."
8-
pip install -e ".[dev]"
14+
echo "Installing dev dependencies with Poetry..."
15+
poetry install
916

1017
# Install pre-commit hooks
1118
echo "Installing pre-commit hooks..."
12-
pre-commit install
19+
poetry run pre-commit install
1320

1421
# Run pre-commit on all files to show what it will do
1522
echo "Running pre-commit on all files (this will show and fix any formatting issues)..."
16-
pre-commit run --all-files
23+
poetry run pre-commit run --all-files
1724

1825
echo ""
1926
echo "✅ Pre-commit hooks are now installed!"
@@ -24,5 +31,5 @@ echo " - Ruff formatter will format your code"
2431
echo " - MyPy will check types"
2532
echo " - Various file checks will run"
2633
echo ""
27-
echo "To manually run pre-commit: pre-commit run --all-files"
34+
echo "To manually run pre-commit: poetry run pre-commit run --all-files"
2835
echo "To bypass pre-commit (not recommended): git commit --no-verify"

0 commit comments

Comments
 (0)