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

[BUGFIX] Use requirements.txt file when installing linting/static check dependencies in CI #6368

Merged
merged 8 commits into from Nov 15, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-pipelines-dev.yml
Expand Up @@ -113,14 +113,14 @@ stages:
- job: type_hint_checker
steps:
- script: |
pip install mypy invoke # Prereq for type hint script
pip install --requirement reqs/requirements-dev-contrib.txt
invoke type-coverage
name: TypeHintChecker

- job: static_type_check
steps:
- script: |
pip install mypy invoke
pip install --requirement reqs/requirements-dev-contrib.txt
invoke type-check --install-types --warn-unused-ignores --pretty
name: StaticTypeCheck

Expand All @@ -132,7 +132,7 @@ stages:
- job: unused_import_checker
steps:
- script: |
pip install flake8
pip install --requirement reqs/requirements-dev-contrib.txt
# https://www.flake8rules.com/rules/F401.html
flake8 --select F401 great_expectations tests
name: UnusedImportChecker
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Expand Up @@ -88,16 +88,16 @@ stages:
condition: or(eq(variables.isScheduled, true), eq(variables.isReleasePrep, true), eq(variables.isRelease, true), eq(variables.isManual, true))
steps:
- script: |
pip install mypy invoke # Prereq for type hint script
pip install --requirement reqs/requirements-dev-contrib.txt
invoke type-coverage
name: TypeHintChecker

- job: static_type_check
condition: or(eq(variables.isScheduled, true), eq(variables.isReleasePrep, true), eq(variables.isRelease, true), eq(variables.isManual, true))
steps:
- script: |
pip install mypy invoke
invoke type-check --install-types --warn-unused-ignores --pretty
pip install --requirement reqs/requirements-dev-contrib.txt
invoke type-check --install-types --warn-unused-ignores --pretty
name: StaticTypeCheck

- job: docstring_checker
Expand All @@ -110,7 +110,7 @@ stages:
condition: or(eq(variables.isScheduled, true), eq(variables.isReleasePrep, true), eq(variables.isRelease, true), eq(variables.isManual, true))
steps:
- script: |
pip install flake8
pip install --requirement reqs/requirements-dev-contrib.txt
# https://www.flake8rules.com/rules/F401.html - Prunes the dgtest graph to improve accuracy
flake8 --select F401 great_expectations tests
name: UnusedImportChecker
Expand Down
2 changes: 1 addition & 1 deletion great_expectations/exceptions/exceptions.py
Expand Up @@ -304,7 +304,7 @@ def __init__(self, module_name, class_name) -> None:

class ClassInstantiationError(GreatExpectationsError):
def __init__(self, module_name, package_name, class_name) -> None:
module_spec = importlib.util.find_spec(module_name, package=package_name)
module_spec = importlib.util.find_spec(module_name, package=package_name) # type: ignore[attr-defined]
if not module_spec:
if not package_name:
package_name = ""
Expand Down
6 changes: 3 additions & 3 deletions great_expectations/util.py
Expand Up @@ -77,14 +77,14 @@
try:
import black
except ImportError:
black = None
black = None # type: ignore[assignment]

try:
# This library moved in python 3.8
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
# Fallback for python < 3.8
import importlib_metadata # type: ignore[no-redef]
import importlib_metadata

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -365,7 +365,7 @@ def verify_dynamic_loading_support(
"""
try:
# noinspection PyUnresolvedReferences
module_spec: importlib.machinery.ModuleSpec = importlib.util.find_spec( # type: ignore[assignment]
module_spec: importlib.machinery.ModuleSpec = importlib.util.find_spec( # type: ignore[attr-defined]
module_name, package=package_name
)
except ModuleNotFoundError:
Expand Down
2 changes: 1 addition & 1 deletion reqs/requirements-dev-contrib.txt
Expand Up @@ -2,7 +2,7 @@ black==22.3.0
flake8==5.0.4
invoke>=1.7.1
isort==5.10.1
mypy==0.990
mypy==0.991
pre-commit>=2.6.0
pytest-cov>=2.8.1
pytest-order>=0.9.5
Expand Down