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

Fix mypy for nox #98

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# toml-validator
# TOML validator

[![Tests](https://github.com/staticdev/toml-validator/workflows/Tests/badge.svg)](https://github.com/staticdev/toml-validator/actions?workflow=Tests)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/toml-validator.svg)](https://pypi.python.org/pypi/toml-validator)
Expand Down
9 changes: 9 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Sphinx configuration."""
from datetime import datetime


project = "TOML validator"
author = "Thiago Carvalho D'Ávila"
copyright = f"{datetime.now().year}, {author}"
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
autodoc_typehints = "description"
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[mypy]

[mypy-nox.*,tomlkit.*,pytest,pytest_mock,_pytest.*]
[mypy-tomlkit.*,pytest,pytest_mock,_pytest.*]
ignore_missing_imports = True
7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Nox sessions."""
import contextlib
import shutil
import sys
import tempfile
from pathlib import Path
from typing import cast
Expand All @@ -13,7 +14,6 @@
package = "toml_validator"
python_versions = ["3.7", "3.8"]
nox.options.sessions = "pre-commit", "safety", "mypy", "tests"
locations = "src", "tests", "noxfile.py"


class Poetry:
Expand Down Expand Up @@ -130,9 +130,12 @@ def safety(session: Session) -> None:
@nox.session(python=python_versions)
def mypy(session: Session) -> None:
"""Type-check using mypy."""
args = session.posargs or locations
args = session.posargs or ["src", "tests", "docs/conf.py"]
install_package(session)
install(session, "mypy")
session.run("mypy", *args)
if not session.posargs:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")


@nox.session(python=python_versions)
Expand Down