diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7cbcd588..799f62a7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,8 +42,18 @@ repos: hooks: - id: flake8 -# - repo: https://github.com/pre-commit/mirrors-mypy -# rev: v0.910 -# hooks: -# - id: mypy -# additional_dependencies: [types-all] +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.910 + hooks: + - id: mypy + additional_dependencies: [ + "types-all", # A shim for the typeshed changes in mypy 0.900 + ] + # "--ignore-missing-imports" prevents "Cannot find implementation or library stub for module" + # in pre-commit virtualenv + args: [ + "--ignore-missing-imports", + "--strict", + "--implicit-reexport" + ] + exclude: ^examples diff --git a/docs/conf.py b/docs/conf.py index 8528fcadf..3a102597e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,7 +4,6 @@ # list see the documentation: # http://www.sphinx-doc.org/en/master/config -import importlib.util import os # -- Path setup -------------------------------------------------------------- @@ -20,16 +19,12 @@ # -- Project information ----------------------------------------------------- # Get package version directly from file -# -# Importing 'pitop' requires all core dependencies to be installed -# which is impractical for building docs -spec = importlib.util.spec_from_file_location("version", f"{PARENT}/pitop/version.py") -modulevar = importlib.util.module_from_spec(spec) -spec.loader.exec_module(modulevar) +with open(os.path.join(PARENT, "pitop", "version.txt"), "w") as f: + version = f.read().strip() project = "pitop" author = "pi-top (CEED Ltd)" -release = modulevar.__version__ +release = version copyright = "pi-top 2021" # -- General configuration ---------------------------------------------------