-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add action for python linting and formatting
Signed-off-by: Nathan Weinberg <[email protected]>
- Loading branch information
1 parent
7e452b7
commit e9d7b02
Showing
8 changed files
with
125 additions
and
16 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,65 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Lint and Format | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "release-**" | ||
paths: | ||
- '**.py' | ||
- 'pyproject.toml' | ||
- 'requirements*.txt' | ||
- 'tox.ini' | ||
- 'scripts/*.sh' | ||
- '.github/**' | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "release-**" | ||
paths: | ||
- '**.py' | ||
- 'pyproject.toml' | ||
- 'requirements*.txt' | ||
- 'tox.ini' | ||
- 'scripts/*.sh' | ||
- '.github/**' | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# https://github.com/actions/checkout/issues/249 | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Setup Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
**/requirements*.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Run Ruff check | ||
run: | | ||
tox -e ruff -- check | ||
- name: Run linting | ||
if: success() || failure() | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/pylint.json" | ||
tox -e lint |
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,33 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "pylint-error", | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "pylint-warning", | ||
"severity": "warning", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
File renamed without changes.
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,7 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
click>=8.1.7,<9.0.0 | ||
httpx>=0.25.0,<1.0.0 | ||
jinja2 | ||
openai>=1.13.3,<2.0.0 | ||
rouge_score | ||
tqdm>=4.66.2,<5.0.0 |
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 +1,2 @@ | ||
# First Party | ||
from instructlab_sdg.generate_data import generate_data |
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