Read about our upcoming Code of Conduct on this issue

Commit f8a71772 authored by Marcin Kasperski's avatar Marcin Kasperski
Browse files

Rough attempt to get pytype working. Still needs some cleaning but

seems to work more or less.
parent 660383d27c28
# This makefile is used only for running pytype checks.
#
# To prepare:
# sudo apt install ninja
# pip install pytype
#
# To run checks:
# make pytype
#
# Usually you will set
# HGPATH - to Mercurial sources directory
# MEUPATH - to mercurial_extension_utils directory
# unless defaults below are OK
PYTHON = python
PYTYPE = pytype
PYTHON_VERSION = $(shell $(PYTHON) -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')
HGPATH ?= ../../mercurial_tracked/hg-stable
MEUPATH ?= ../extension_utils
HGPATH =
ifneq ($(HGPATH),)
export PYTHONPATH := $(realpath $(HGPATH)):$(PYTHONPATH)
endif
ifneq ($(MEUPATH),)
export PYTHONPATH := $(realpath $(MEUPATH)):$(PYTHONPATH)
endif
.PHONY: help
help:
......@@ -12,11 +33,10 @@ help:
@echo ' pytype - run pytype checks on the source tree'
.PHONY: pytype
pytype: PYTHON_VERSION = 3.7
pytype:
@[ -n "$(HGPATH)" ] || { echo "HGPATH not specified"; false; }
@[ -d "$(HGPATH)" ] || { echo "HGPATH not found: $(HGPATH)"; false; }
$(PYTYPE) -P ".:$(HGPATH):../mercurial-extension_utils" -V "$(PYTHON_VERSION)" -j auto \
@ # [ -n "$(HGPATH)" ] || { echo "HGPATH not specified"; false; }
@ # [ -d "$(HGPATH)" ] || { echo "HGPATH not found: $(HGPATH)"; false; }
$(PYTYPE) -P ".:$(HGPATH):$(MEUPATH)" -V "$(PYTHON_VERSION)" -j auto \
--config pytype.cfg
@echo 'pytype crashed while generating the following type stubs:'
find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment