Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ jobs:

tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install Python versions
run: uv python install 3.11 3.12 3.13
- name: Install dependencies
run: uv sync --extra dev
- name: Unit Tests
run: make test-unit
- name: End to End Tests
- name: Run tests with tox
run: uv run tox
- name: Run E2E tests (Python 3.13)
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
run: make test-e2e
run: uv run --python 3.13 --extra dev python -m pytest tests/e2e -v
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ venv/
tmp/
.vscode/
build/
.DS_Store
.DS_Store
.tox/
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install-dev:
uv sync --extra dev

clean:
rm -rf __pycache__
rm -rf __pycache__ .tox dist

fmt:
uv run ruff format
Expand All @@ -36,3 +36,6 @@ test-e2e:
uv run python -m pytest tests/e2e

test-all: test-unit test-e2e

test-tox:
uv run tox
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Python 3.8+](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build](https://github.com/duneanalytics/dune-client/actions/workflows/pull-request.yaml/badge.svg)](https://github.com/duneanalytics/dune-client/actions/workflows/pull-request.yaml)

Expand Down Expand Up @@ -155,10 +155,10 @@ uv sync --extra dev
## Development Commands
```shell
# Format code
uv run black ./
uv run ruff format

# Lint code
uv run pylint dune_client/
uv run ruff check

# Type checking
uv run mypy dune_client/ --strict
Expand All @@ -168,6 +168,22 @@ uv run python -m pytest tests/unit # Unit tests
uv run python -m pytest tests/e2e # E2E tests (requires DUNE_API_KEY)
```

## Multi-Python Testing

This project supports Python 3.11, 3.12, and 3.13. You can test across all versions using tox with uv:

```shell
# Test all Python versions with tox
uv run tox
# or
make test-tox

# Test specific Python versions
uv run tox -e py311
uv run tox -e py312
uv run tox -e py313
```

## Makefile Shortcuts

### Installation
Expand All @@ -187,8 +203,9 @@ can also be run individually with `fmt`, `lint` and `types` respectively.
```shell
make test-unit # Unit tests
make test-e2e # Requires valid `DUNE_API_KEY`
make test-all # Both unit and e2e tests
make test-tox # Multi-Python testing (py311, py312, py313)
```
can also run both with `make test-all`

## Deployment

Expand Down
25 changes: 13 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@ build-backend = "hatchling.build"
name = "dune_client"
description = "A simple framework for interacting with Dune Analytics official API service."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.11"
license = {text = "Apache License Version 2.0"}
authors = [
{name = "Benjamin H. Smith & Dune Analytics", email = "ben@cow.fi"},
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
dependencies = [
"aiohttp~=3.10.0",
"dataclasses-json~=0.6.4",
"types-python-dateutil>=2.8.19.14",
"types-PyYAML>=6.0.12.11",
"types-requests>=2.28.0",
"types-setuptools>=68.2.0.0",
"python-dateutil~=2.8.2",
"requests~=2.31.0",
"ndjson~=0.3.1",
"Deprecated~=1.2.14",
"types-Deprecated>=1.2.9.3",
]
dynamic = ["version"]

Expand All @@ -38,12 +36,19 @@ Issues = "https://github.com/duneanalytics/dune-client/issues"

[project.optional-dependencies]
dev = [
"pytest>=7.4.1",
"ruff>=0.13.1",
"mypy>=1.5.1",
"tox>=4.0.0",
"tox-uv>=1.28.0",
# Type stubs
"types-python-dateutil>=2.8.19.14",
"types-requests>=2.28.0",
"types-Deprecated>=1.2.9.3",
# Optional features
"pandas>=1.0.0",
"pandas-stubs>=1.0.0",
"pytest>=7.4.1",
"python-dotenv>=1.0.0",
"mypy>=1.5.1",
"aiounittest>=1.4.2",
"colorlover>=0.3.0",
"plotly>=5.9.0",
Expand All @@ -55,10 +60,6 @@ source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["dune_client"]

[dependency-groups]
dev = [
"pyyaml>=6.0.2",
]

[tool.ruff]
# Increase the maximum line length to 100 characters.
Expand Down
26 changes: 26 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tox]
envlist = py311,py312,py313
isolated_build = true
skip_missing_interpreters = true
min_version = 4.0

[testenv]
description = Run tests with pytest
package = wheel
wheel_build_env = .pkg
runner = uv-venv-runner
extras = dev
commands =
python -m pytest tests/unit -v

[testenv:py311]
description = Run tests with Python 3.11
basepython = python3.11

[testenv:py312]
description = Run tests with Python 3.12
basepython = python3.12

[testenv:py313]
description = Run tests with Python 3.13
basepython = python3.13
Loading