Document Python import style guidelines in AGENTS.md - #299
Open
Bernhard Merkle (bmerkle) wants to merge 2 commits into
Open
Document Python import style guidelines in AGENTS.md#299Bernhard Merkle (bmerkle) wants to merge 2 commits into
Bernhard Merkle (bmerkle) wants to merge 2 commits into
Conversation
…and PR microsoft#198 - bump pyright version to 1.1.411, and - adjust uv_build requirement - small reformatting of answers.py
Codifies the module-qualified-by-default convention discussed in issue microsoft#112, to guide the follow-up import-consistency cleanup.
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
Documents the project’s preferred Python import style in AGENTS.md as groundwork for future import-consistency cleanup work, but also includes a few unrelated dependency/code formatting updates.
Changes:
- Add a “Python Import Style Guidelines” section to
AGENTS.md(module-qualified by default; limit direct-symbol imports; forbid wildcard imports). - Add a new date/time range guideline (half-open intervals) to
AGENTS.md. - Bump
pyright(and related lockfile entries) and widen theuv_buildupper bound; reorder one stdlib import inanswers.py.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AGENTS.md | Adds documented Python import-style rules (and an additional date/time range guideline). |
| pyproject.toml | Updates build-system constraint and dev dependency minimum for pyright. |
| uv.lock | Updates the locked pyright version/metadata and dev specifier to match pyproject.toml. |
| src/typeagent/knowpro/answers.py | Adjusts stdlib import ordering at the top of the module. |
Comment on lines
4
to
8
| import asyncio | ||
| import os | ||
| from collections.abc import Iterable | ||
| from dataclasses import dataclass, field | ||
| import os | ||
| from typing import Any |
| - Avoid potential import cycles between conversation orchestration and pipeline modules by using neutral payload protocols/arguments instead of importing concrete pipeline result classes across modules. | ||
| - Prefer ordinal type aliases (e.g., `MessageOrdinal`, `ChunkOrdinal`) over raw `int` in pipeline code for readability. | ||
| - When the user asks to "fix the test only", update tests/mocks first and avoid adding production compatibility fallbacks unless explicitly requested. | ||
| - For date/time range handling, use the half-open interval convention `[start, stop)` (stop is exclusive), as agreed in PR #198 — this avoids the ambiguity of an inclusive end (e.g. does "end of day" mean 00:00:00 or 23:59:59.999999?). Prefer this over inclusive-end ranges even when padding the end to end-of-day would also work. |
This was referenced Aug 1, 2026
Collaborator
Author
|
robgruen would you mind taking a look at this one when you get a chance? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docs-only change, no code affected.
Test plan