Skip to content

Commit fc2203d

Browse files
committed
Update project configuration and dependencies: change default model in .env.example, upgrade pre-commit hooks, adjust Python version requirements, and enhance Makefile commands for setup and linting.
1 parent c504e82 commit fc2203d

7 files changed

Lines changed: 1363 additions & 796 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Required: Your OpenAI API key for the Agents SDK to function.
88
OPENAI_API_KEY=sk-...
9-
DEFAULT_MODEL=gpt-4o-mini
9+
DEFAULT_MODEL=gpt-5-nano
1010

1111
# Optional: The logging level for the application.
1212
# Options: DEBUG, INFO, WARNING, ERROR

.pre-commit-config.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -12,31 +12,15 @@ repos:
1212
- id: check-docstring-first
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.1.8
15+
rev: v0.12.11
1616
hooks:
17-
- id: ruff
18-
args: [--fix, --exit-non-zero-on-fix]
1917
- id: ruff-format
2018

21-
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v1.8.0
23-
hooks:
24-
- id: mypy
25-
files: ^topics/
26-
args: [--ignore-missing-imports]
27-
additional_dependencies: [types-requests]
28-
29-
- repo: https://github.com/nbQA-dev/nbQA
30-
rev: 1.7.1
31-
hooks:
32-
- id: nbqa-ruff
33-
files: \.ipynb$
34-
3519
- repo: local
3620
hooks:
3721
- id: pytest-check
3822
name: pytest-check
39-
entry: uv run pytest --co -q
23+
entry: bash -c "PYTHONPATH=. uv run pytest --co -q -m \"not integration\""
4024
language: system
4125
pass_filenames: false
4226
always_run: true

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
3.12

Makefile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,43 @@
1-
.PHONY: help install install-dev test lint format format-check clean setup pre-commit-install pre-commit-run lock-check run
1+
.PHONY: help install install-dev setup pre-commit-install pre-commit-run lint format typecheck test clean lock-check run
22

33
export PYTHONPATH := .
4+
VENV_DIR = .venv
45

56
help:
6-
@echo "Available commands:"
7+
@echo 'Available commands:'
78
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
89

9-
install: ## Install core dependencies
10+
install:
1011
uv sync
1112

12-
install-dev: ## Install core + dev dependencies
13+
install-dev:
1314
uv sync --extra dev
1415

15-
setup: install-dev pre-commit-install ## Full dev setup
16-
17-
pre-commit-install: ## Install pre-commit hooks
16+
setup:
17+
@if [ ! -d "$(VENV_DIR)" ]; then \
18+
echo 'Creating virtual environment in $(VENV_DIR)...'; \
19+
uv venv; \
20+
fi
21+
@echo 'Installing dependencies...'
22+
@uv sync --extra dev
23+
@echo 'Installing pre-commit hooks...'
24+
@uv run pre-commit install
25+
@echo '\n✅ Setup complete. To activate the environment, run:\nsource .venv/bin/activate'
26+
27+
pre-commit-install:
1828
uv run pre-commit install
1929

20-
pre-commit-run: ## Run pre-commit on all files
30+
pre-commit-run:
2131
uv run pre-commit run --all-files
2232

23-
lint: ## Run Ruff linter
24-
uv run ruff check .
33+
lint:
34+
uv run ruff check . --fix
2535

26-
format: ## Format code with Ruff
36+
format:
2737
uv run ruff format .
2838

29-
format-check: ## Check formatting (CI)
30-
uv run ruff format --check .
39+
typecheck:
40+
uv run pyright -p pyrightconfig.strict.json
3141

3242
test: ## Run Pytest
3343
uv run pytest

pyproject.toml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,40 @@
11
[project]
22
name = "templates.python"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
description = "A boilerplate for Python projects."
55
readme = "README.md"
6-
requires-python = ">=3.13"
6+
requires-python = ">=3.12"
77
license = {text = "MIT"}
88
authors = [
99
{name = "Andy Pai", email = "andy@r2pi.co"},
1010
]
11-
classifiers = [
12-
"Development Status :: 4 - Beta",
13-
"Intended Audience :: Developers",
14-
"Intended Audience :: Science/Research",
15-
"License :: OSI Approved :: MIT License",
16-
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.13",
18-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
19-
]
2011

2112
dependencies = [
13+
"openai-agents>=0.2.2",
14+
"pydantic>=2.11.7",
15+
"pydantic-settings>=2.10.1",
2216
"structlog>=24.0.0",
2317
"tqdm>=4.65.0",
24-
"pydantic>=2.0.0",
25-
"pydantic-settings>=2.0.0",
26-
"openai-agents>=0.2.2",
2718
]
2819

2920
[project.optional-dependencies]
3021
dev = [
31-
"pytest>=7.4.0",
32-
"pytest-cov>=4.1.0",
33-
"ruff>=0.1.0",
34-
"pre-commit>=3.0.0",
35-
"mypy>=1.0.0",
36-
"types-requests>=2.31.0",
22+
"ipykernel>=6.30.1",
23+
"pre-commit>=4.2.0",
24+
"pyright>=1.1.404",
25+
"pytest>=8.4.1",
26+
"pytest-cov>=6.2.1",
27+
"ruff>=0.12.11",
3728
]
3829

3930
ml = [
40-
"torch>=2.0.0",
41-
"scikit-learn>=1.3.0",
42-
"mlflow>=2.0.0",
43-
"matplotlib>=3.7.0",
44-
"numpy>=1.24.0",
45-
"pandas>=2.0.0",
46-
"seaborn>=0.12.0",
31+
"torch>=2.7.1",
32+
"scikit-learn>=1.7.1",
33+
"mlflow>=3.1.1",
34+
"matplotlib>=3.10.3",
35+
"numpy>=2.3.1",
36+
"pandas>=2.3.1",
37+
"seaborn>=0.13.2",
4738
]
4839

4940
[tool.ruff]
@@ -62,7 +53,7 @@ select = [
6253
"N", # pep8-naming
6354
"RUF", # ruff-specific rules
6455
]
65-
ignore = ["E501", "B008", "C901", "N812"]
56+
ignore = ["E501", "B008", "C901", "N812", "N803", "N806"]
6657

6758
[tool.ruff.format]
6859
quote-style = "single"
@@ -77,10 +68,12 @@ addopts = ["-ra"]
7768
pythonpath = ["."]
7869

7970
[tool.pyright]
80-
include = ["*.py", "models", "tests"]
81-
exclude = ["**/__pycache__", "config"]
82-
typeCheckingMode = "strict"
71+
include = ["*.py", "tests"]
72+
exclude = ["**/__pycache__"]
73+
typeCheckingMode = "off"
74+
8375
reportMissingImports = true
8476
reportMissingTypeStubs = false
85-
pythonVersion = "3.13"
77+
78+
pythonVersion = "3.12"
8679
pythonPlatform = "All"

pyrightconfig.strict.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/pyright/dist/pyright.schema.json",
3+
"include": [
4+
"research/src"
5+
],
6+
"exclude": [
7+
"**/__pycache__",
8+
"**/typings"
9+
],
10+
"typeCheckingMode": "basic",
11+
"reportMissingImports": true,
12+
"useLibraryCodeForTypes": true
13+
}

0 commit comments

Comments
 (0)