Skip to content

Commit

Permalink
Update lint check.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiner committed May 3, 2024
1 parent c7c53d0 commit 8b0644a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,17 @@ on:

jobs:
check_python:
name: "Black & flake8"
name: "Check Python linting"

runs-on: ubuntu-latest

steps:
- name: Setup Python 3.8 env
uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Clone NLE repo
uses: actions/checkout@v2
- name: Ensure latest pip
run: "python -m pip install -q --upgrade pip"
- name: Install python linting deps
run: "pip install -q black flake8 flake8-bugbear isort"
- name: Run black
run: "black --check --diff ."
- name: Run flake8
run: "flake8"
- name: Run isort
run: "isort -c --diff nle/"
python-version: "3.12"
- uses: actions/checkout@v4
- run: "pip install -q uv && uv pip install --system ruff flake8 flake8-bugbear isort"
- run: "ruff format --check --diff ."
- run: "flake8"
- run: "isort -c --diff nle/"
...
2 changes: 1 addition & 1 deletion nle/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def nullcontext(*args, **kwargs):
yield tp

def test_setup(self, conn): # noqa: F811
files = [db.get_row(f"{i+1}", conn=conn)[1] for i in range(9)]
files = [db.get_row(str(i), conn=conn)[1] for i in range(1, 10)]
names = ["aaa", "bbb", "ccc"]
assert files == [f"{a}/{b}.ttyrec.bz2" for a in names for b in names]

Expand Down
2 changes: 1 addition & 1 deletion nle/tests/test_nethack.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def test_illegal_numbers(self):
match=r"should be between 0 and MAXMCLASSES \(%i\) but got 127"
% nethack.MAXMCLASSES,
):
nethack.class_sym.from_mlet("\x7F")
nethack.class_sym.from_mlet("\x7f")

def test_objclass(self):
obj = nethack.objclass(0)
Expand Down

0 comments on commit 8b0644a

Please sign in to comment.