mirror of
https://github.com/searxng/searxng.git
synced 2025-07-31 14:33:50 -04:00
[fix] don't install pyright twice and do some clean up
Pyright has been installed twice so far, once via `package.json` and once in the test script via `npx --no-install`. Separating the type checks in the CI and on the developer desktop is also not necessary. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
67e423edb2
commit
cd062d7349
6
Makefile
6
Makefile
@ -47,8 +47,8 @@ search.checker.%: install
|
|||||||
$(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
|
$(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
|
||||||
|
|
||||||
PHONY += test ci.test test.shell
|
PHONY += test ci.test test.shell
|
||||||
ci.test: test.yamllint test.black test.types.ci test.pylint test.unit test.robot test.rst test.shell test.shfmt test.pybabel
|
test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell test.shfmt
|
||||||
test: test.yamllint test.black test.types.dev test.pylint test.unit test.robot test.rst test.shell test.shfmt
|
ci.test: test test.pybabel
|
||||||
test.shell:
|
test.shell:
|
||||||
$(Q)shellcheck -x -s dash \
|
$(Q)shellcheck -x -s dash \
|
||||||
container/entrypoint.sh
|
container/entrypoint.sh
|
||||||
@ -80,7 +80,7 @@ MANAGE += node.env node.env.dev node.clean
|
|||||||
MANAGE += py.build py.clean
|
MANAGE += py.build py.clean
|
||||||
MANAGE += pyenv pyenv.install pyenv.uninstall
|
MANAGE += pyenv pyenv.install pyenv.uninstall
|
||||||
MANAGE += format.python format.shell
|
MANAGE += format.python format.shell
|
||||||
MANAGE += test.yamllint test.pylint test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes test.types.dev test.types.ci test.shfmt
|
MANAGE += test.yamllint test.pylint test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes test.pyright test.shfmt
|
||||||
MANAGE += themes.all themes.simple themes.fix themes.lint themes.test
|
MANAGE += themes.all themes.simple themes.fix themes.lint themes.test
|
||||||
MANAGE += static.build.commit static.build.drop static.build.restore
|
MANAGE += static.build.commit static.build.drop static.build.restore
|
||||||
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
|
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "searxng.org/devtools",
|
"name": "searxng.org/devtools",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pyright": "^1.1.391"
|
"pyright": "^1.1.403"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -Rf node_modules package-lock.json"
|
"clean": "rm -Rf node_modules package-lock.json"
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"venvPath": "local",
|
|
||||||
"venv": "py3",
|
|
||||||
"include": [
|
|
||||||
"searx",
|
|
||||||
"searxng_extra",
|
|
||||||
"tests"
|
|
||||||
],
|
|
||||||
"typeCheckingMode": "off"
|
|
||||||
}
|
|
@ -6,8 +6,8 @@ test.help(){
|
|||||||
test.:
|
test.:
|
||||||
yamllint : lint YAML files (YAMLLINT_FILES)
|
yamllint : lint YAML files (YAMLLINT_FILES)
|
||||||
pylint : lint ./searx, ./searxng_extra and ./tests
|
pylint : lint ./searx, ./searxng_extra and ./tests
|
||||||
black : check black code format
|
pyright : check Python types
|
||||||
shfmt : check shfmt code format
|
black : check Python code format
|
||||||
shfmt : check Shell script code format
|
shfmt : check Shell script code format
|
||||||
unit : run unit tests
|
unit : run unit tests
|
||||||
coverage : run unit tests with coverage
|
coverage : run unit tests with coverage
|
||||||
@ -49,15 +49,12 @@ test.pylint() {
|
|||||||
dump_return $?
|
dump_return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
test.types.dev() {
|
test.pyright() {
|
||||||
# use this pyright test for local tests in development / it suppress
|
# use this pyright test for local tests in development / it suppress
|
||||||
# warnings related to intentional monkey patching but gives good hints where
|
# warnings related to intentional monkey patching but gives good hints where
|
||||||
# we need to work on SearXNG's typification.
|
# we need to work on SearXNG's typification.
|
||||||
#
|
|
||||||
# --> pyrightconfig.json
|
|
||||||
|
|
||||||
build_msg TEST "[pyright/types] static type check of python sources"
|
build_msg TEST "[pyright/types] static type check of python sources"
|
||||||
build_msg TEST " --> typeCheckingMode: on"
|
|
||||||
node.env.dev
|
node.env.dev
|
||||||
|
|
||||||
build_msg TEST "[pyright/types] suppress warnings related to intentional monkey patching"
|
build_msg TEST "[pyright/types] suppress warnings related to intentional monkey patching"
|
||||||
@ -75,31 +72,6 @@ test.types.dev() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
test.types.ci() {
|
|
||||||
# use this pyright test for CI / disables typeCheckingMode, needed as long
|
|
||||||
# we do not have fixed all typification issues.
|
|
||||||
#
|
|
||||||
# --> pyrightconfig-ci.json
|
|
||||||
|
|
||||||
build_msg TEST "[pyright] static type check of python sources"
|
|
||||||
build_msg TEST " --> typeCheckingMode: off !!!"
|
|
||||||
node.env.dev
|
|
||||||
|
|
||||||
build_msg TEST "[pyright] suppress warnings related to intentional monkey patching"
|
|
||||||
# We run Pyright in the virtual environment because pyright executes
|
|
||||||
# "python" to determine the Python version.
|
|
||||||
pyenv.cmd npx --no-install pyright -p pyrightconfig-ci.json \
|
|
||||||
| grep -E '\.py:[0-9]+:[0-9]+'\
|
|
||||||
| grep -v '/engines/.*.py.* - warning: "logger" is not defined'\
|
|
||||||
| grep -v '/plugins/.*.py.* - error: "logger" is not defined'\
|
|
||||||
| grep -v '/engines/.*.py.* - warning: "supported_languages" is not defined' \
|
|
||||||
| grep -v '/engines/.*.py.* - warning: "language_aliases" is not defined' \
|
|
||||||
| grep -v '/engines/.*.py.* - warning: "categories" is not defined'
|
|
||||||
# ignore exit value from pyright
|
|
||||||
# dump_return ${PIPESTATUS[0]}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
test.black() {
|
test.black() {
|
||||||
build_msg TEST "[black] $BLACK_TARGETS"
|
build_msg TEST "[black] $BLACK_TARGETS"
|
||||||
pyenv.cmd black --check --diff "${BLACK_OPTIONS[@]}" "${BLACK_TARGETS[@]}"
|
pyenv.cmd black --check --diff "${BLACK_OPTIONS[@]}" "${BLACK_TARGETS[@]}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user