Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Chan committed Feb 7, 2024
1 parent 790afc4 commit fe5f0af
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 1.0.2-27-gd60646a
_commit: 1.0.2-31-ga0ae01d
_src_path: gh:DiamondLightSource/python-copier-template
author_email: tom.cobb@diamond.ac.uk
author_name: Tom Cobb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_tox.yml
with:
tox: pre-commit,mypy
tox: pre-commit,pyright

test:
needs: check
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.mypyEnabled": true,
"python.linting.enabled": true,
"python.testing.pytestArgs": [
"--cov=python_copier_template_example",
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
.. _Diamond Light Source: http://www.diamond.ac.uk
.. _black: https://github.com/psf/black
.. _ruff: https://beta.ruff.rs/docs/
.. _mypy: http://mypy-lang.org/
.. _pyright: https://microsoft.github.io/pyright/#/
.. _pre-commit: https://pre-commit.com/
"""

Expand Down
8 changes: 4 additions & 4 deletions docs/developer/how-to/static-analysis.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Run static analysis using mypy
==============================
Run static analysis using pyright
=================================

Static type analysis is done with mypy_. It checks type definition in source
Static type analysis is done with pyright_. It checks type definition in source
files without running them, and highlights potential issues where types do not
match. You can run it with::

$ tox -e mypy
$ tox -e pyright
2 changes: 1 addition & 1 deletion docs/developer/reference/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The code in this repository conforms to standards set by the following tools:

- black_ for code formatting
- ruff_ for style checks
- mypy_ for static type checking
- pyright_ for static type checking

.. seealso::

Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ requires-python = ">=3.7"
[project.optional-dependencies]
dev = [
"black",
"mypy",
"pyright",
"pipdeptree",
"pre-commit",
"pydata-sphinx-theme>=0.12",
Expand Down Expand Up @@ -54,8 +54,8 @@ name = "Tom Cobb"
[tool.setuptools_scm]
write_to = "src/python_copier_template_example/_version.py"

[tool.mypy]
ignore_missing_imports = true # Ignore missing stubs in imported modules
[tool.pyright]
reportMissingImports = false # Ignore missing stubs in imported modules

[tool.pytest.ini_options]
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
Expand All @@ -81,19 +81,19 @@ legacy_tox_ini = """
[tox]
skipsdist=True
[testenv:{pre-commit,mypy,pytest,docs}]
[testenv:{pre-commit,pyright,pytest,docs}]
# Don't create a virtualenv for the command, requires tox-direct plugin
direct = True
passenv = *
allowlist_externals =
pytest
pre-commit
mypy
pyright
sphinx-build
sphinx-autobuild
commands =
pytest: pytest --cov=python_copier_template_example --cov-report term --cov-report xml:cov.xml {posargs}
mypy: mypy src tests {posargs}
pyright: pyright src tests {posargs}
pre-commit: pre-commit run --all-files {posargs}
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
"""
Expand Down

0 comments on commit fe5f0af

Please sign in to comment.