-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: replace pre-commit with prek, add PEP 723 script deps, clean up dev dependencies #3748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eavanvalkenburg
wants to merge
15
commits into
microsoft:main
Choose a base branch
from
eavanvalkenburg:prek
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+610
−580
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8acfed1
python: replace pre-commit with prek, add PEP 723 script deps, clean …
eavanvalkenburg 6aba4d5
updated lock
eavanvalkenburg 7210652
python: fix prek config paths for local execution and CI workflow
eavanvalkenburg 99974a4
python: move helper scripts to scripts/ folder and exclude from checks
eavanvalkenburg eaae69e
python: exclude AGENTS.md from prek markdown code lint
eavanvalkenburg 37ec19a
python: exclude AGENTS.md and azure_ai_search sample from markdown lint
eavanvalkenburg 7def4d6
fix m365 sample
eavanvalkenburg 7141951
python: ignore CPY rule for samples with PEP 723 headers
eavanvalkenburg a4a3e3c
fix in dev_setup
eavanvalkenburg 9429cd3
python: replace aiofiles with regular open in samples
eavanvalkenburg 8288f99
python: suppress reportUnusedImport in markdown code block checker
eavanvalkenburg b6b4c48
python: use samples pyright config for markdown code block checker
eavanvalkenburg 7a96ea2
python: use markdown-code-lint with fixed globs instead of prek file …
eavanvalkenburg 8753412
python: exclude READMEs with pre-existing broken imports from markdow…
eavanvalkenburg 63c2566
python: fix broken README code snippets instead of excluding them
eavanvalkenburg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,68 @@ | ||
| files: ^python/ | ||
| fail_fast: true | ||
| exclude: ^scripts/ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| - repo: builtin | ||
| hooks: | ||
| - id: check-toml | ||
| name: Check TOML files | ||
| files: \.toml$ | ||
| exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/ | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - id: check-yaml | ||
| name: Check YAML files | ||
| files: \.yaml$ | ||
| - id: check-json | ||
| name: Check JSON files | ||
| files: \.json$ | ||
| exclude: ^.*\.vscode\/.*|^python/demos/samples/chatkit-integration/frontend/(tsconfig.*\.json|package-lock\.json)$ | ||
| exclude: ^.*\.vscode\/.*|^demos/samples/chatkit-integration/frontend/(tsconfig.*\.json|package-lock\.json)$ | ||
| - id: end-of-file-fixer | ||
| name: Fix End of File | ||
| files: \.py$ | ||
| exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/ | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - id: mixed-line-ending | ||
| name: Check Mixed Line Endings | ||
| files: \.py$ | ||
| exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/ | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - id: trailing-whitespace | ||
| name: Trim Trailing Whitespace | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - id: check-merge-conflict | ||
| name: Check Merge Conflicts | ||
| - id: detect-private-key | ||
| name: Detect Private Keys | ||
| - id: check-added-large-files | ||
| name: Check Added Large Files | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-ast | ||
| name: Check Valid Python Samples | ||
| types: ["python"] | ||
| exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/ | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - repo: https://github.com/asottile/pyupgrade | ||
| rev: v3.20.0 | ||
| rev: v3.21.2 | ||
| hooks: | ||
| - id: pyupgrade | ||
| name: Upgrade Python syntax | ||
| args: [--py310-plus] | ||
| exclude: ^python/packages/lab/cookiecutter-agent-framework-lab/ | ||
| exclude: ^packages/lab/cookiecutter-agent-framework-lab/ | ||
| - repo: local | ||
| hooks: | ||
| - id: poe-check | ||
| name: Run checks through Poe | ||
| entry: uv --directory ./python run poe pre-commit-check | ||
| entry: uv run poe prek-check | ||
| language: system | ||
| files: ^python/ | ||
| - repo: https://github.com/PyCQA/bandit | ||
| rev: 1.8.5 | ||
| rev: 1.9.3 | ||
| hooks: | ||
| - id: bandit | ||
| name: Bandit Security Checks | ||
| args: ["-c", "python/pyproject.toml"] | ||
| args: ["-c", "pyproject.toml"] | ||
| additional_dependencies: ["bandit[toml]"] | ||
| - repo: https://github.com/astral-sh/uv-pre-commit | ||
| # uv version. | ||
| rev: 0.7.18 | ||
| rev: 0.10.0 | ||
| hooks: | ||
| # Update the uv lockfile | ||
| - id: uv-lock | ||
| name: Update uv lockfile | ||
| files: python/pyproject.toml | ||
| args: [--project, python] | ||
| files: pyproject.toml |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| "command": "uv", | ||
| "args": [ | ||
| "run", | ||
| "pre-commit", | ||
| "prek", | ||
| "run", | ||
| "-a" | ||
| ], | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.