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
34 changes: 16 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
repos:
- repo: https://github.com/facebook/pyrefly
rev: main
hooks:
- id: pyrefly-typecheck
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: local
hooks:
- id: pyrefly
name: pyrefly
entry: poetry run pyrefly check
language: system
types_or: [python, pyi]
pass_filenames: false
- id: black
name: black
entry: poetry run black
language: system
types_or: [python, pyi]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
entry: poetry run isort
language: system
types_or: [python, pyi]
- repo: https://github.com/PyCQA/flake8
rev: 7.2.0
hooks:
- id: flake8
name: flake8
entry: poetry run flake8
language: system
types_or: [python, pyi]
additional_dependencies:
- flake8-bugbear
- flake8-unused-arguments
- flake8-print
- flake8-type-checking
- flake8-pyproject
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This is an AI-centric Python application with a clean, modular structure:
- Pydantic for data validation and settings management
- Structured logging with structlog
- Async-first design with httpx for HTTP operations
- Type safety enforced through Basedpyright and Pyrefly
- Type safety enforced through Pyrefly

4. **AI/ML Integration Points**:
- Anthropic Claude API integration
Expand All @@ -85,11 +85,11 @@ This project uses Nix for reproducible development environments. Enter the dev s
nix develop
```

The environment includes:
The Nix environment provides:
- Python 3.13
- All development tools (black, isort, flake8, pytest, pyrefly, etc.)
- Pre-configured pre-commit hooks
- Environment file support (`.env`, `.test.env`, `.deploy.env`)
- Poetry

Run `poetry install` after entering the shell to install all development tools (black, isort, flake8, pytest, pyrefly, pre-commit, etc.).

## Code Quality Standards

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ This template provides a complete development environment for AI/ML applications

3. The Nix environment will automatically provide:
- Python 3.13
- All development tools (poetry, black, isort, flake8, pyrefly, etc.)
- Pre-commit hooks
- Poetry

4. Install all development tools (black, isort, flake8, pyrefly, pre-commit, etc.) via Poetry:
```bash
poetry install
```

#### Option 2: Without Nix (You already have Python)

Expand Down Expand Up @@ -90,7 +94,7 @@ poetry run pyrefly check # Type checking

#### Pre-commit Hooks
```bash
pre-commit run --all-files
poetry run pre-commit run --all-files
```

## Configuration
Expand Down Expand Up @@ -134,9 +138,9 @@ poetry add --group dev <package-name>

## Type Checking

This template uses Pyrefly (and Basedpyright) for type checking. Run type checks with:
This template uses Pyrefly for type checking. Run type checks with:
```bash
pyrefly check
poetry run pyrefly check
```

## Tips for Development
Expand Down
7 changes: 1 addition & 6 deletions devshell.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# https://numtide.github.io/devshell
# https://numtide.github.io/devshell/getting_started.html
[[commands]]
package = "python313"

[devshell]
packages = [
"poetry"
]
packages = []

[[commands]]
name = "runLint"
Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
overlays = [ devshell.overlays.default ];
};
in
let
poetryWithPlugins = pkgs.poetry.withPlugins (ps: [ ps.poetry-plugin-up ]);
in
pkgs.devshell.mkShell {
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
packages = [ pkgs.python313 poetryWithPlugins ];
};
});
}
12 changes: 6 additions & 6 deletions poetry.lock

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

52 changes: 27 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ authors = [
]
requires-python = ">=3.13"
dependencies = [
"anthropic>=0.55.0",
"anthropic (>=0.86.0)",
"httpx>=0.28.1",
"huggingface-hub>=0.33.1",
"mcp[cli]>=1.10.1",
"openai>=1.93.0",
"pydantic>=2.11.7",
"pydantic-settings>=2.10.1",
"rich>=14.0.0",
"structlog>=25.4.0",
"tenacity>=9.1.2",
"huggingface-hub (>=1.7.2)",
"mcp[cli] (>=1.26.0)",
"openai (>=2.29.0)",
"pydantic (>=2.12.5)",
"pydantic-settings (>=2.13.1)",
"rich (>=14.3.3)",
"structlog (>=25.5.0)",
"tenacity (>=9.1.4)",
]

[project.scripts]
Expand All @@ -31,24 +31,24 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.group.dev.dependencies]
coverage = ">=7.9.1"
debugpy = ">=1.8.14"
pre-commit = ">=4.2.0"
pyrefly = ">=0.21.0"
pytest = ">=8.4.1"
pytest-asyncio = ">=1.0.0"
pytest-cov = ">=6.2.1"
coverage = ">=7.13.5"
debugpy = ">=1.8.20"
pre-commit = ">=4.5.1"
pyrefly = ">=0.57.1"
pytest = ">=9.0.2"
pytest-asyncio = ">=1.3.0"
pytest-cov = ">=7.1.0"
pytest-dotenv = ">=0.5.2"
pytest-mock = ">=3.14.1"
pytest-sugar = ">=1.0.0"
black = ">=24.0.0"
isort = ">=5.13.0"
flake8 = ">=7.0.0"
flake8-bugbear = ">=24.0.0"
flake8-unused-arguments = ">=0.0.13"
pytest-mock = ">=3.15.1"
pytest-sugar = ">=1.1.1"
black = ">=26.3.1"
isort = ">=8.0.1"
flake8 = ">=7.3.0"
flake8-bugbear = ">=25.11.29"
flake8-unused-arguments = ">=0.0.14"
flake8-print = ">=5.0.0"
flake8-type-checking = ">=2.9.0"
flake8-pyproject = ">=1.2.0"
flake8-type-checking = ">=3.2.0"
flake8-pyproject = ">=1.2.4"

[tool.pyrefly]
project_includes = ["**/*"]
Expand Down Expand Up @@ -89,7 +89,9 @@ per-file-ignores = [
"bin/*.py:T201,T203",
"scripts/*.py:T201,T203",
"tests/*.py:T201,T203",
"tests/**/*.py:T201,T203",
"examples/*.py:T201,T203",
"examples/**/*.py:T201,T203",
]

[tool.pytest.ini_options]
Expand Down
Loading