Read about our upcoming Code of Conduct on this issue

Commit e738e411 authored by Matt Harbison's avatar Matt Harbison
Browse files

Add infrastructure for running `pytype`

The makefile and config file were copied from TortoiseHg.  The location of the
`mercurial-extension_utils` repo is assumed to be next to this repo for
parent 4a2d0ce50f5a
......@@ -13,4 +13,5 @@ syntax: regexp
syntax: glob
\ No newline at end of file
PYTHON = python
PYTYPE = pytype
ifneq ($(HGPATH),)
export PYTHONPATH := $(realpath $(HGPATH)):$(PYTHONPATH)
.PHONY: help
@echo 'Commonly used make targets:'
@echo ' pytype - run pytype checks on the source tree'
.PHONY: pytype
pytype: PYTHON_VERSION = 3.7
@[ -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 \
--config pytype.cfg
@echo 'pytype crashed while generating the following type stubs:'
find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort
.PHONY: clean
$(PYTHON) clean
$(RM) -R .pytype
# NOTE: All relative paths are relative to the location of this file.
# Space-separated list of files or directories to exclude.
exclude =
# Space-separated list of files or directories to process.
inputs =
# Keep going past errors to analyze as many files as possible.
keep_going = True
# Run N jobs in parallel.
#jobs = 4
# All pytype output goes here.
output = .pytype
# Paths to source code directories, separated by ':'.
pythonpath =
# Python version (major.minor) of the target code.
python_version = 3.7
# Comma separated list of error names to ignore.
disable =
# Don't report errors.
report_errors = True
# Experimental: Infer precise return types even for invalid function calls.
precise_return = False
# Experimental: solve unknown types to label with structural types.
protocols = False
# Experimental: Only load submodules that are explicitly imported.
strict_import = False
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