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

Bump black from 23.9.1 to 24.3.0 #127

Closed
wants to merge 13 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 120
exclude = .venv, _pycache_, migrations
ignore = E501,F401,F811,F841,E203,E231,W503
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @toherman-msft @hunterjam @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft
19 changes: 16 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "npm" # for frontend dependencies
directory: "/frontend"
schedule:
interval: "weekly"
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 10

- package-ecosystem: "pip" # for backend dependencies
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 10
47 changes: 31 additions & 16 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
### Motivation and Context

<!-- Thank you for your contribution to this 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.
5. Does this solve an issue or add a feature that *all* users of this sample app can benefit from? Contributions will only be accepted that apply across all users of this app.
-->
## Purpose
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
* ...

### Description
## Does this introduce a breaking change?
<!-- Mark one with an "x". -->

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

<!-- Please prefix your PR title with one of the following:
* `feat`: A new feature
* `fix`: A bug fix
* `docs`: Documentation only changes
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* `refactor`: A code change that neither fixes a bug nor adds a feature
* `perf`: A code change that improves performance
* `test`: Adding missing tests or correcting existing tests
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* `chore`: Other changes that don't modify src or test files
* `revert`: Reverts a previous commit
* !: A breaking change is indicated with a `!` after the listed prefixes above, e.g. `feat!`, `fix!`, `refactor!`, etc.
-->

### Contribution Checklist
## Golden Path Validation
- [ ] I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

<!-- Before submitting this PR, please make sure: -->
## Deployment Validation
- [ ] I have validated the deployment process successfully and all services are running as expected with this change.

## What to Check
Verify that the following are valid
- [ ] I have built and tested the code locally and in a deployed app
- [ ] For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
- [ ] This is a change for all users of this app. No code or asset is specific to my use case or my organization.
- [ ] I didn't break any existing functionality :smile:


## Other Information
<!-- Add any other helpful information that may be needed here.. -->
35 changes: 35 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Code Quality Workflow

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]

steps:
# Step 1: Checkout code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Python environment
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# Step 3: Run all code quality checks
- name: Run Code Quality Checks
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
echo "Fixing imports with Isort..."
python -m isort --verbose .
echo "Formatting code with Black..."
python -m black --verbose .
echo "Running Flake8..."
python -m flake8 --config=.flake8 --verbose .
echo "Running Pylint..."
python -m pylint --rcfile=.pylintrc --verbose .
44 changes: 44 additions & 0 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Sync Main to dependabotchanges

on:
# Schedule the sync job to run daily or customize as needed
schedule:
- cron: '0 1 * * *' # Runs every day at 1 AM UTC
# Trigger the sync job on pushes to the main branch
push:
branches:
- main

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate branch comparison

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Sync main to dependabotchanges
run: |
# Ensure we're on the main branch
git checkout main
# Fetch the latest changes
git pull origin main

# Switch to dependabotchanges branch
git checkout dependabotchanges
# Merge main branch changes
git merge main --no-edit

# Push changes back to dependabotchanges1 branch
git push origin dependabotchanges

- name: Notify on Failure
if: failure()
run: echo "Sync from main to dependabotchanges failed!"
24 changes: 24 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[MASTER]
ignore=__pycache__, migrations, .venv

[MESSAGES CONTROL]

disable=parse-error,missing-docstring,too-many-arguments,line-too-long

[FORMAT]

max-line-length=120

[DESIGN]

max-args=10
max-locals=25
max-branches=15
max-statements=75

[REPORTS]
output-format=colorized
reports=no

[EXCEPTIONS]
overgeneral-exceptions=builtins.Exception,builtins.BaseException
11 changes: 10 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
azure-identity==1.17.1
# Flask[async]==2.3.2
openai==1.6.1
openai==1.55.3
azure-search-documents==11.4.0b6
azure-storage-blob==12.17.0
python-dotenv==1.0.0
Expand All @@ -10,3 +10,12 @@ uvicorn==0.24.0
aiohttp==3.10.5
gunicorn==20.1.0
pydantic-settings==2.2.1
# Development Tools
pylint==2.17.5
autopep8==2.0.2
black==24.3.0
isort==5.12.0
flake8==6.0.0
pyment==0.3.3
charset-normalizer==3.3.0
pycodestyle==2.10.0
Loading