From 023b461773f0dd7e7e6dc8d613da9c01e2c648ed Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 22 Mar 2026 12:23:28 -0700 Subject: [PATCH] More poetry related updates and dependencies updated --- .pre-commit-config.yaml | 34 +++++++++++++-------------- CLAUDE.md | 10 ++++---- README.md | 14 +++++++---- devshell.toml | 7 +----- flake.nix | 4 ++++ poetry.lock | 12 +++++----- pyproject.toml | 52 +++++++++++++++++++++-------------------- 7 files changed, 68 insertions(+), 65 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50e47a8..a54d0ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CLAUDE.md b/CLAUDE.md index f1c2f25..0b49a7d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 @@ -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 diff --git a/README.md b/README.md index 6a8b03e..bbd45fd 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -134,9 +138,9 @@ poetry add --group dev ## 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 diff --git a/devshell.toml b/devshell.toml index a2dfd49..28399e3 100644 --- a/devshell.toml +++ b/devshell.toml @@ -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" diff --git a/flake.nix b/flake.nix index 5cfbcc5..a90e448 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; }; }); } diff --git a/poetry.lock b/poetry.lock index 5513ed7..f6bf165 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand. [[package]] name = "annotated-doc" @@ -1047,7 +1047,7 @@ files = [ [package.dependencies] attrs = ">=22.2.0" -jsonschema-specifications = ">=2023.03.6" +jsonschema-specifications = ">=2023.3.6" referencing = ">=0.28.4" rpds-py = ">=0.25.0" @@ -2092,14 +2092,14 @@ uvicorn = ["uvicorn (>=0.34.0)"] [[package]] name = "starlette" -version = "0.52.1" +version = "1.0.0" description = "The little ASGI library that shines." optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "starlette-0.52.1-py3-none-any.whl", hash = "sha256:0029d43eb3d273bc4f83a08720b4912ea4b071087a3b48db01b7c839f7954d74"}, - {file = "starlette-0.52.1.tar.gz", hash = "sha256:834edd1b0a23167694292e94f597773bc3f89f362be6effee198165a35d62933"}, + {file = "starlette-1.0.0-py3-none-any.whl", hash = "sha256:d3ec55e0bb321692d275455ddfd3df75fff145d009685eb40dc91fc66b03d38b"}, + {file = "starlette-1.0.0.tar.gz", hash = "sha256:6a4beaf1f81bb472fd19ea9b918b50dc3a77a6f2e190a12954b25e6ed5eea149"}, ] [package.dependencies] @@ -2259,4 +2259,4 @@ python-discovery = ">=1" [metadata] lock-version = "2.1" python-versions = ">=3.13" -content-hash = "7cf59c1e9b1d0fa8ee5e15e1ed2a37b2877577166eed35f55873eee3967cac62" +content-hash = "5a04dfbc30eadfcf64521cc000dc1cdf425ca0ba11c78480a16f12133426fb47" diff --git a/pyproject.toml b/pyproject.toml index f04d6ae..e3b4560 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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 = ["**/*"] @@ -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]