diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe16046..657e048 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ ci: repos: # Autoformat: Python code, syntax patterns are modernized - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.21.2 hooks: - id: pyupgrade args: @@ -24,7 +24,7 @@ repos: # Autoformat: Python code - repo: https://github.com/PyCQA/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake # args ref: https://github.com/PyCQA/autoflake#advanced-usage @@ -33,25 +33,25 @@ repos: # Autoformat: Python code - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort # Autoformat: Python code - - repo: https://github.com/psf/black - rev: 23.10.1 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black # Autoformat: markdown, yaml, javascript (see the file .prettierignore) - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v4.0.0-alpha.8 hooks: - id: prettier # Autoformat and linting, misc. details - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: requirements-txt-fixer @@ -60,13 +60,13 @@ repos: # Linting: Python code (see the file .flake8) - repo: https://github.com/PyCQA/flake8 - rev: "6.1.0" + rev: "7.3.0" hooks: - id: flake8 # formatting notebooks - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 + rev: 1.9.1 hooks: - id: nbqa-pyupgrade args: diff --git a/lectures/pandas/PublicAPIs.ipynb b/lectures/pandas/PublicAPIs.ipynb index 1c80de7..65b02ac 100644 --- a/lectures/pandas/PublicAPIs.ipynb +++ b/lectures/pandas/PublicAPIs.ipynb @@ -3320,9 +3320,9 @@ "source": [ "url = \"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=51.5&lon=0\"\n", "s = requests.Session()\n", - "s.headers[\n", - " \"User-Agent\"\n", - "] = \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n", + "s.headers[\"User-Agent\"] = (\n", + " \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n", + ")\n", "r = s.get(url)\n", "r" ] diff --git a/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py b/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py index 27d14a7..9ae637f 100644 --- a/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py +++ b/lectures/production/from-script-to-project/monty-hall-game4/monty_hall_game/__main__.py @@ -1,4 +1,4 @@ from .cli import main if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/lectures/python/exercises.ipynb b/lectures/python/exercises.ipynb index 0bc0490..a26d0c0 100644 --- a/lectures/python/exercises.ipynb +++ b/lectures/python/exercises.ipynb @@ -404,8 +404,7 @@ "metadata": {}, "outputs": [], "source": [ - "class Square(...):\n", - " ...\n", + "class Square(...): ...\n", "\n", "\n", "sq = Square(5)\n", diff --git a/lectures/python/point.py b/lectures/python/point.py index a34e7fb..16a3364 100755 --- a/lectures/python/point.py +++ b/lectures/python/point.py @@ -4,8 +4,7 @@ class Point: """Class representing a 2-D Cartesian point""" - def __init__(self, x, y): - ... + def __init__(self, x, y): ... def __repr__(self): return f"Point({self.x}, {self.y})" diff --git a/lectures/web-servers/monty-hall-game/game_server2.py b/lectures/web-servers/monty-hall-game/game_server2.py index 2979508..cbddd17 100644 --- a/lectures/web-servers/monty-hall-game/game_server2.py +++ b/lectures/web-servers/monty-hall-game/game_server2.py @@ -11,7 +11,6 @@ - The template contains a form with a POST request to the /reselect. """ - from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates diff --git a/lectures/web-servers/monty-hall-game/game_server3.py b/lectures/web-servers/monty-hall-game/game_server3.py index 59b7d85..b9bc710 100644 --- a/lectures/web-servers/monty-hall-game/game_server3.py +++ b/lectures/web-servers/monty-hall-game/game_server3.py @@ -12,7 +12,6 @@ and displays it in the reselect3.html template """ - from fastapi import FastAPI, Form, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates diff --git a/lectures/web-servers/monty-hall-game/game_server4.py b/lectures/web-servers/monty-hall-game/game_server4.py index 6627fd3..50dd29c 100644 --- a/lectures/web-servers/monty-hall-game/game_server4.py +++ b/lectures/web-servers/monty-hall-game/game_server4.py @@ -22,7 +22,6 @@ """ - import random import uuid diff --git a/lectures/web-servers/monty-hall-game/game_server6.py b/lectures/web-servers/monty-hall-game/game_server6.py index b19f81f..23ef7bb 100644 --- a/lectures/web-servers/monty-hall-game/game_server6.py +++ b/lectures/web-servers/monty-hall-game/game_server6.py @@ -13,7 +13,6 @@ information """ - import random import uuid from statistics import mean diff --git a/lectures/web-servers/monty-hall-game/game_server7.py b/lectures/web-servers/monty-hall-game/game_server7.py index 4667e4e..e57c8b8 100644 --- a/lectures/web-servers/monty-hall-game/game_server7.py +++ b/lectures/web-servers/monty-hall-game/game_server7.py @@ -13,7 +13,6 @@ information """ - import random import uuid from statistics import mean diff --git a/lectures/web-servers/monty-hall-game/game_server_rest.py b/lectures/web-servers/monty-hall-game/game_server_rest.py index 1d4c79a..351ce68 100644 --- a/lectures/web-servers/monty-hall-game/game_server_rest.py +++ b/lectures/web-servers/monty-hall-game/game_server_rest.py @@ -13,7 +13,6 @@ information """ - import random import uuid from functools import partial diff --git a/lectures/web-servers/monty-hall-game/game_server_rest_soln.py b/lectures/web-servers/monty-hall-game/game_server_rest_soln.py index dad2da4..9939d5c 100644 --- a/lectures/web-servers/monty-hall-game/game_server_rest_soln.py +++ b/lectures/web-servers/monty-hall-game/game_server_rest_soln.py @@ -11,7 +11,6 @@ use in combination with autoplay.py to play monty hall via a REST API. """ - import random import uuid from enum import IntEnum