From f4b565fa2883997364bcd22742e37443f0197328 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Mon, 8 Jan 2024 09:23:44 +0000 Subject: [PATCH 01/10] feat: Replace pydocstyle with ruff --- poetry.lock | 230 +++++++------------------------------------------ pyproject.toml | 42 ++++++--- tasks.py | 38 ++++++-- 3 files changed, 89 insertions(+), 221 deletions(-) diff --git a/poetry.lock b/poetry.lock index 60f1641..a97ca9d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "absl-py" version = "2.0.0" description = "Abseil Python Common Libraries, see https://github.com/abseil/abseil-py." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -16,7 +15,6 @@ files = [ name = "amqp" version = "5.2.0" description = "Low-level AMQP client for Python (fork of amqplib)." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -31,7 +29,6 @@ vine = ">=5.0.0,<6.0.0" name = "aniso8601" version = "7.0.0" description = "A library for parsing ISO 8601 strings." -category = "main" optional = false python-versions = "*" files = [ @@ -43,7 +40,6 @@ files = [ name = "appnope" version = "0.1.3" description = "Disable App Nap on macOS >= 10.9" -category = "dev" optional = false python-versions = "*" files = [ @@ -55,7 +51,6 @@ files = [ name = "asgiref" version = "3.7.2" description = "ASGI specs, helper code, and adapters" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -73,7 +68,6 @@ tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] name = "astroid" version = "2.15.8" description = "An abstract syntax tree for Python with inference support." -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -93,7 +87,6 @@ wrapt = [ name = "asttokens" version = "2.4.1" description = "Annotate AST trees with source code positions" -category = "dev" optional = false python-versions = "*" files = [ @@ -112,7 +105,6 @@ test = ["astroid (>=1,<2)", "astroid (>=2,<4)", "pytest"] name = "async-timeout" version = "4.0.3" description = "Timeout context manager for asyncio programs" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -124,7 +116,6 @@ files = [ name = "attrs" version = "23.2.0" description = "Classes Without Boilerplate" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -144,7 +135,6 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p name = "backcall" version = "0.2.0" description = "Specifications for callback functions passed in to an API" -category = "dev" optional = false python-versions = "*" files = [ @@ -156,7 +146,6 @@ files = [ name = "backports-zoneinfo" version = "0.2.1" description = "Backport of the standard library zoneinfo module" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -188,7 +177,6 @@ tzdata = ["tzdata"] name = "bandit" version = "1.7.6" description = "Security oriented static analyser for python code." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -212,7 +200,6 @@ yaml = ["PyYAML"] name = "billiard" version = "4.2.0" description = "Python multiprocessing fork with improvements and bugfixes" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -224,7 +211,6 @@ files = [ name = "black" version = "23.12.1" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -271,7 +257,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "capirca" version = "2.0.9" description = "Capirca" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -290,7 +275,6 @@ six = "*" name = "celery" version = "5.3.6" description = "Distributed Task Queue." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -347,7 +331,6 @@ zstd = ["zstandard (==0.22.0)"] name = "certifi" version = "2023.11.17" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -359,7 +342,6 @@ files = [ name = "cffi" version = "1.16.0" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -424,7 +406,6 @@ pycparser = "*" name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -524,7 +505,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -539,7 +519,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "click-default-group" version = "1.2.4" description = "click_default_group" -category = "dev" optional = false python-versions = ">=2.7" files = [ @@ -557,7 +536,6 @@ test = ["pytest"] name = "click-didyoumean" version = "0.3.0" description = "Enables git-like *did-you-mean* feature in click" -category = "main" optional = false python-versions = ">=3.6.2,<4.0.0" files = [ @@ -572,7 +550,6 @@ click = ">=7" name = "click-plugins" version = "1.1.1" description = "An extension module for click to enable registering CLI commands via setuptools entry-points." -category = "main" optional = false python-versions = "*" files = [ @@ -590,7 +567,6 @@ dev = ["coveralls", "pytest (>=3.6)", "pytest-cov", "wheel"] name = "click-repl" version = "0.3.0" description = "REPL plugin for Click" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -609,7 +585,6 @@ testing = ["pytest (>=7.2.1)", "pytest-cov (>=4.0.0)", "tox (>=4.4.3)"] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -621,7 +596,6 @@ files = [ name = "coverage" version = "7.4.0" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -686,7 +660,6 @@ toml = ["tomli"] name = "cron-descriptor" version = "1.4.0" description = "A Python library that converts cron expressions into human readable strings." -category = "main" optional = false python-versions = "*" files = [ @@ -700,7 +673,6 @@ dev = ["polib"] name = "cryptography" version = "41.0.7" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -746,7 +718,6 @@ test-randomorder = ["pytest-randomly"] name = "decorator" version = "5.1.1" description = "Decorators for Humans" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -758,7 +729,6 @@ files = [ name = "defusedxml" version = "0.7.1" description = "XML bomb protection for Python stdlib modules" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -770,7 +740,6 @@ files = [ name = "dill" version = "0.3.7" description = "serialize all of Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -785,7 +754,6 @@ graph = ["objgraph (>=1.7.2)"] name = "django" version = "3.2.23" description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -806,7 +774,6 @@ bcrypt = ["bcrypt"] name = "django-ajax-tables" version = "1.1.1" description = "Django tag for ajax-enabled tables" -category = "main" optional = false python-versions = "*" files = [ @@ -818,7 +785,6 @@ files = [ name = "django-celery-beat" version = "2.5.0" description = "Database-backed Periodic Tasks." -category = "main" optional = false python-versions = "*" files = [ @@ -839,7 +805,6 @@ tzdata = "*" name = "django-celery-results" version = "2.4.0" description = "Celery result backends for Django." -category = "main" optional = false python-versions = "*" files = [ @@ -854,7 +819,6 @@ celery = ">=5.2.3,<6.0" name = "django-constance" version = "2.9.1" description = "Django live settings with pluggable backends, including Redis." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -873,7 +837,6 @@ redis = ["redis"] name = "django-cors-headers" version = "4.2.0" description = "django-cors-headers is a Django application for handling the server headers required for Cross-Origin Resource Sharing (CORS)." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -888,7 +851,6 @@ Django = ">=3.2" name = "django-db-file-storage" version = "0.5.5" description = "Custom FILE_STORAGE for Django. Saves files in your database instead of your file system." -category = "main" optional = false python-versions = "*" files = [ @@ -902,7 +864,6 @@ Django = "*" name = "django-debug-toolbar" version = "4.2.0" description = "A configurable set of panels that display various debug information about the current request/response." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -918,7 +879,6 @@ sqlparse = ">=0.2" name = "django-extensions" version = "3.2.3" description = "Extensions for Django" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -933,7 +893,6 @@ Django = ">=3.2" name = "django-filter" version = "23.1" description = "Django-filter is a reusable Django application for allowing users to filter querysets dynamically." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -948,7 +907,6 @@ Django = ">=3.2" name = "django-health-check" version = "3.17.0" description = "Run checks on services like databases, queue servers, celery processes, etc." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -967,7 +925,6 @@ test = ["celery", "pytest", "pytest-cov", "pytest-django", "redis"] name = "django-jinja" version = "2.10.2" description = "Jinja2 templating language integrated in Django." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -983,7 +940,6 @@ jinja2 = ">=3" name = "django-picklefield" version = "3.1" description = "Pickled object field for Django" -category = "main" optional = false python-versions = ">=3" files = [ @@ -1001,7 +957,6 @@ tests = ["tox"] name = "django-prometheus" version = "2.3.1" description = "Django middlewares to monitor your application with Prometheus.io." -category = "main" optional = false python-versions = "*" files = [ @@ -1016,7 +971,6 @@ prometheus-client = ">=0.7" name = "django-redis" version = "5.3.0" description = "Full featured redis cache backend for Django." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1035,7 +989,6 @@ hiredis = ["redis[hiredis] (>=3,!=4.0.0,!=4.0.1)"] name = "django-tables2" version = "2.6.0" description = "Table/data-grid framework for Django" -category = "main" optional = false python-versions = "*" files = [ @@ -1053,7 +1006,6 @@ tablib = ["tablib"] name = "django-taggit" version = "4.0.0" description = "django-taggit is a reusable Django application for simple tagging." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1068,7 +1020,6 @@ Django = ">=3.2" name = "django-timezone-field" version = "5.1" description = "A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects." -category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1078,14 +1029,13 @@ files = [ [package.dependencies] "backports.zoneinfo" = {version = ">=0.2.1,<0.3.0", markers = "python_version < \"3.9\""} -Django = ">=2.2,<3.0.0 || >=3.2.0,<5.0" +Django = ">=2.2,<3.0.dev0 || >=3.2.dev0,<5.0" pytz = "*" [[package]] name = "django-tree-queries" version = "0.16.1" description = "Tree queries with explicit opt-in, without configurability" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1100,7 +1050,6 @@ tests = ["coverage"] name = "django-webserver" version = "1.2.0" description = "Django management commands for production webservers" -category = "main" optional = false python-versions = "*" files = [ @@ -1122,7 +1071,6 @@ waitress = ["waitress"] name = "djangorestframework" version = "3.14.0" description = "Web APIs for Django, made easy." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1138,7 +1086,6 @@ pytz = "*" name = "drf-react-template-framework" version = "0.0.17" description = "Django REST Framework plugin that creates form schemas for react-jsonschema-form" -category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1153,7 +1100,6 @@ djangorestframework = ">=3.12.0,<4.0.0" name = "drf-spectacular" version = "0.26.3" description = "Sane and flexible OpenAPI 3 schema generation for Django REST framework" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1178,7 +1124,6 @@ sidecar = ["drf-spectacular-sidecar"] name = "drf-spectacular-sidecar" version = "2024.1.1" description = "Serve self-contained distribution builds of Swagger UI and Redoc with Django" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1193,7 +1138,6 @@ Django = ">=2.2" name = "emoji" version = "2.8.0" description = "Emoji for Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1208,7 +1152,6 @@ dev = ["coverage", "coveralls", "pytest"] name = "executing" version = "2.0.1" description = "Get the currently executing AST node of a frame, and other information" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1223,7 +1166,6 @@ tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipyth name = "flake8" version = "5.0.4" description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -1240,7 +1182,6 @@ pyflakes = ">=2.5.0,<2.6.0" name = "ghp-import" version = "2.1.0" description = "Copy your docs directly to the gh-pages branch." -category = "dev" optional = false python-versions = "*" files = [ @@ -1258,7 +1199,6 @@ dev = ["flake8", "markdown", "twine", "wheel"] name = "gitdb" version = "4.0.11" description = "Git Object Database" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1273,7 +1213,6 @@ smmap = ">=3.0.1,<6" name = "gitpython" version = "3.1.40" description = "GitPython is a Python library used to interact with Git repositories" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1291,7 +1230,6 @@ test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre name = "graphene" version = "2.1.9" description = "GraphQL Framework for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -1314,7 +1252,6 @@ test = ["coveralls", "fastdiff (==0.2.0)", "iso8601", "mock", "promise", "pytest name = "graphene-django" version = "2.16.0" description = "Graphene Django integration" -category = "main" optional = false python-versions = "*" files = [ @@ -1339,7 +1276,6 @@ test = ["coveralls", "django-filter (>=2)", "djangorestframework (>=3.6.3)", "mo name = "graphene-django-optimizer" version = "0.8.0" description = "Optimize database access inside graphene queries." -category = "main" optional = false python-versions = "*" files = [ @@ -1350,7 +1286,6 @@ files = [ name = "graphql-core" version = "2.3.2" description = "GraphQL implementation for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -1371,7 +1306,6 @@ test = ["coveralls (==1.11.1)", "cython (==0.29.17)", "gevent (==1.5.0)", "pyann name = "graphql-relay" version = "2.0.1" description = "Relay implementation for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -1388,7 +1322,6 @@ six = ">=1.12" name = "griffe" version = "0.38.1" description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1403,7 +1336,6 @@ colorama = ">=0.4" name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -1415,7 +1347,6 @@ files = [ name = "importlib-metadata" version = "7.0.1" description = "Read metadata from Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1435,7 +1366,6 @@ testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs name = "importlib-resources" version = "5.13.0" description = "Read resources from Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1454,7 +1384,6 @@ testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", name = "incremental" version = "22.10.0" description = "\"A small library that versions your Python projects.\"" -category = "dev" optional = false python-versions = "*" files = [ @@ -1470,7 +1399,6 @@ scripts = ["click (>=6.0)", "twisted (>=16.4.0)"] name = "inflection" version = "0.5.1" description = "A port of Ruby on Rails inflector to Python" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -1482,7 +1410,6 @@ files = [ name = "invoke" version = "2.2.0" description = "Pythonic task execution" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1494,7 +1421,6 @@ files = [ name = "ipython" version = "8.12.3" description = "IPython: Productive Interactive Computing" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1534,7 +1460,6 @@ test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.21)", "pa name = "isort" version = "5.13.2" description = "A Python utility / library to sort Python imports." -category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -1549,7 +1474,6 @@ colors = ["colorama (>=0.4.6)"] name = "jedi" version = "0.19.1" description = "An autocompletion tool for Python that can be used for text editors." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1569,7 +1493,6 @@ testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1587,7 +1510,6 @@ i18n = ["Babel (>=2.7)"] name = "jsonschema" version = "4.18.6" description = "An implementation of JSON Schema validation for Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1611,7 +1533,6 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- name = "jsonschema-specifications" version = "2023.12.1" description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1627,7 +1548,6 @@ referencing = ">=0.31.0" name = "kombu" version = "5.3.4" description = "Messaging library for Python." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1662,7 +1582,6 @@ zookeeper = ["kazoo (>=2.8.0)"] name = "lazy-object-proxy" version = "1.10.0" description = "A fast and thorough lazy object proxy." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1709,7 +1628,6 @@ files = [ name = "markdown" version = "3.3.7" description = "Python implementation of Markdown." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1727,7 +1645,6 @@ testing = ["coverage", "pyyaml"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1752,7 +1669,6 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1812,7 +1728,6 @@ files = [ name = "matplotlib-inline" version = "0.1.6" description = "Inline Matplotlib backend for Jupyter" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1827,7 +1742,6 @@ traitlets = "*" name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1839,7 +1753,6 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1851,7 +1764,6 @@ files = [ name = "mergedeep" version = "1.3.4" description = "A deep merge function for 🐍." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1863,7 +1775,6 @@ files = [ name = "mkdocs" version = "1.5.2" description = "Project documentation with Markdown." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1895,7 +1806,6 @@ min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-imp name = "mkdocs-autorefs" version = "0.5.0" description = "Automatically link across pages in MkDocs." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1911,7 +1821,6 @@ mkdocs = ">=1.1" name = "mkdocs-material" version = "9.1.15" description = "Documentation that simply works" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1934,7 +1843,6 @@ requests = ">=2.26" name = "mkdocs-material-extensions" version = "1.3.1" description = "Extension pack for Python Markdown and MkDocs Material." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1946,7 +1854,6 @@ files = [ name = "mkdocs-version-annotations" version = "1.0.0" description = "MkDocs plugin to add custom admonitions for documenting version differences" -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1958,7 +1865,6 @@ files = [ name = "mkdocstrings" version = "0.22.0" description = "Automatic documentation from sources, for MkDocs." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1985,7 +1891,6 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] name = "mkdocstrings-python" version = "1.5.2" description = "A Python handler for mkdocstrings." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2001,7 +1906,6 @@ mkdocstrings = ">=0.20" name = "mock" version = "5.1.0" description = "Rolling backport of unittest.mock for all Pythons" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2018,7 +1922,6 @@ test = ["pytest", "pytest-cov"] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -2030,7 +1933,6 @@ files = [ name = "nautobot" version = "2.1.0" description = "Source of truth and network automation platform." -category = "main" optional = false python-versions = ">=3.8,<3.12" files = [ @@ -2093,7 +1995,6 @@ sso = ["social-auth-core[openidconnect,saml] (>=4.4.2,<4.5.0)"] name = "netaddr" version = "0.8.0" description = "A network address manipulation library for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -2105,7 +2006,6 @@ files = [ name = "netutils" version = "1.6.0" description = "Common helper functions useful in network automation." -category = "main" optional = false python-versions = ">=3.8,<4.0" files = [ @@ -2120,7 +2020,6 @@ optionals = ["jsonschema (>=4.17.3,<5.0.0)", "napalm (>=4.0.0,<5.0.0)"] name = "oauthlib" version = "3.2.2" description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2137,7 +2036,6 @@ signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"] name = "packaging" version = "23.1" description = "Core utilities for Python packages" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2149,7 +2047,6 @@ files = [ name = "parso" version = "0.8.3" description = "A Python Parser" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -2165,7 +2062,6 @@ testing = ["docopt", "pytest (<6.0.0)"] name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2177,7 +2073,6 @@ files = [ name = "pbr" version = "6.0.0" description = "Python Build Reasonableness" -category = "dev" optional = false python-versions = ">=2.6" files = [ @@ -2189,7 +2084,6 @@ files = [ name = "pexpect" version = "4.9.0" description = "Pexpect allows easy control of interactive console applications." -category = "dev" optional = false python-versions = "*" files = [ @@ -2204,7 +2098,6 @@ ptyprocess = ">=0.5" name = "pickleshare" version = "0.7.5" description = "Tiny 'shelve'-like database with concurrency support" -category = "dev" optional = false python-versions = "*" files = [ @@ -2216,7 +2109,6 @@ files = [ name = "pillow" version = "10.0.1" description = "Python Imaging Library (Fork)" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2284,7 +2176,6 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa name = "pkgutil-resolve-name" version = "1.3.10" description = "Resolve a name to an object." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2296,7 +2187,6 @@ files = [ name = "platformdirs" version = "4.1.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2312,7 +2202,6 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co name = "ply" version = "3.11" description = "Python Lex & Yacc" -category = "main" optional = false python-versions = "*" files = [ @@ -2324,7 +2213,6 @@ files = [ name = "prometheus-client" version = "0.17.1" description = "Python client for the Prometheus monitoring system." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2339,7 +2227,6 @@ twisted = ["twisted"] name = "promise" version = "2.3" description = "Promises/A+ implementation for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -2356,7 +2243,6 @@ test = ["coveralls", "futures", "mock", "pytest (>=2.7.3)", "pytest-benchmark", name = "prompt-toolkit" version = "3.0.43" description = "Library for building powerful interactive command lines in Python" -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -2371,7 +2257,6 @@ wcwidth = "*" name = "psycopg2-binary" version = "2.9.9" description = "psycopg2 - Python-PostgreSQL Database Adapter" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2450,7 +2335,6 @@ files = [ name = "ptyprocess" version = "0.7.0" description = "Run a subprocess in a pseudo terminal" -category = "dev" optional = false python-versions = "*" files = [ @@ -2462,7 +2346,6 @@ files = [ name = "pure-eval" version = "0.2.2" description = "Safely evaluate AST nodes without side effects" -category = "dev" optional = false python-versions = "*" files = [ @@ -2477,7 +2360,6 @@ tests = ["pytest"] name = "pycodestyle" version = "2.9.1" description = "Python style guide checker" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -2489,7 +2371,6 @@ files = [ name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -2497,29 +2378,10 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] -[[package]] -name = "pydocstyle" -version = "6.3.0" -description = "Python docstring style checker" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pydocstyle-6.3.0-py3-none-any.whl", hash = "sha256:118762d452a49d6b05e194ef344a55822987a462831ade91ec5c06fd2169d019"}, - {file = "pydocstyle-6.3.0.tar.gz", hash = "sha256:7ce43f0c0ac87b07494eb9c0b462c0b73e6ff276807f204d6b53edc72b7e44e1"}, -] - -[package.dependencies] -snowballstemmer = ">=2.2.0" - -[package.extras] -toml = ["tomli (>=1.2.3)"] - [[package]] name = "pyflakes" version = "2.5.0" description = "passive checker of Python programs" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -2531,7 +2393,6 @@ files = [ name = "pygments" version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2547,7 +2408,6 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyjwt" version = "2.8.0" description = "JSON Web Token implementation in Python" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2565,7 +2425,6 @@ tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] name = "pylint" version = "2.17.7" description = "python code static checker" -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -2595,7 +2454,6 @@ testutils = ["gitpython (>3)"] name = "pylint-django" version = "2.5.5" description = "A Pylint plugin to help Pylint understand the Django web framework" -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -2614,7 +2472,6 @@ with-django = ["Django (>=2.2)"] name = "pylint-nautobot" version = "0.2.1" description = "Custom Pylint Rules for Nautobot" -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -2632,7 +2489,6 @@ tomli = ">=2.0.1,<3.0.0" name = "pylint-plugin-utils" version = "0.8.2" description = "Utilities and helpers for writing Pylint plugins" -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -2647,7 +2503,6 @@ pylint = ">=1.7" name = "pymdown-extensions" version = "10.4" description = "Extension pack for Python Markdown." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2666,7 +2521,6 @@ extra = ["pygments (>=2.12)"] name = "python-crontab" version = "3.0.0" description = "Python Crontab API" -category = "main" optional = false python-versions = "*" files = [ @@ -2685,7 +2539,6 @@ cron-schedule = ["croniter"] name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -2700,7 +2553,6 @@ six = ">=1.5" name = "python-slugify" version = "8.0.1" description = "A Python slugify application that also handles Unicode" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2718,7 +2570,6 @@ unidecode = ["Unidecode (>=1.1.1)"] name = "python3-openid" version = "3.2.0" description = "OpenID support for modern servers and consumers." -category = "main" optional = false python-versions = "*" files = [ @@ -2737,7 +2588,6 @@ postgresql = ["psycopg2"] name = "pytz" version = "2023.3.post1" description = "World timezone definitions, modern and historical" -category = "main" optional = false python-versions = "*" files = [ @@ -2749,7 +2599,6 @@ files = [ name = "pyuwsgi" version = "2.0.23" description = "The uWSGI server" -category = "main" optional = false python-versions = "*" files = [ @@ -2802,7 +2651,6 @@ files = [ name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2852,7 +2700,6 @@ files = [ name = "pyyaml-env-tag" version = "0.1" description = "A custom YAML tag for referencing environment variables in YAML files. " -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -2867,7 +2714,6 @@ pyyaml = "*" name = "redis" version = "5.0.1" description = "Python client for Redis database and key-value store" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2886,7 +2732,6 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" name = "referencing" version = "0.32.0" description = "JSON Referencing + Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2902,7 +2747,6 @@ rpds-py = ">=0.7.0" name = "regex" version = "2023.12.25" description = "Alternative regular expression module, to replace re." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -3005,7 +2849,6 @@ files = [ name = "requests" version = "2.31.0" description = "Python HTTP for Humans." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -3027,7 +2870,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "requests-oauthlib" version = "1.3.1" description = "OAuthlib authentication support for Requests." -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -3046,7 +2888,6 @@ rsa = ["oauthlib[signedtoken] (>=3.0.0)"] name = "rich" version = "13.7.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" -category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -3066,7 +2907,6 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "rpds-py" version = "0.16.2" description = "Python bindings to Rust's persistent data structures (rpds)" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3171,11 +3011,36 @@ files = [ {file = "rpds_py-0.16.2.tar.gz", hash = "sha256:781ef8bfc091b19960fc0142a23aedadafa826bc32b433fdfe6fd7f964d7ef44"}, ] +[[package]] +name = "ruff" +version = "0.1.11" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196"}, + {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95"}, + {file = "ruff-0.1.11-py3-none-win32.whl", hash = "sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c"}, + {file = "ruff-0.1.11-py3-none-win_amd64.whl", hash = "sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a"}, + {file = "ruff-0.1.11-py3-none-win_arm64.whl", hash = "sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9"}, + {file = "ruff-0.1.11.tar.gz", hash = "sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb"}, +] + [[package]] name = "rx" version = "1.6.3" description = "Reactive Extensions (Rx) for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -3186,7 +3051,6 @@ files = [ name = "singledispatch" version = "4.1.0" description = "Backport functools.singledispatch to older Pythons." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3202,7 +3066,6 @@ testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -3214,7 +3077,6 @@ files = [ name = "smmap" version = "5.0.1" description = "A pure Python implementation of a sliding window memory map manager" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -3222,23 +3084,10 @@ files = [ {file = "smmap-5.0.1.tar.gz", hash = "sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"}, ] -[[package]] -name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, - {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, -] - [[package]] name = "social-auth-app-django" version = "5.2.0" description = "Python Social Authentication, Django integration." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -3254,7 +3103,6 @@ social-auth-core = ">=4.4.1" name = "social-auth-core" version = "4.5.1" description = "Python social authentication made simple." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3281,7 +3129,6 @@ saml = ["python3-saml (>=1.5.0)"] name = "sqlparse" version = "0.4.4" description = "A non-validating SQL parser." -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -3298,7 +3145,6 @@ test = ["pytest", "pytest-cov"] name = "stack-data" version = "0.6.3" description = "Extract data from python stack frames and tracebacks for informative displays" -category = "dev" optional = false python-versions = "*" files = [ @@ -3318,7 +3164,6 @@ tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] name = "stevedore" version = "5.1.0" description = "Manage dynamic plugins for Python applications" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -3333,7 +3178,6 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" name = "svgwrite" version = "1.4.3" description = "A Python library to create SVG drawings." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -3345,7 +3189,6 @@ files = [ name = "text-unidecode" version = "1.3" description = "The most basic Text::Unidecode port" -category = "main" optional = false python-versions = "*" files = [ @@ -3357,7 +3200,6 @@ files = [ name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -3369,7 +3211,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -3381,7 +3222,6 @@ files = [ name = "tomlkit" version = "0.12.3" description = "Style preserving TOML library" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -3393,7 +3233,6 @@ files = [ name = "towncrier" version = "23.6.0" description = "Building newsfiles for your project." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -3416,7 +3255,6 @@ dev = ["furo", "packaging", "sphinx (>=5)", "twisted"] name = "traitlets" version = "5.14.1" description = "Traitlets Python configuration system" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -3432,7 +3270,6 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, name = "typing-extensions" version = "4.9.0" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3444,7 +3281,6 @@ files = [ name = "tzdata" version = "2023.4" description = "Provider of IANA time zone data" -category = "main" optional = false python-versions = ">=2" files = [ @@ -3456,7 +3292,6 @@ files = [ name = "uritemplate" version = "4.1.1" description = "Implementation of RFC 6570 URI Templates" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -3468,7 +3303,6 @@ files = [ name = "urllib3" version = "2.1.0" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3485,7 +3319,6 @@ zstd = ["zstandard (>=0.18.0)"] name = "vine" version = "5.1.0" description = "Python promises." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -3497,7 +3330,6 @@ files = [ name = "watchdog" version = "3.0.0" description = "Filesystem events monitoring" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -3537,7 +3369,6 @@ watchmedo = ["PyYAML (>=3.10)"] name = "wcwidth" version = "0.2.12" description = "Measures the displayed width of unicode strings in a terminal" -category = "main" optional = false python-versions = "*" files = [ @@ -3549,7 +3380,6 @@ files = [ name = "wrapt" version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -3629,7 +3459,6 @@ files = [ name = "yamllint" version = "1.33.0" description = "A linter for YAML files." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -3648,7 +3477,6 @@ dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] name = "zipp" version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3666,4 +3494,4 @@ all = [] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12" -content-hash = "694410a0ab3d77812a27d952dfbfe47243bdd9cd353d05b68ba790d0be850824" +content-hash = "c8733d31659d8bcacbac2217555d8775d605e6adfd5d593b56d6ec62fc0dc19e" diff --git a/pyproject.toml b/pyproject.toml index d3986af..121ff93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,10 +36,10 @@ django-debug-toolbar = "*" flake8 = "*" invoke = "*" ipython = "*" -pydocstyle = "*" pylint = "*" pylint-django = "*" pylint-nautobot = "*" +ruff = "~0.1.10" yamllint = "*" toml = "*" Markdown = "*" @@ -111,17 +111,35 @@ supported_nautobot_versions = [ "2.0.0" ] -[tool.pydocstyle] -convention = "google" -inherit = false -match = "(?!__init__).*\\.py" -match-dir = "(?!tests|migrations|development)[^\\.].*" -# D212 is enabled by default in google convention, and complains if we have a docstring like: -# """ -# My docstring is on the line after the opening quotes instead of on the same line as them. -# """ -# We've discussed and concluded that we consider this to be a valid style choice. -add_ignore = "D212" +[tool.ruff] +line-length = 120 +target-version = "py38" +exclude = [ + "migrations", +] + +[tool.ruff.lint] +select = [ + "D1", # pydocstyle + "D2", # pydocstyle + "D3", # pydocstyle + "D4", # pydocstyle +] +ignore = [ + # warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. + "D203", # 1 blank line required before class docstring + + # D212 is enabled by default in google convention, and complains if we have a docstring like: + # """ + # My docstring is on the line after the opening quotes instead of on the same line as them. + # """ + # We've discussed and concluded that we consider this to be a valid style choice. + "D212", # Multi-line docstring summary should start at the first line + "D213", # Multi-line docstring summary should start at the second line + + # Produces a lot of issues in the current codebase. + "D401", # First line of docstring should be in imperative mood +] [build-system] requires = ["poetry_core>=1.0.0"] diff --git a/tasks.py b/tasks.py index 5543140..eac11e0 100644 --- a/tasks.py +++ b/tasks.py @@ -666,12 +666,34 @@ def pylint(context): run_command(context, command) -@task -def pydocstyle(context): - """Run pydocstyle to validate docstring formatting adheres to NTC defined standards.""" - # We exclude the /migrations/ directory since it is autogenerated code - command = "pydocstyle ." - run_command(context, command) +@task(aliases=("a",)) +def autoformat(context): + """Run code autoformatting.""" + black(context, autoformat=True) + ruff(context, action="both", fix=True) + + +@task( + help={ + "action": "One of 'lint', 'format', or 'both'", + "fix": "Automatically fix selected action. May not be able to fix all.", + "output_format": "see https://docs.astral.sh/ruff/settings/#output-format", + }, +) +def ruff(context, action="lint", fix=False, output_format="text"): + """Run ruff to perform code formatting and/or linting.""" + if action != "lint": + command = "ruff format" + if not fix: + command += " --check" + command += " ." + run_command(context, command) + if action != "format": + command = "ruff check" + if fix: + command += " --fix" + command += f" --output-format {output_format} ." + run_command(context, command) @task @@ -760,12 +782,12 @@ def tests(context, failfast=False, keepdb=False, lint_only=False): # Sorted loosely from fastest to slowest print("Running black...") black(context) + print("Running ruff...") + ruff(context) print("Running flake8...") flake8(context) print("Running bandit...") bandit(context) - print("Running pydocstyle...") - pydocstyle(context) print("Running yamllint...") yamllint(context) print("Running poetry check...") From 15ff411a276dcf7f163b3fd50e9ee3e5b85b3bc1 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Mon, 8 Jan 2024 09:26:36 +0000 Subject: [PATCH 02/10] fix: Formatting --- nautobot_firewall_models/management/__init__.py | 1 + nautobot_firewall_models/management/commands/__init__.py | 1 + nautobot_firewall_models/tests/test_api.py | 4 ---- nautobot_firewall_models/tests/test_capirca.py | 8 +++----- tasks.py | 5 ++++- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/nautobot_firewall_models/management/__init__.py b/nautobot_firewall_models/management/__init__.py index e69de29..ca7316a 100644 --- a/nautobot_firewall_models/management/__init__.py +++ b/nautobot_firewall_models/management/__init__.py @@ -0,0 +1 @@ +"""Management for Nautobot Firewall Models.""" diff --git a/nautobot_firewall_models/management/commands/__init__.py b/nautobot_firewall_models/management/commands/__init__.py index e69de29..bda2c93 100644 --- a/nautobot_firewall_models/management/commands/__init__.py +++ b/nautobot_firewall_models/management/commands/__init__.py @@ -0,0 +1 @@ +"""Management Commands for Nautobot Firewall Models.""" diff --git a/nautobot_firewall_models/tests/test_api.py b/nautobot_firewall_models/tests/test_api.py index 481da68..5d5c1fe 100644 --- a/nautobot_firewall_models/tests/test_api.py +++ b/nautobot_firewall_models/tests/test_api.py @@ -21,7 +21,6 @@ class IPRangeAPIViewTest(APIViewTestCases.APIViewTestCase): @classmethod def setUpTestData(cls): """Create test data for API calls.""" - cls.create_data = [ {"start_address": "10.0.0.1", "end_address": "10.0.0.3"}, {"start_address": "10.0.0.4", "end_address": "10.0.0.10"}, @@ -39,7 +38,6 @@ class FQDNAPIViewTest(APIViewTestCases.APIViewTestCase): @classmethod def setUpTestData(cls): """Create test data for API calls.""" - cls.create_data = [ {"name": "test.local"}, {"name": "sub.test.local"}, @@ -181,7 +179,6 @@ class UserObjectAPIViewTest(APIViewTestCases.APIViewTestCase): @classmethod def setUpTestData(cls): """Create test data for API calls.""" - cls.create_data = [ {"username": "test1", "name": "Foo"}, {"username": "test2", "name": "Bar"}, @@ -222,7 +219,6 @@ class ZoneAPIViewTest(APIViewTestCases.APIViewTestCase): @classmethod def setUpTestData(cls): """Create test data for API calls.""" - cls.create_data = [ {"name": "trust"}, {"name": "untrust"}, diff --git a/nautobot_firewall_models/tests/test_capirca.py b/nautobot_firewall_models/tests/test_capirca.py index d6c9341..a0e9356 100644 --- a/nautobot_firewall_models/tests/test_capirca.py +++ b/nautobot_firewall_models/tests/test_capirca.py @@ -269,7 +269,7 @@ def setUp(self) -> None: create_capirca_env() def test_generate_capirca_config(self): - """Test the implementation of capirca""" + """Test the implementation of capirca.""" # This partially tests the underlying library, but kept since it helps ensure that overloading # ParseServiceList and ParseNetworkList continue to work. As well as provides an easy place to test locally. # Such as running `invoke unittest -l nautobot_firewall_models.tests.test_capirca.TestBasicCapirca` and @@ -311,7 +311,6 @@ def setUp(self) -> None: def test_address_skip(self): """Check that address objects are found with status active and not found when other.""" - self.pol_rule6.source_addresses.set([self.addr_obj4, self.addr_obj5]) self.pol_rule6.validated_save() _, networkdata, _ = PolicyToCapirca(self.dev_name, self.pol1).validate_capirca_data() @@ -350,7 +349,6 @@ def test_address_empty(self): def test_address_fqdn(self): """Test that validation fails on creating an FQDN when using capirca.""" - fqdn1 = FQDN.objects.create(name="test.other", status=self.active) self.addr_obj5.ip_address = None self.addr_obj5.fqdn = fqdn1 @@ -371,7 +369,6 @@ def test_address_ip_range(self): def test_address_group_skip(self): """Check that address group objects are found with status active and not found when other.""" - self.pol_rule6.source_address_groups.set([self.addr_grp3, self.addr_grp4]) self.pol_rule6.validated_save() _, networkdata, _ = PolicyToCapirca(self.dev_name, self.pol1).validate_capirca_data() @@ -576,6 +573,7 @@ def test_policy_chd_allow_list(self): self.assertNotIn("other-value", pol[1]["headers"]) def test_policy_ctd_allow_list(self): + """Test terms can be allowed and not allowed based on custom field.""" self.pol_rule6._custom_field_data = {"ctd_test-custom": "unique-value", "ctd_test-other": "other-value"} self.pol_rule6.save() self.device_obj.platform._custom_field_data = {"capirca_allow": ["ctd_test-custom"]} @@ -633,7 +631,7 @@ def setUp(self) -> None: @skip("Not implemented until policy method provided to merge queries provided") def test_dynamic_group_and_device(self): - pass + """Test that dynamic groups are created and device is added to it, disabled.""" def test_multi_policy_capirca_config(self): """Verify that generating full config for a device is as expected.""" diff --git a/tasks.py b/tasks.py index eac11e0..09095ab 100644 --- a/tasks.py +++ b/tasks.py @@ -23,7 +23,8 @@ def is_truthy(arg): """Convert "truthy" strings into Booleans. - Examples: + Examples + -------- >>> is_truthy('yes') True Args: @@ -111,6 +112,7 @@ def docker_compose(context, command, **kwargs): """Helper function for running a specific docker compose command with all appropriate parameters and environment. Args: + ---- context (obj): Used to run specific commands command (str): Command string to append to the "docker compose ..." command, such as "build", "up", etc. **kwargs: Passed through to the context.run() call. @@ -708,6 +710,7 @@ def yamllint(context): """Run yamllint to validate formatting adheres to NTC defined YAML standards. Args: + ---- context (obj): Used to run specific commands """ command = "yamllint . --format standard" From e835cecd22be449a45c676e3707bed384656215f Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Mon, 8 Jan 2024 09:30:43 +0000 Subject: [PATCH 03/10] chore: Added changelog fragment --- changes/202.changed | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/202.changed diff --git a/changes/202.changed b/changes/202.changed new file mode 100644 index 0000000..db7a8cd --- /dev/null +++ b/changes/202.changed @@ -0,0 +1 @@ +Replaced `pydocstyle` with `ruff`. From 7172fe7106279be9611e512a62b40acff5636f71 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Mon, 8 Jan 2024 09:30:56 +0000 Subject: [PATCH 04/10] fix: Replace pydocstyle in CI. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27442b6..caa1995 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: uses: "networktocode/gh-action-setup-poetry-environment@v4" - name: "Linting: bandit" run: "poetry run invoke bandit" - pydocstyle: + ruff: runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_FIREWALL_MODELS_LOCAL: "True" @@ -47,8 +47,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v4" - - name: "Linting: pydocstyle" - run: "poetry run invoke pydocstyle" + - name: "Linting: ruff" + run: "poetry run invoke ruff" check-docs-build: runs-on: "ubuntu-22.04" env: @@ -96,7 +96,7 @@ jobs: pylint: needs: - "bandit" - - "pydocstyle" + - "ruff" - "flake8" - "poetry" - "yamllint" @@ -139,7 +139,7 @@ jobs: check-migrations: needs: - "bandit" - - "pydocstyle" + - "ruff" - "flake8" - "poetry" - "yamllint" From f6cd3909eb4dec3a738bc453f3a0a3d93638cfa3 Mon Sep 17 00:00:00 2001 From: Jan Snasel Date: Mon, 8 Jan 2024 09:33:12 +0000 Subject: [PATCH 05/10] fix: Documentation --- docs/dev/contributing.md | 2 +- docs/dev/dev_environment.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/dev/contributing.md b/docs/dev/contributing.md index 1684c39..df2b0c1 100644 --- a/docs/dev/contributing.md +++ b/docs/dev/contributing.md @@ -4,7 +4,7 @@ The project is packaged with a light [development environment](dev_environment.m The project is following Network to Code software development guidelines and is leveraging the following: -- Python linting and formatting: `black`, `pylint`, `bandit`, `flake8`, and `pydocstyle`. +- Python linting and formatting: `black`, `pylint`, `bandit`, `flake8`, and `ruff`. - YAML linting is done with `yamllint`. - Django unit test to ensure the app is working properly. diff --git a/docs/dev/dev_environment.md b/docs/dev/dev_environment.md index d3d6a12..46218b3 100644 --- a/docs/dev/dev_environment.md +++ b/docs/dev/dev_environment.md @@ -126,7 +126,7 @@ Each command can be executed with `invoke `. All commands support the a bandit Run bandit to validate basic static code security analysis. black Run black to check that Python files adhere to its style standards. flake8 Run flake8 to check that Python files adhere to its style standards. - pydocstyle Run pydocstyle to validate docstring formatting adheres to NTC defined standards. + ruff Run ruff to validate docstring formatting adheres to NTC defined standards. pylint Run pylint code analysis. tests Run all tests for this app. unittest Run Django unit tests for the app. @@ -467,6 +467,6 @@ To run an individual test, you can run any or all of the following: ➜ invoke bandit ➜ invoke black ➜ invoke flake8 -➜ invoke pydocstyle +➜ invoke ruff ➜ invoke pylint ``` From 0b7a8a565b345098d5bbf85fea0919127ac5008e Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 8 Jan 2024 07:56:30 -0600 Subject: [PATCH 06/10] update class path for job URL --- changes/203.fixed | 1 + nautobot_firewall_models/jobs.py | 3 ++- .../templates/nautobot_firewall_models/inc/capirca_policy.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changes/203.fixed diff --git a/changes/203.fixed b/changes/203.fixed new file mode 100644 index 0000000..7e8d10b --- /dev/null +++ b/changes/203.fixed @@ -0,0 +1 @@ +Fixed old reference to class path in URL pattern for job. \ No newline at end of file diff --git a/nautobot_firewall_models/jobs.py b/nautobot_firewall_models/jobs.py index a441d93..354d3cc 100644 --- a/nautobot_firewall_models/jobs.py +++ b/nautobot_firewall_models/jobs.py @@ -23,6 +23,7 @@ class Meta: name = "Generate FW Config via Capirca." description = "Generate FW Config via Capirca and update the models." commit_default = True + has_sensitive_variables = False def run(self, device): # pylint: disable=arguments-differ """Run a job to remove legacy reservations.""" @@ -48,7 +49,7 @@ def run(self, device): # pylint: disable=arguments-differ device_obj = Device.objects.get(pk=dev) logger.debug("Running against Device: `%s`", str(device_obj)) CapircaPolicy.objects.update_or_create(device=device_obj) - logger.info(obj=device_obj, message=f"{device_obj} Updated") + logger.info(f"{device_obj} Updated", extra={"object": device_obj}) jobs = [RunCapircaJob] diff --git a/nautobot_firewall_models/templates/nautobot_firewall_models/inc/capirca_policy.html b/nautobot_firewall_models/templates/nautobot_firewall_models/inc/capirca_policy.html index ee8cba5..ba13b66 100644 --- a/nautobot_firewall_models/templates/nautobot_firewall_models/inc/capirca_policy.html +++ b/nautobot_firewall_models/templates/nautobot_firewall_models/inc/capirca_policy.html @@ -2,6 +2,6 @@
Capirca Firewall Configurations - - +
\ No newline at end of file From cb27ea5b77adf8ec5bf96504f1f9300cdee80364 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 8 Jan 2024 08:23:43 -0600 Subject: [PATCH 07/10] update ci for main to dev to skip changelog --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 009486a..8dd29c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,9 @@ jobs: - name: "Run Tests" run: "poetry run invoke unittest" changelog: - if: contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) + if: | + contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) || + (github.head_ref == "main" && github.base_ref == "develop") runs-on: "ubuntu-22.04" steps: - name: "Check out repository code" From 6a643a8b12fc678d641b0587e24874486c14de2b Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 8 Jan 2024 08:26:07 -0600 Subject: [PATCH 08/10] update ci for main to dev to skip changelog --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dd29c4..c0af99e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: changelog: if: | contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) || - (github.head_ref == "main" && github.base_ref == "develop") + (github.head_ref == 'main' && github.base_ref == 'develop') runs-on: "ubuntu-22.04" steps: - name: "Check out repository code" From 0656a74face631be298d11797b5b724ad289827b Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 8 Jan 2024 10:23:17 -0500 Subject: [PATCH 09/10] Update .github/workflows/ci.yml Co-authored-by: Jan Snasel --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0af99e..e71b609 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -231,8 +231,8 @@ jobs: run: "poetry run invoke unittest" changelog: if: | - contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) || - (github.head_ref == 'main' && github.base_ref == 'develop') + contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) && + (github.head_ref != 'main') runs-on: "ubuntu-22.04" steps: - name: "Check out repository code" From f08deb19617673e3997811c9fa9106816cb37774 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 8 Jan 2024 09:44:49 -0600 Subject: [PATCH 10/10] Preparing for v2.0.3 release --- changes/202.changed | 1 - changes/203.fixed | 1 - docs/admin/release_notes/version_2.0.md | 10 ++++++++++ pyproject.toml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 changes/202.changed delete mode 100644 changes/203.fixed diff --git a/changes/202.changed b/changes/202.changed deleted file mode 100644 index db7a8cd..0000000 --- a/changes/202.changed +++ /dev/null @@ -1 +0,0 @@ -Replaced `pydocstyle` with `ruff`. diff --git a/changes/203.fixed b/changes/203.fixed deleted file mode 100644 index 7e8d10b..0000000 --- a/changes/203.fixed +++ /dev/null @@ -1 +0,0 @@ -Fixed old reference to class path in URL pattern for job. \ No newline at end of file diff --git a/docs/admin/release_notes/version_2.0.md b/docs/admin/release_notes/version_2.0.md index 7a9fe02..2928c3d 100644 --- a/docs/admin/release_notes/version_2.0.md +++ b/docs/admin/release_notes/version_2.0.md @@ -2,6 +2,16 @@ This document describes all new features and changes in the release `2.0`. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v2.0.3 (2024-01-08) + +### Changed + +- [#202](https://github.com/nautobot/nautobot/issues/202) - Replaced `pydocstyle` with `ruff`. + +### Fixed + +- [#203](https://github.com/nautobot/nautobot/issues/203) - Fixed old reference to class path in URL pattern for job. + ## v2.0.2 - 2024-01-04 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 121ff93..95cb3e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nautobot-firewall-models" -version = "2.0.2" +version = "2.0.3" description = "Nautobot app to model firewall objects." authors = ["Network to Code, LLC "] license = "Apache-2.0"