Skip to content
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

Python: new pre-commit actions and pre-commit as GHA #6376

Merged
merged 9 commits into from
May 28, 2024

Conversation

eavanvalkenburg
Copy link
Member

Motivation and Context

  • Added static code checking to pre-commit (check-ast and nbqa-check-ast)
  • Added Bandit security checking to pre-commit
  • Added pre-commit step to python-lint workflow, if it works, can delete seperate mypy, ruff and black tests

Description

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner May 23, 2024 11:20
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel memory labels May 23, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented May 23, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel
   kernel.py933859%124, 131–140, 180–188, 259–295
semantic_kernel/connectors
   telemetry.py15287%17–18
semantic_kernel/connectors/ai/google_palm
   gp_prompt_execution_settings.py30293%45–46
semantic_kernel/connectors/ai/google_palm/services
   gp_chat_completion.py701776%55–56, 152–157, 169–170, 209, 212, 215–216, 224, 228–229, 237
   gp_text_completion.py41783%37–38, 68–69, 75–76, 111
   gp_text_embedding.py34682%35–36, 54–55, 64–65
semantic_kernel/connectors/ai/google_palm/settings
   google_palm_settings.py20195%46
semantic_kernel/connectors/ai/hugging_face
   hf_prompt_execution_settings.py19190%1–38
semantic_kernel/connectors/ai/hugging_face/services
   hf_text_completion.py43430%3–148
   hf_text_embedding.py28280%3–59
semantic_kernel/connectors/ai/ollama/services
   ollama_chat_completion.py71692%56, 92, 112, 129, 161, 180
   ollama_text_completion.py43198%92
   ollama_text_embedding.py27196%8
semantic_kernel/connectors/ai/open_ai/prompt_execution_settings
   azure_chat_prompt_execution_settings.py62198%96
semantic_kernel/connectors/ai/open_ai/services
   azure_chat_completion.py943464%146, 152–153, 162–163, 168–185, 189–196, 208–219
   azure_config_base.py34488%75–77, 92
   open_ai_chat_completion.py24292%50–51
   open_ai_chat_completion_base.py2209955%97, 117, 142–146, 170, 174, 190–195, 212–240, 243–254, 272–279, 290–298, 314–321, 342, 350, 356–362, 374–380, 411, 450, 452–453, 458–463, 467–474, 478–490, 512, 521–532
   open_ai_handler.py45491%66–67, 79–80
   open_ai_text_completion.py25388%49–50, 78
   open_ai_text_completion_base.py602657%66–69, 92–109, 115–118, 137, 145
   open_ai_text_embedding.py24388%50–51, 78
   open_ai_text_embedding_base.py27293%9, 43
semantic_kernel/connectors/ai/open_ai/settings
   azure_open_ai_settings.py24196%79
   open_ai_settings.py21195%49
semantic_kernel/connectors/openai_plugin
   openai_utils.py171041%18–29
semantic_kernel/connectors/openapi_plugin
   openapi_function_execution_parameters.py26196%36
   openapi_parser.py85495%69, 92, 95, 126
   openapi_runner.py996435%51–53, 59–60, 66–80, 84–100, 104–106, 110–112, 115–118, 127–170
semantic_kernel/connectors/openapi_plugin/models
   rest_api_operation.py1245258%73–79, 83–100, 104–106, 110–123, 127–138, 142–154, 184, 201, 214, 249, 254, 258, 273, 290
   rest_api_operation_run_options.py6267%12–13
   rest_api_uri.py9367%14, 18–19
semantic_kernel/connectors/search_engine
   bing_connector.py41410%3–75
   bing_connector_settings.py17170%3–39
   connector.py220%3–6
   google_connector.py38380%3–67
semantic_kernel/connectors/utils
   document_loader.py17194%27
semantic_kernel/contents
   function_call_content.py68593%39, 46, 48, 95, 102
   function_result_content.py571279%50, 55, 66, 81, 93, 107, 112, 119–123
   streaming_chat_message_content.py83298%168–169
   streaming_content_mixin.py9189%8
   streaming_text_content.py14471%32, 40, 42, 44
   text_content.py22291%41, 48
semantic_kernel/core_plugins
   conversation_summary_plugin.py16850%37–38, 64–73
   http_plugin.py39392%58, 82, 101
   time_plugin.py84693%57, 66–67, 166–167, 212
   web_search_engine_plugin.py9278%28, 38
semantic_kernel/core_plugins/sessions_python_tool
   sessions_python_plugin.py1031486%57–59, 79, 82, 87–93, 133, 180, 184
   sessions_python_settings.py31197%61
semantic_kernel/functions
   function_result.py30970%49, 51–52, 62–67
   kernel_function.py82298%147, 168
   kernel_function_extension.py126993%45, 47, 338, 358–360, 396, 398, 408
   kernel_function_from_method.py85693%126, 145–146, 152, 155–156
   kernel_function_from_prompt.py157796%148–149, 170, 190, 215, 236, 316
   kernel_plugin.py187299%472, 475
semantic_kernel/planners
   plan.py2364780%52, 162–164, 197, 214–227, 264, 269, 277–278, 288–291, 308, 313–316, 332, 335–340, 358, 363, 366, 368, 375, 389–391, 396–400
   planner_extensions.py32320%3–74
semantic_kernel/planners/function_calling_stepwise_planner
   function_calling_stepwise_planner.py1104361%123–213, 249–254
   function_calling_stepwise_planner_result.py12192%24
semantic_kernel/planners/sequential_planner
   sequential_planner.py65691%69, 73, 105, 121, 130–131
   sequential_planner_extensions.py50982%29–30, 52, 105–119
   sequential_planner_parser.py771284%64–73, 93, 117–120
TOTAL609687986% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1374 1 💤 0 ❌ 0 🔥 15.683s ⏱️

@eavanvalkenburg eavanvalkenburg marked this pull request as draft May 23, 2024 15:10
@eavanvalkenburg eavanvalkenburg marked this pull request as ready for review May 24, 2024 13:04
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue May 28, 2024
Merged via the queue into microsoft:main with commit 9e99933 May 28, 2024
23 checks passed
@eavanvalkenburg eavanvalkenburg deleted the update_pre_commit branch May 28, 2024 15:38
johnoliver pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

- Added static code checking to pre-commit (check-ast and
nbqa-check-ast)
- Added Bandit security checking to pre-commit
- Added pre-commit step to python-lint workflow, if it works, can delete
seperate mypy, ruff and black tests

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
johnoliver pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

- Added static code checking to pre-commit (check-ast and
nbqa-check-ast)
- Added Bandit security checking to pre-commit
- Added pre-commit step to python-lint workflow, if it works, can delete
seperate mypy, ruff and black tests

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

- Added static code checking to pre-commit (check-ast and
nbqa-check-ast)
- Added Bandit security checking to pre-commit
- Added pre-commit step to python-lint workflow, if it works, can delete
seperate mypy, ruff and black tests

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants