diff --git a/README.md b/README.md index 3feeb18..4ca693f 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,14 @@ $ nix develop The [python-lsp-server](https://github.com/python-lsp/python-lsp-server) (version v1.9.0) is included in this flake, along with the [python-lsp-black](https://github.com/python-lsp/python-lsp-black) -plugin for formatting purposes. `pylsp` is expected to be configured to use -[McCabe](https://github.com/PyCQA/mccabe), [pycodestyle](https://pycodestyle.pycqa.org/en/latest/), -and [pyflakes](https://github.com/PyCQA/pyflakes). Refer to your editor for -configuration details. +and [pyls-isort](https://github.com/paradoxxxzero/pyls-isort) plugins. +Additionally, `pylsp` is expected to be configured to use: + +* [McCabe](https://github.com/PyCQA/mccabe), +* [pycodestyle](https://pycodestyle.pycqa.org/en/latest/), and +* [pyflakes](https://github.com/PyCQA/pyflakes). + +Refer to your editor for configuration details. ### Formatting diff --git a/app/__main__.py b/app/__main__.py index 7b7bdba..45a5762 100644 --- a/app/__main__.py +++ b/app/__main__.py @@ -1,16 +1,13 @@ -import aiohttp import argparse import asyncio import json -from app.chesscom import ( - Exporter as ChesscomExporter, - Scraper as ChesscomScraper, -) -from app.lichess import ( - Exporter as LichessExporter, - Scraper as LichessScraper, -) +import aiohttp + +from app.chesscom import Exporter as ChesscomExporter +from app.chesscom import Scraper as ChesscomScraper +from app.lichess import Exporter as LichessExporter +from app.lichess import Scraper as LichessScraper from app.repo import Site diff --git a/app/chesscom.py b/app/chesscom.py index 7c26d6f..8209ba0 100644 --- a/app/chesscom.py +++ b/app/chesscom.py @@ -1,15 +1,15 @@ -import aiohttp import asyncio import json import os import os.path - -from app.repo import AnsiColor, Site -from app.exporter import BaseExporter -from app.scraper import BaseScraper -from bs4 import BeautifulSoup from typing import List, Union +import aiohttp +from bs4 import BeautifulSoup + +from app.exporter import BaseExporter +from app.repo import AnsiColor, Site +from app.scraper import BaseScraper # The number of coach listing pages we will at most iterate through. This number # was determined by going to chess.com/coaches?sortBy=alphabetical&page=1 and diff --git a/app/exporter.py b/app/exporter.py index fe2b160..c882482 100644 --- a/app/exporter.py +++ b/app/exporter.py @@ -1,7 +1,9 @@ -from app.repo import AnsiColor, Repo from typing import Union + from typing_extensions import TypedDict +from app.repo import AnsiColor, Repo + class Export(TypedDict, total=False): # The coach's rapid rating relative to the site they were sourced from. diff --git a/app/lichess.py b/app/lichess.py index 64312c3..b2af7b7 100644 --- a/app/lichess.py +++ b/app/lichess.py @@ -1,14 +1,14 @@ -import aiohttp import asyncio import os import os.path - -from app.repo import AnsiColor, Site -from app.scraper import BaseScraper -from app.exporter import BaseExporter -from bs4 import BeautifulSoup, SoupStrainer from typing import List +import aiohttp +from bs4 import BeautifulSoup, SoupStrainer + +from app.exporter import BaseExporter +from app.repo import AnsiColor, Site +from app.scraper import BaseScraper # The number of pages we will at most iterate through. This number was # determined by going to https://lichess.org/coach/all/all/alphabetical diff --git a/app/repo.py b/app/repo.py index abb01ef..69a06f3 100644 --- a/app/repo.py +++ b/app/repo.py @@ -1,6 +1,5 @@ import enum import os - from typing import List, Tuple, Union diff --git a/app/scraper.py b/app/scraper.py index c19af41..ca51128 100644 --- a/app/scraper.py +++ b/app/scraper.py @@ -1,8 +1,9 @@ -import aiohttp import os +from typing import List, Tuple, Union + +import aiohttp from app.repo import Repo -from typing import List, Tuple, Union class BaseScraper(Repo): diff --git a/flake.nix b/flake.nix index d3536e7..562a693 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,7 @@ mypy pycodestyle pyflakes + pyls-isort python-lsp-black python-lsp-server ]);