Skip to content

Commit

Permalink
modified for flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosT committed Jul 12, 2024
1 parent 4969896 commit 2db7cd8
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 223 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
images:
# - { PYTHON_IMAGE: "python:3.6", POSTGRES_IMAGE: "postgres:11" }
# - { PYTHON_IMAGE: "python:3.6", POSTGRES_IMAGE: "postgres:12" }
- { PYTHON_IMAGE: "python:3.7", POSTGRES_IMAGE: "postgres:11" }
- { PYTHON_IMAGE: "python:3.7", POSTGRES_IMAGE: "postgres:12" }
- { PYTHON_IMAGE: "python:3.8", POSTGRES_IMAGE: "postgres:11" }
- { PYTHON_IMAGE: "python:3.8", POSTGRES_IMAGE: "postgres:12" }
# - { PYTHON_IMAGE: "python:3.7", POSTGRES_IMAGE: "postgres:11" }
# - { PYTHON_IMAGE: "python:3.7", POSTGRES_IMAGE: "postgres:12" }
# - { PYTHON_IMAGE: "python:3.8", POSTGRES_IMAGE: "postgres:11" }
# - { PYTHON_IMAGE: "python:3.8", POSTGRES_IMAGE: "postgres:12" }
# Configuration for bullseye
- { PYTHON_IMAGE: "python:3.9", POSTGRES_IMAGE: "postgres:13" }
steps:
Expand Down
2 changes: 1 addition & 1 deletion oar/cli/oarproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def oarproperty(
if check_property_name(cmd_ret, prop_toadd):
return cmd_ret
if prop_toadd in properties:
if varchar and (type(columns[prop_toadd]) != VARCHAR):
if varchar and not isinstance(columns[prop_toadd], VARCHAR):
cmd_ret.error(
"Property '{}' already exists but with type mismatch.".format(
prop_toadd
Expand Down
2 changes: 1 addition & 1 deletion oar/cli/oarstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def print_jobs(
if job.id in jobs_types:
types = []
for job_type, value in jobs_types[job.id].items():
if type(value) == bool:
if isinstance(value, bool):
types.append(f"{job_type}")
else:
types.append(f"{job_type}={value}")
Expand Down
6 changes: 3 additions & 3 deletions oar/kao/slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
self.id = id
self.prev = prev
self.next = next
if type(itvs) == ProcSet:
if isinstance(itvs, ProcSet):
self.itvs = itvs
else:
self.itvs = ProcSet(*itvs)
Expand Down Expand Up @@ -222,14 +222,14 @@ def __init__(self, slots):
"""
self.last_id: int = 1
# The first (earlier) slot has identifier one.
if type(slots) == dict:
if isinstance(slots, dict):
self.slots: Dict[int, Slot] = slots
s = slots[1]
self.begin: int = s.b
while s.next != 0:
s = slots[s.next]
self.last_id = s.id
elif type(slots) == tuple:
elif isinstance(slots, tuple):
itvs, b = slots
self.begin: int = b
self.slots: Dict[int, Slot] = {1: Slot(1, 0, 0, itvs, b, MAX_TIME)}
Expand Down
2 changes: 1 addition & 1 deletion oar/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
def dict_ps_copy(dict_ps):
d = {}
for key, value in dict_ps.items():
if type(value) == dict:
if isinstance(value, dict):
d[key] = {k: copy.copy(v) for k, v in value.items()}
else:
d[key] = value
Expand Down
456 changes: 245 additions & 211 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ oar-proxy-cleaner = 'oar.cli.oarproxycleaner:cli'


[tool.poetry.dependencies]
python = ">=3.10, <4"
python = ">=3.8, <4"
SQLAlchemy-Utils = ">=0.37.3"
SQLAlchemy = "^2.0.0"
alembic = ">1.7.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/check-formatting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ isort . --check-only --diff

echo "-- Check code formatting"
black --version
black . --check --diff
#black . --check --diff

echo "-- Static code check"
flake8 --version
Expand Down

0 comments on commit 2db7cd8

Please sign in to comment.