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

Commit

Permalink
Merge pull request #98 from staticdev/nox-mypy
Browse files Browse the repository at this point in the history
Fix mypy for nox
  • Loading branch information
Thiago C. D'Ávila authored Jun 19, 2020
2 parents 20be8da + 93fad37 commit 228a2cd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
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

0 comments on commit 228a2cd

Please sign in to comment.