README update and code quality checks (#2202)

* README updates.
* Ensure pre-commit black args match those in Makefile.
* Ensure pre-commit and requirements versions align, and the commands run are the same in pre-commit and Makefile.
* Update README files to reflect recent changes. Where possible, remove duplication and point to the official docs.
* Run format and pre-commit prettifier on code.
* Remove isort - it causes more trouble than is justified.
* Ensure usage examples in the README.
This commit is contained in:
Nicholas Tollervey
2024-10-02 13:48:48 +01:00
committed by GitHub
parent 6fab9a1c26
commit af06bc4826
6 changed files with 325 additions and 255 deletions

View File

@@ -9,6 +9,7 @@ PY_OK := $(shell python3 -c "print(int($(PY3_VER) >= $(MIN_PY3_VER)))")
all:
@echo "\nThere is no default Makefile target right now. Try:\n"
@echo "make setup - check your environment and install the dependencies."
@echo "make update - update dependencies."
@echo "make clean - clean up auto-generated assets."
@echo "make build - build PyScript."
@echo "make precommit-check - run the precommit checks (run eslint)."
@@ -57,6 +58,11 @@ clean:
build:
cd core && npx playwright install chromium && npm run build
# Update the dependencies.
update:
cd core && npm update && cd ..
python -m pip install -r requirements.txt --upgrade
# Run the precommit checks (run eslint).
precommit-check:
pre-commit run --all-files
@@ -76,7 +82,6 @@ fmt-check: fmt-py-check
# Format Python code.
fmt-py:
black -l 88 --skip-string-normalization .
isort --profile black .
# Check the format of Python code.
fmt-py-check: