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

Update version of dependency pylint #35

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
713 changes: 314 additions & 399 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pylint_nautobot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def register(linter: PyLinter):
for version in pyproject_toml_content["tool"]["pylint-nautobot"]["supported_nautobot_versions"]
]
except KeyError as error:
raise Exception("[tool.pylint-nautobot] configuration missing from pyproject.toml.") from error
raise AttributeError("[tool.pylint-nautobot] configuration missing from pyproject.toml.") from error

for checker in CHECKERS:
version_specifier_set = SpecifierSet(checker.version_specifier)
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/code_location_changes.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""Check for imports whose paths have changed in 2.0."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from pylint_nautobot.utils import MAP_CODE_LOCATION_CHANGES


class NautobotCodeLocationChangesChecker(BaseChecker):
"""Visit 'import from' statements to find import locations that have moved in 2.0."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-code-location-changes"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/incorrect_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from astroid import ClassDef, Assign, Const
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


def to_path(obj):
Expand Down Expand Up @@ -36,8 +35,6 @@ class NautobotIncorrectBaseClassChecker(BaseChecker):
Example: Every model that you define in the Nautobot ecosystem should inherit from 'nautobot.core.models.BaseModel'.
"""

__implements__ = IAstroidChecker

version_specifier = ">=1,<3"

# Maps a non-Nautobot-specific base class to a Nautobot-specific base class which has to be in the class hierarchy
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/replaced_models.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Check for usage of models that were replaced in 2.0."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotReplacedModelsImportChecker(BaseChecker):
"""Visit 'import from' statements to find usage of models that have been replaced in 2.0."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-replaced-models"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/status_field_instead_of_status_model.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Check for deprecated StatusModel usage and encourage the usage of StatusField instead."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotDeprecatedStatusModelChecker(BaseChecker):
"""Discourage the usage of deprecated StatusModel and encourage the usage of StatusField."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-status-field-instead-of-status-model"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/string_field_null_blank.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""Check for CharField's or TextField's on models where null=True and blank=True."""
from astroid import ClassDef, Assign, Call
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotStringFieldBlankNull(BaseChecker):
"""Visit classes to find class children on models who are CharField's or TextField's and check whether they are configured well."""

__implements__ = IAstroidChecker

version_specifier = ">=1,<3"

name = "nautobot-string-field-blank-null"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ authors = ["Cristian Sirbu <[email protected]>", "Leo Kirchner <l
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
pylint = "^2.13"
python = "^3.7.2"
pylint = "^2.17"
Comment on lines +9 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was temped to do the same from the get go, but it will clash when adding into other projects that use ^3.7, which is all plugins baked from our cookie. I think we need to stick to the old one until we bump minimum python to the next minor.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would you like me to do with this PR then?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold for a bit. Maybe we can raise the floor at least for 2.0 onwards. There's a sizeable delta in pylint release that all of our projects can't use because of this 3.7.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be able to do poetry add pylint^2.17 --python ^3.7.2 here, we did something similar in core

pyyaml = "^6.0"
importlib-resources = "^5.12.0"
tomli = "^2.0.1"
Expand Down