forked from nautobot/nautobot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
475 lines (443 loc) · 15.6 KB
/
Copy pathpyproject.toml
File metadata and controls
475 lines (443 loc) · 15.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
[project]
name = "nautobot"
# Primary package version gets set here. This is used for publishing, and once
# installed, `nautobot.__version__` will have this version number.
version = "3.1.2a0"
description = "Source of truth and network automation platform."
authors = [
{name = "Network to Code", email = "<opensource@networktocode.com>"}
]
license = {text = "Apache-2.0"}
readme = "README.md"
keywords = ["Nautobot"] # TODO augment this!
classifiers = [
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
requires-python = ">=3.10,<3.15"
dependencies = [
# Background task processing
"celery (>=5.6.3,<5.7)",
# Cryptographic recipes and primitives.
# Not directly used by Nautobot itself, but key to many of Nautobot's dependencies.
# Added as an explicit dependency to protect against various CVEs in older versions.
"cryptography (>=46.0.7,<46.1)",
# Fundamental web framework for Nautobot
"django (>=5.2.13,<5.3)",
# Adds AJAX capabilities to django-tables2. This dependency has been deprecated.
"django-ajax-tables (>=1.1.1,<1.2)",
# Database backend for task scheduling with Celery Beat
# Pinned to an exact version because we override a number of non-public APIs that could change in a patch release.
"django-celery-beat (==2.8.1)",
# Provides a database backend & models for Celery task results
"django-celery-results (>=2.6.0,<2.7)",
# Management of app configuration via the Django admin UI
"django-constance (>=4.3.5,<4.4)",
# Permit cross-domain API requests
"django-cors-headers (>=4.9.0,<4.10)",
# Store files in the database for background tasks
"django-db-file-storage (>=0.5.6.1,<0.6)",
# AutoSlugField and shell_plus
"django-extensions (>=4.1,<4.2)",
# Advanced query filters
"django-filter (>=25.2,<25.3)",
# Health check endpoint
"django-health-check (>=3.20.8,<3.21)",
# Django Jinja - jinja2 backend for django, used to easily register custom jinja filters and render jinja.
"django-jinja (>=2.11.0,<2.12)",
# Prometheus metrics for Django
"django-prometheus (>=2.4.1,<2.5)",
# Redis cache for Django used for distributed locking
"django-redis (>=6.0.0,<6.1)",
# Django silk for request profiling
"django-silk (>=5.5.0,<5.6)",
# Structured logging for Django
"django-structlog[celery] (>=10.0.0,<10.1)",
# Advanced HTML tables
"django-tables2 (>=2.8.0,<2.9)",
# Tags
"django-taggit (>=6.1.0,<6.2)",
# Represent time zones in Django
"django-timezone-field (>=7.2.1,<7.3)",
# Tree database structures based on Common Table Expressions
"django-tree-queries (>=0.23.1,<0.24)",
# Run production webservers such as uWSGI/gunicorn as a Django management command.
"django-webserver (>=1.2.0,<1.3)",
# REST API framework
"djangorestframework (>=3.17.1,<3.18)",
# OpenAPI 3.0 schema generation for the REST API
# Avoiding 0.29.0 for now due to https://github.com/tfranzel/drf-spectacular/issues/1475
"drf-spectacular[sidecar] (>=0.28.0,<0.29)",
# Emoji terminal output for Python.
"emoji (>=2.15.0,<2.16)",
# Git integrations for Python
"GitPython (>=3.1.47,<3.2)",
# GraphQL support
"graphene-django (>=3.2.3,<3.3)",
# Graphene Optimizer
"graphene-django-optimizer (>=0.10.0,<0.11)",
# Template rendering engine
"Jinja2 (>=3.1.6,<3.2)",
# Optional data validation of config contexts - loose dependency as our usage is light but apps may be more specific
"jsonschema (>=4.7.0,<5)",
# Library to access Kubernetes API used to develop K8s integration
"kubernetes (>=35.0.0,<36)",
# Rendering of markdown files to HTML
"Markdown (>=3.10.2,<3.11)",
# IP prefix and address handling
"netaddr (>=1.3.0,<1.4)",
# Library of network related utilities including network driver mappings and Jinja Filters
# Note: netutils is limited in scope, dependencies, and observes semver, as such
# we permit a looser (^) version constraint here.
"netutils (>=1.14.0,<2)",
# HTML sanitization
"nh3 (>=0.3.4,<0.4)",
# Handling of version numbers
"packaging (>=23.1)",
# Image processing library
"pillow (>=12.2.0,<13)",
# Custom prometheus metrics
"prometheus-client (>=0.24.1,<0.25)",
# PostgreSQL database adapter
# NOTE: psycopg3 is available now and nominally replaces psycopg2
"psycopg2-binary (>=2.9.12,<2.10)",
# A Python slugify application that handles unicode.
"python-slugify (>=8.0.4,<8.1)",
# The uWSGI WSGI HTTP server as a Python module
"pyuwsgi (>=2.0.30,<2.1)",
# YAML parsing and rendering
"PyYAML (>=6.0.3,<6.1)",
# Social authentication/registration with support for many auth providers
"social-auth-app-django (>=5.7.0,<5.8)",
# Rendering of SVG images (for rack elevations, etc.)
"svgwrite (>=1.4.3,<1.5)",
]
[project.optional-dependencies]
all = [
"django-auth-ldap (>=5.3.0,<5.4)",
"django-storages (>=1.14.6,<1.15)",
"mysqlclient (>=2.2.8,<2.3)",
"napalm (>=4.1.0,<6.0.0)",
"social-auth-core[saml] (>=4.8.7,<4.9)",
]
# LDAP Support
ldap = [ "django-auth-ldap (>=5.3.0,<5.4)" ]
# MySQL database adapter
mysql = [ "mysqlclient (>=2.2.8,<2.3)" ]
# NAPALM automation library
napalm = [ "napalm (>=4.1.0,<6.0.0)" ]
# External Storage support (i.e. S3)
remote_storage = [ "django-storages (>=1.14.6,<1.15)" ]
# Social authentication core
# Note that social-auth-app-django (below) is *not* an optional dependency, and it requires social-auth-core in turn.
# The only part of this dependency that is actually optional is in fact social-auth-core's "saml" extra.
sso = [ "social-auth-core[saml] (>=4.8.7,<4.9)" ]
[project.scripts]
nautobot-server = "nautobot.core.cli:main"
nautobot-migrate-bootstrap-v3-to-v5 = "nautobot.core.cli.bootstrap_v3_to_v5:main"
nautobot-migrate-deprecated-templates = "nautobot.core.cli.migrate_deprecated_templates:main"
[project.urls]
Homepage = "https://nautobot.com"
Repository = "https://github.com/nautobot/nautobot"
Documentation = "https://docs.nautobot.com"
[tool.poetry]
packages = [
{include = "nautobot"}
]
include = [
# Rendered documentation - Poetry by default would exclude these files as they are in .gitignore
{path = "nautobot/project-static/docs/**/*", format = ["sdist", "wheel"]},
]
exclude = [
# Source code of the documentation doesn't need to be included since we package the rendered docs
"nautobot/docs/**/*",
]
[tool.poetry.group.dev.dependencies]
# Tool for debugging Django
django-debug-toolbar = "~6.2.0"
# Nautobot example App used for testing
example-app = {path = "examples/example_app", develop = true}
# Nautobot test App used for testing core view overrides
example-app-with-view-override = {path = "examples/example_app_with_view_override", develop = true}
# Random data generation
factory-boy = "~3.3.3"
# Factory Boy dependency.
faker = "^40.11.0"
# Alternative to Make, CLI based on `tasks.py`
invoke = "~2.2.1"
# Colorization and autoformatting of CLI output, used for Invoke tasks
rich = "~14.3.4"
# Change log management and generation
towncrier = "~25.8.0"
# Watch files for celery and mkdocs reload
watchdog = "~6.0.0"
[tool.poetry.group.docs.dependencies]
# Rendering docs to HTML
mkdocs = "~1.6.1"
# Embedding YAML files into Markdown documents as tables
markdown-data-tables = "~1.0.0"
# Render custom markdown for version added/changed/remove notes
markdown-version-annotations = "~1.0.1"
# Automatically generate some files as part of mkdocs build
mkdocs-gen-files = "~0.6.1"
# Image lightboxing in mkdocs
mkdocs-glightbox = "~0.5.2"
# Use Jinja2 templating in docs - see settings.md
mkdocs-macros-plugin = "~1.5.0"
# Material for mkdocs theme
mkdocs-material = "~9.7.6"
# Handle docs redirections
mkdocs-redirects = "~1.2.3"
# Automatically handle index pages for docs sections
mkdocs-section-index = "~0.3.12"
# Automatic documentation from sources, for MkDocs
mkdocstrings = "~1.0.4"
# Python-specific extension to mkdocstrings
mkdocstrings-python = "~2.0.3"
[tool.poetry.group.linting.dependencies]
# Django template files indenter
djhtml = "~3.0.11"
# Django template files linter and formatter
djlint = "~1.36.4"
# Code static analysis
pylint = "~4.0.5"
# Pylint extensions for Django
pylint-django = "~2.7.0"
# Python implementation of markdownlint
pymarkdownlnt = "~0.9.36"
# Combination linter and code formatter
ruff = "~0.15.12"
# YAML linting
yamllint = "~1.38.0"
[tool.poetry.group.testing.dependencies]
# Test code coverage measurement
coverage = "~7.13.5"
# Testing of data migrations
django-test-migrations = "~1.5.0"
# OpenAPI validator to test that our generated schema is valid
openapi-spec-validator = "~0.8.5"
# Integration Tests
requests = "~2.33.1"
# Selenium web drivers for live integration testing
selenium = "~4.36.0"
# Abstraction layer for working with Selenium
splinter = "~0.21.0"
# Serialization of tracebacks - used when running unittest with --parallel flag
tblib = "~3.2.2"
# Time travel for testing, used in ScheduledJob tests etc.
time-machine = "~3.2.0"
[tool.poetry.scripts]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
disable_warnings = ["already-imported"]
include = [
"nautobot/*",
]
omit = [
# Don't measure coverage of test code
"nautobot/**/tests/**/*.py",
"nautobot/core/testing/*.py",
"nautobot/extras/test_jobs/*.py",
]
relative_files = true
[tool.djlint]
ignore = "H005,H006,H008,H011,H012,H013,H014,H015,H016,H019,H020,H021,H022,H023,H025,H026,H030,H031,H037,T001,T002,T003"
profile="django"
extend_exclude = "docs/,example_app/static,nautobot/project-static/"
[tool.pylint.master]
load-plugins = "pylint_django"
py-version = "3.10"
ignore-paths = [
".*third_party.*",
"nautobot/extras/tests/git_data/02-invalid-files/",
]
jobs = 0
[tool.pylint.basic]
# No docstrings required yet for private functions, or for test_* functions, or for inner Meta classes.
no-docstring-rgx="^(_|test_|Meta$)"
# Don't complain about "pk" as a variable name
good-names = """_,i,j,k,pk"""
[tool.pylint.message_control]
# TODO: re-enable and fix these as time permits
disable = [
# Warnings
"abstract-method",
"attribute-defined-outside-init",
"broad-except",
"fixme",
"global-statement",
"global-variable-not-assigned",
"logging-format-interpolation",
"logging-fstring-interpolation",
"pointless-statement",
"pointless-string-statement",
"protected-access",
"raise-missing-from",
"self-assigning-variable",
"signature-differs",
"unspecified-encoding",
"unused-argument",
"unused-import", # covered by ruff?
"unused-wildcard-import",
"wildcard-import",
# Conventions
"consider-iterating-dictionary",
"empty-docstring",
"import-outside-toplevel",
"invalid-name",
"keyword-arg-before-vararg", # https://github.com/pylint-dev/pylint/issues/7396
"line-too-long",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"superfluous-parens",
"too-many-lines",
"ungrouped-imports",
"unnecessary-dunder-call",
"use-maxsplit-arg",
"wrong-import-order",
"wrong-import-position",
# Refactoring
"consider-using-from-import",
"consider-using-in",
"consider-using-generator",
"cyclic-import",
"duplicate-code",
"no-else-break",
"no-else-raise",
"no-else-return",
"super-with-arguments",
"too-few-public-methods",
"too-many-ancestors",
"too-many-arguments",
"too-many-boolean-expressions",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-nested-blocks",
"too-many-positional-arguments",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
# Pylint-Django
"modelform-uses-exclude",
]
[tool.pylint.miscellaneous]
# We don't want to fail on "TODO" comments as there are plenty of those in our code for good reason
notes = ["FIXME", "XXX"]
[tool.pylint.typecheck]
# Regex patterns describing dynamically defined attributes that cause false reports for "no-member" checker
generated-members = [
".*Factory\\..*",
".*FactoryOptions\\..*",
".*FilterSet\\._meta",
".*FilterSet\\.base_filters",
".*FilterSet\\.declared_filters",
".*Job\\.request",
".*LazyAttribute\\..*", # factory attributes
".*Maybe\\..*", # factory attributes
".*Serializer\\.Meta",
".*Table\\._meta",
".*Table\\.base_columns",
".*Table\\.context",
]
extension-pkg-allow-list = [
"nh3",
]
# @patch changes the signature of a function it's applied to; don't raise "no-value-for-parameter" here
signature-mutators = ["unittest.mock.patch"]
[tool.pymarkdown]
extensions.front-matter.enabled = true # needed for mkdocs-macros compatibility
plugins.additional_paths = "scripts/file_relative_links.py"
plugins.code-block-style.enabled = false # inconsistency between "code" blocks and "admonition" blocks is expected
plugins.line-length.enabled = false # we don't wrap markdown to 80 characters.
plugins.list-anchored-indent.enabled = true # in place of ul-indent, see below
plugins.proper-names.names = "Celery,Django,Nautobot,Pylint,PyMarkdown,Python,REST API"
plugins.proper-names.code_blocks = false # don't check proper nouns inside ```code blocks```
plugins.proper-names.code_spans = false # don't check proper nouns inside `code spans`
plugins.ul-indent.enabled = false # doesn't work well with MkDocs expectations, use list-anchored-indent instead
[tool.ruff]
line-length = 120
target-version = "py310"
extend-exclude = [
# Intentionally malformed files
"nautobot/extras/tests/git_data/02-invalid-files/jobs",
]
[tool.ruff.lint]
select = [
"DJ", # flake8-django
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"PIE", # flake8-pie
"PLE", # pylint errors
"RUF", # ruff itself
"S", # flake8-bandit
"W", # pycodestyle
]
ignore = [
"E501", # pycodestyle: line-too-long
"PIE808", # unnecessary-range-start
"RUF012", # mutable-class-default - see https://github.com/astral-sh/ruff/issues/5243
]
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-local-folder = ["example_app"]
order-by-type = false
[tool.towncrier]
package = "nautobot"
directory = "changes"
filename = "nautobot/docs/release-notes/version-3.1.md"
template = "development/towncrier_template.j2"
start_string = "<!-- towncrier release notes start -->"
issue_format = "[#{issue}](https://github.com/nautobot/nautobot/issues/{issue})"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "security"
name = "Security"
showcontent = true
[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true
[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true
[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true
[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true
[[tool.towncrier.type]]
directory = "dependencies"
name = "Dependencies"
showcontent = true
[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "housekeeping"
name = "Housekeeping"
showcontent = true