Skip to content

Commit

Permalink
Fix GitHub Actions, fix assertion in test_get_info_invalid, use `ru…
Browse files Browse the repository at this point in the history
…ff` instead of `black` in CI and dev tools (#60)

* Change Python runner from 3.11.x to 3.12.x

* Use master versions of GitHub Actions

* Add VS Code settings.json

* Replace Black with ruff, update dependencies

* Fix test for test_get_info_invalid()

* Replace Black formatting with Ruff

* Use main instead of master branches

* Use master instead of main for git-auto-commit-action

* Fix commit step in format.yml, add whitespace to test formatting in CI

* Add --fix arg to Ruff step

* Fix Ruff flags to enable it to make changes

* Remove fix flag override for Ruff

* Format Python code with Ruff

---------

Co-authored-by: IsaacCheng9 <[email protected]>
  • Loading branch information
IsaacCheng9 and IsaacCheng9 authored Jun 25, 2024
1 parent 539dd10 commit e8100ba
Show file tree
Hide file tree
Showing 6 changed files with 468 additions and 448 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11.x]
python-version: [3.12.x]

steps:
- uses: actions/checkout@v3

- name: Run Python code formatting with Black
uses: lgeiger/black-action@v1.0.1
- name: Run Python code formatting with Ruff
uses: chartboost/ruff-action@main
with:
args: ". --exclude src/trading_portfolio_tracker/ui"
args: "format --exclude src/trading_portfolio_tracker/ui"

- name: Commit changes made by Black
uses: stefanzweifel/git-auto-commit-action@v5
- name: Commit changes made by Ruff
uses: stefanzweifel/git-auto-commit-action@master
with:
commit_message: Format Python code with Black
commit_message: Format Python code with Ruff

- name: Switch to current branch
run: git checkout ${{ env.BRANCH }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3.1.4
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
# Configures the build to use the latest version of Python 3.
strategy:
matrix:
python-version: [3.11.x]
python-version: [3.12.x]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can
# access it.
- uses: actions/checkout@v3
- uses: actions/checkout@main

- name: Switch to current branch
run: git checkout ${{ env.BRANCH }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
Loading

0 comments on commit e8100ba

Please sign in to comment.