Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Make mypy pre-commit hook isolated #1003

Merged
merged 1 commit into from
Aug 28, 2023
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
23 changes: 6 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,9 @@ jobs:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install/Update build dependencies
run: |
python -m pip install --upgrade setuptools
python -m pip install --upgrade pip
- name: Install Poetry
run: |
curl -sL https://install.python-poetry.org | python -
- name: Update Pip
run: poetry run pip install -U pip setuptools
- name: Install Dependencies
run: poetry install
- uses: pre-commit/[email protected]
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- uses: pre-commit/[email protected]
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ repos:
args:
- --py36-plus

- repo: local
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
name: mypy
entry: poetry run mypy
language: system
require_serial: true
pass_filenames: false
- id: mypy
files: sphinx_needs/.*
args: []
additional_dependencies:
- sphinx==6
- types-docutils
- types-requests

- repo: https://github.com/python-poetry/poetry
rev: 1.5.0
Expand Down
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ line-length = 120
profile = "black"

[tool.mypy]
files = "sphinx_needs"
strict = true
show_error_codes = true
implicit_reexport = true
files = "sphinx_needs"
ignore_missing_imports = true
namespace_packages = true
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = [
"requests_file",
"sphinx_data_viewer.*"
]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = [
Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/directives/list2need.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
OPTIONS_REGEX = re.compile(r"([^=,\s]*)=[\"']([^\"]*)[\"']")


class List2Need(nodes.General, nodes.Element): # type: ignore
class List2Need(nodes.General, nodes.Element):
pass


Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/directives/needimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sphinx_needs.utils import add_doc, logger


class Needimport(nodes.General, nodes.Element): # type: ignore
class Needimport(nodes.General, nodes.Element):
pass


Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/directives/needservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sphinx_needs.utils import add_doc, unwrap


class Needservice(nodes.General, nodes.Element): # type: ignore
class Needservice(nodes.General, nodes.Element):
pass


Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/nodes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from docutils import nodes


class Need(nodes.General, nodes.Element): # type: ignore
class Need(nodes.General, nodes.Element):
"""
Node for containing a complete need.
Node structure:
Expand Down