Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 93fad37

Browse files
author
staticdev
committed
nox-mypy
1 parent 3727af5 commit 93fad37

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# toml-validator
1+
# TOML validator
22

33
[![Tests](https://github.com/staticdev/toml-validator/workflows/Tests/badge.svg)](https://github.com/staticdev/toml-validator/actions?workflow=Tests)
44
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/toml-validator.svg)](https://pypi.python.org/pypi/toml-validator)

docs/conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Sphinx configuration."""
2+
from datetime import datetime
3+
4+
5+
project = "TOML validator"
6+
author = "Thiago Carvalho D'Ávila"
7+
copyright = f"{datetime.now().year}, {author}"
8+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
9+
autodoc_typehints = "description"

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[mypy]
22

3-
[mypy-nox.*,tomlkit.*,pytest,pytest_mock,_pytest.*]
3+
[mypy-tomlkit.*,pytest,pytest_mock,_pytest.*]
44
ignore_missing_imports = True

noxfile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Nox sessions."""
22
import contextlib
33
import shutil
4+
import sys
45
import tempfile
56
from pathlib import Path
67
from typing import cast
@@ -13,7 +14,6 @@
1314
package = "toml_validator"
1415
python_versions = ["3.7", "3.8"]
1516
nox.options.sessions = "pre-commit", "safety", "mypy", "tests"
16-
locations = "src", "tests", "noxfile.py"
1717

1818

1919
class Poetry:
@@ -130,9 +130,12 @@ def safety(session: Session) -> None:
130130
@nox.session(python=python_versions)
131131
def mypy(session: Session) -> None:
132132
"""Type-check using mypy."""
133-
args = session.posargs or locations
133+
args = session.posargs or ["src", "tests", "docs/conf.py"]
134+
install_package(session)
134135
install(session, "mypy")
135136
session.run("mypy", *args)
137+
if not session.posargs:
138+
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
136139

137140

138141
@nox.session(python=python_versions)

0 commit comments

Comments
 (0)