Skip to content

Commit

Permalink
ci: 📍 pin formatting dependencies (black and isort)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed Jan 29, 2024
1 parent c58b84b commit fd096e3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Black"
name: "Formatting"

on: [push]
jobs:
Expand All @@ -8,6 +8,7 @@ jobs:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
tool: ["black", "isort"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -17,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Black Code Formatter
pip install -r dev_requirements/requirements-formatting.txt
- name: ${{ matrix.tool }} Code Formatter
run: |
black . --check
${{ matrix.tool }} . --check
3 changes: 3 additions & 0 deletions dev_requirements/requirements-formatting.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# specific requirements for the tox formatting environment
black
isort
22 changes: 22 additions & 0 deletions dev_requirements/requirements-formatting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements-formatting.in
#
black==24.1.1
# via -r requirements-formatting.in
click==8.1.7
# via black
colorama==0.4.6
# via click
isort==5.13.2
# via -r requirements-formatting.in
mypy-extensions==1.0.0
# via black
packaging==23.2
# via black
pathspec==0.12.1
# via black
platformdirs==4.1.0
# via black
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ deps =
{[testenv:tests]deps}
{[testenv:linting]deps}
{[testenv:coverage]deps}
black
isort
-r dev_requirements/requirements-formatting.txt
pip-tools
pre-commit
commands =
Expand Down

0 comments on commit fd096e3

Please sign in to comment.