Skip to content

Commit da89244

Browse files
committed
Remove sphinx check, improve mypy check/versions.
1 parent 47a870a commit da89244

File tree

2 files changed

+4
-50
lines changed

2 files changed

+4
-50
lines changed

python-project-template/.pre-commit-config.yaml.jinja

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ repos:
122122
{%- endif %}
123123
{%- if mypy_type_checking != 'none' %}
124124
# Analyze type hints and report errors.
125-
- repo: local
125+
- repo: https://github.com/pre-commit/mirrors-mypy
126+
rev: v1.19.0
126127
hooks:
127128
- id: mypy
128129
name: mypy (python files in src/ and tests/)
@@ -138,55 +139,6 @@ repos:
138139
"--strict", # Use mypy strict mode to enforce type hints
139140
{%- endif %}
140141
]
141-
{%- endif %}
142-
{%- if include_docs and include_notebooks %}
143-
# Make sure Sphinx can build the documentation while explicitly omitting
144-
# notebooks from the docs, so users don't have to wait through the execution
145-
# of each notebook or each commit. By default, these will be checked in the
146-
# GitHub workflows.
147-
- repo: local
148-
hooks:
149-
- id: sphinx-build
150-
name: Build documentation with Sphinx
151-
entry: sphinx-build
152-
language: system
153-
always_run: true
154-
exclude_types: [file, symlink]
155-
args:
156-
[
157-
"-M", # Run sphinx in make mode, so we can use -D flag later
158-
# Note: -M requires next 3 args to be builder, source, output
159-
"html", # Specify builder
160-
"./docs", # Source directory of documents
161-
"./_readthedocs", # Output directory for rendered documents
162-
"-T", # Show full trace back on exception
163-
"-E", # Don't use saved env; always read all files
164-
"-d", # Flag for cached environment and doctrees
165-
"./docs/_build/doctrees", # Directory
166-
"-D", # Flag to override settings in conf.py
167-
"exclude_patterns=notebooks/*,_build", # Exclude notebooks and build dir from pre-commit
168-
]
169-
{%- elif include_docs %}
170-
# Make sure Sphinx can build the documentation without issues.
171-
- repo: local
172-
hooks:
173-
- id: sphinx-build
174-
name: Build documentation with Sphinx
175-
entry: sphinx-build
176-
language: system
177-
always_run: true
178-
exclude_types: [file, symlink]
179-
args:
180-
[
181-
"-T", # Show full trace back on exception
182-
"-E", # Don't use saved env. always read all files.
183-
"-b", # Flag to select which builder to use
184-
"html", # Use the HTML builder
185-
"-d", # Flag for cached environment and doctrees
186-
"./docs/_build/doctrees", # directory
187-
"./docs", # Source directory of documents
188-
"./_readthedocs", # Output directory for rendered documents.
189-
]
190142
{%- endif %}
191143
# Run unit tests, verify that they pass. Note that coverage is run against
192144
# the ./src directory here because that is what will be committed. In the

python-project-template/pyproject.toml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ ignore = [
132132
{% endif -%}
133133

134134
{%- if mypy_type_checking != 'none' %}
135+
[tool.mypy]
136+
python_version = "{{py.min(python_versions)}}"
135137
[tool.setuptools.package-data]
136138
{{package_name}} = ["py.typed"]
137139
{%- endif %}

0 commit comments

Comments
 (0)