py-topdir.mk: Use pyright
py-topdir.mk: Use ruff and yapf
- Use pyright for the target py-check-syntax
- Generate a $(TOPDIR)/pyrightconfig.json for that
- Add pyrightconfig-base.json because it's used by pyrightconfig.json- Add python3-pyright to pkg.requires.release, anticipating the use of the py-syntax-check target by CISigned-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
36d854ce19
commit
8c5c98c95a
4 changed files with 15 additions and 2 deletions
6
conf/project/pyrightconfig-base.json
Normal file
6
conf/project/pyrightconfig-base.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"typeCheckingMode": "basic",
|
||||||
|
"pythonPlatform": "Linux",
|
||||||
|
"useLibraryCodeForTypes": true,
|
||||||
|
"verboseOutput": false
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ devel = jw-pkg-run = VERSION-REVISION
|
||||||
run = bash, python3
|
run = bash, python3
|
||||||
build = make, time, xdg-utils, coreutils, cpio, xdg-utils, git-core
|
build = make, time, xdg-utils, coreutils, cpio, xdg-utils, git-core
|
||||||
devel = sudo, gawk, pkg-config
|
devel = sudo, gawk, pkg-config
|
||||||
release = python3-isort, python3-yapf, python3-ruff
|
release = python3-isort, python3-yapf, python3-ruff, python3-pyright
|
||||||
|
|
||||||
[pkg.requires.centos]
|
[pkg.requires.centos]
|
||||||
run = hostname, python
|
run = hostname, python
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
TD_COPY_FILES += pyproject.toml
|
TD_COPY_FILES += pyproject.toml pyrightconfig.json
|
||||||
|
|
||||||
PY_CHECK_EXCLUDE ?=
|
PY_CHECK_EXCLUDE ?=
|
||||||
PY_SRC_ROOT += $(wildcard $(TOPDIR)/src $(TOPDIR)/tools)
|
PY_SRC_ROOT += $(wildcard $(TOPDIR)/src $(TOPDIR)/tools)
|
||||||
|
|
@ -13,6 +13,7 @@ py-check: py-check-syntax py-check-format
|
||||||
py-check-syntax:
|
py-check-syntax:
|
||||||
ruff check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
|
ruff check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
|
||||||
mypy $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
|
mypy $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_SRC_ROOT)
|
||||||
|
pyright
|
||||||
|
|
||||||
py-check-format:
|
py-check-format:
|
||||||
yapf --diff --recursive .
|
yapf --diff --recursive .
|
||||||
|
|
@ -32,3 +33,8 @@ py-format-assignments:
|
||||||
clean.topdir: clean.py-check
|
clean.topdir: clean.py-check
|
||||||
clean.py-check:
|
clean.py-check:
|
||||||
rm -rf .mypy_cache
|
rm -rf .mypy_cache
|
||||||
|
|
||||||
|
pyrightconfig.json:
|
||||||
|
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format pyright \
|
||||||
|
$(PROJECT) --field base=$(JW_PKG_CONF_BASE_DIR)/project/pyrightconfig-base.json $(addprefix --field include=,$(wildcard src/python tools/python)) > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ cat_gitignore()
|
||||||
__init__.py
|
__init__.py
|
||||||
__pycache__
|
__pycache__
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
|
pyrightconfig.json
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue