-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into athitten/inference_bug
- Loading branch information
Showing
39 changed files
with
1,907 additions
and
438 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[flake8] | ||
select = | ||
F541, # f-string without any placeholders | ||
F841, # local variable 'x' is assigned to but never used | ||
F401, # 'x' imported but unused | ||
E741, # ambiguous variable name 'l' | ||
F821, # undefined name 'x' | ||
E266, # too many leading '#' for block comment |
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[flake8] | ||
select = | ||
F541, # f-string without any placeholders | ||
F841, # local variable 'x' is assigned to but never used | ||
F401, # 'x' imported but unused | ||
E741, # ambiguous variable name 'l' | ||
F821, # undefined name 'x' | ||
E266, # too many leading '#' for block comment |
This file contains 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,2 +1,4 @@ | ||
.github/ @pablo-garay @ko3n1g @thomasdhc @chtruong814 | ||
Dockerfile.ci @pablo-garay @ko3n1g @thomasdhc @chtruong814 | ||
.pylintrc.* @pablo-garay @ko3n1g @thomasdhc @chtruong814 | ||
.flake8.* @pablo-garay @ko3n1g @thomasdhc @chtruong814 |
This file contains 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: PyLint and flake8 linting | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**.py' | ||
types: [ opened, synchronize, reopened, labeled, unlabeled ] | ||
|
||
jobs: | ||
linting: | ||
name: 'Domain: ${{ matrix.domain }}' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
domain: [speech, other] | ||
env: | ||
DOMAIN: ${{ matrix.domain }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Select filter | ||
id: filter | ||
run: | | ||
if [[ "$DOMAIN" == "speech" ]]; then | ||
FILTER=$(jq -crn '[ | ||
"nemo/collections/asr/**", | ||
"nemo/collections/tts/**", | ||
"nemo/collections/audio/**", | ||
"nemo/collections/multimodal/speech_llm/**", | ||
"nemo/collections/speechlm/**" | ||
] | join(",")') | ||
else | ||
FILTER=$(jq -crn '[ | ||
"nemo/**", | ||
"!nemo/collections/asr/**", | ||
"!nemo/collections/tts/**", | ||
"!nemo/collections/audio/**", | ||
"!nemo/collections/multimodal/speech_llm/**", | ||
"!nemo/collections/speechlm/**" | ||
] | join(",")') | ||
fi | ||
echo "main=$FILTER" | tee -a "$GITHUB_OUTPUT" | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: ${{ steps.filter.outputs.main }} | ||
files_separator: "," | ||
separator: " " | ||
|
||
- name: Run PyLint | ||
id: pylint | ||
env: | ||
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
if [[ -z "$CHANGED_FILES" ]]; then | ||
echo Nothing to lint. | ||
echo "exit-code=0" | tee -a "$GITHUB_OUTPUT" | ||
exit 0 | ||
fi | ||
pip install pylint | ||
set +e | ||
pylint --output "pylintrc.$DOMAIN.txt" --rcfile ".pylintrc.$DOMAIN" ${CHANGED_FILES[@]} | ||
echo "exit-code=$?" | tee -a "$GITHUB_OUTPUT" | ||
- name: Run flake8 | ||
id: flake8 | ||
env: | ||
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
if [[ -z "$CHANGED_FILES" ]]; then | ||
echo Nothing to lint. | ||
echo "exit-code=0" | tee -a "$GITHUB_OUTPUT" | ||
exit 0 | ||
fi | ||
pip install flake8 | ||
set +e | ||
flake8 --output "flake8.$DOMAIN.txt" --config ".flake8.$DOMAIN" ${CHANGED_FILES[@]} | ||
echo "exit-code=$?" | tee -a "$GITHUB_OUTPUT" | ||
- name: Summary | ||
env: | ||
PYLINT: ${{ steps.pylint.outputs.exit-code == 0 }} | ||
FLAKE8: ${{ steps.flake8.outputs.exit-code == 0 }} | ||
run: | | ||
if [[ "$PYLINT" != "true" ]]; then | ||
echo "Pylint output:" | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
cat pylintrc.$DOMAIN.txt | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
fi | ||
if [[ "$FLAKE8" != "true" ]]; then | ||
echo "Flake8 output:" | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
cat flake8.$DOMAIN.txt | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
fi | ||
if [[ "$PYLINT" != "true" || "$FLAKE8" != "true" ]]; then | ||
echo "The following directories got scanned:" | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
echo ${{ steps.filter.outputs.main }} | tee -a $GITHUB_STEP_SUMMARY | ||
echo '```' | tee -a $GITHUB_STEP_SUMMARY | ||
exit 1 | ||
fi | ||
Nemo_Linting_Test: | ||
needs: linting | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Main | ||
env: | ||
RESULTS: ${{ toJson(needs.linting) }} | ||
run: | | ||
RESULT=$(echo "$RESULTS" | jq -r '.result') | ||
if [[ "$RESULT" == "success" ]]; then | ||
echo "All passed." | ||
exit 0 | ||
else | ||
echo "Some linting domains failed." | ||
exit 1 | ||
fi |
This file contains 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.