Skip to content

Commit

Permalink
Updated linter actions to call poetry (#103)
Browse files Browse the repository at this point in the history
Closes #102 

- Moved linters to linter group in pyproject
- Updated linter action to install poetry and run poetry run black and
ruff
  • Loading branch information
jcadam14 authored Feb 7, 2024
1 parent aa0c23b commit beb43fe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
version: "~= 23.7.0"
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --only linters --no-root
- name: Run black
run: |
poetry run black --check .
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
version: 0.0.278
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --only linters --no-root
- name: Run ruff
run: |
poetry run ruff .
7 changes: 5 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pydantic-settings = "^2.0.3"
regtech-api-commons = {git = "https://github.com/cfpb/regtech-api-commons.git"}

[tool.poetry.group.dev.dependencies]
ruff = "0.0.278"
black = "~23.7.0"
httpx = "^0.24.1"
pytest = "^7.4.0"
pytest-asyncio = "^0.21.1"
Expand All @@ -33,6 +31,11 @@ pytest-mock = "^3.11.1"
pytest-env = "^1.0.1"
pytest-alembic = "^0.10.7"


[tool.poetry.group.linters.dependencies]
ruff = "0.0.278"
black = "23.7.0"

[tool.pytest.ini_options]
asyncio_mode = "auto"
pythonpath = ["src","db_revisions"]
Expand Down

0 comments on commit beb43fe

Please sign in to comment.