Skip to content

Commit

Permalink
⚡🔧 chore:Update pyproject.toml config
Browse files Browse the repository at this point in the history
Added updates related to tests path
  • Loading branch information
MEHRSHAD-MIRSHEKARY committed Aug 31, 2024
1 parent e418030 commit a2f2e99
Showing 1 changed file with 129 additions and 139 deletions.
268 changes: 129 additions & 139 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = [ "poetry-core" ]

[tool.poetry]
name = "django-logging"
version = "0.1.0"
description = "A package for logging in django applications"
authors = ["ARYAN-NIKNEZHAD <[email protected]>", "MEHRSHAD-MIRSHEKARY <[email protected]>"]
authors = [ "ARYAN-NIKNEZHAD <[email protected]>", "MEHRSHAD-MIRSHEKARY <[email protected]>" ]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
django = [
{ version = ">=4.2,<5.0", python = ">=3.8,<3.10"},
{ version = ">=4.2,<5.3", python = ">=3.10" } # Django 4.2 and 5.x for Python 3.10+
{ version = ">=4.2,<5.0", python = ">=3.8,<3.10" },
{ version = ">=4.2,<5.3", python = ">=3.10" }, # Django 4.2 and 5.x for Python 3.10+
]


[tool.poetry.dev-dependencies]
pytest = "^8.3.2"
pytest-django = "^4.8.0"
Expand All @@ -25,109 +28,13 @@ isort = "^5.13.2"
black = "^24.4.2"
commitizen = "^3.28.0"
pre-commit = "^3.5.0"
bandit = {extras = ["toml"], version = "^1.7.9"}
bandit = { extras = [ "toml" ], version = "^1.7.9" }
tox = "^4.16.0"
django-stubs = "^5.0.4"
sphinx = "^6.2.1"
sphinx-rtd-theme = "^2.0.0"
docformatter = "^1.7.5"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "kernel.settings"
python_files = ["tests.py", "test_*.py"]
addopts = "--cov=django_logging --cov-report=html"
markers = [
"commands: Tests for Django management commands in the logging package.",
"commands_send_logs: Tests focused on the `send_logs` management command.",
"filters: Tests that verify log filtering mechanisms.",
"filters_level_filter: Tests for filtering logs based on their severity level.",
"formatters: Tests for log formatters that structure log messages.",
"colored_formatter: Tests for a formatter that adds color coding to log messages.",
"handlers: Tests for components that dispatch log messages to their destinations.",
"email_handler: Tests for the handler responsible for sending logs via email.",
"middleware: Tests related to middleware components in logging.",
"request_middleware: Tests for middleware handling incoming HTTP requests in logging.",
"settings: Tests that ensure logging settings are correctly applied.",
"settings_checks: Tests for validating the correctness of logging settings.",
"settings_conf: Tests for verifying the configuration of logging settings.",
"utils: Tests for utility functions supporting the logging package.",
"utils_context_manager: Tests for context managers handling resources in logging.",
"utils_email_notifier: Tests for utilities that send notifications via email.",
"utils_get_conf: Tests for utility functions that retrieve configuration settings.",
"utils_log_and_notify: Tests for logging utilities that trigger notifications.",
"utils_set_conf: Tests for utility functions that set configuration settings.",
"validators: Tests for validating configurations and inputs in the logging package.",
"config_validator: Tests focused on validators that check configuration settings.",
"email_settings_validator: Tests for validators that ensure email settings are valid."
]



[tool.pylint]
disable = [
"C0103", # Invalid constant name
"C0114", # Missing module docstring
"C0115", # Missing class docstring
"C0116", # Missing function or method docstring
"E1101", # Instance of 'Foo' has no 'bar' member
"W0212", # Access to a protected member
"C0301", # Line too long
"C0411", # Wrong import order
"W0611", # Unused imports
"W0613", # Unused arguments
"W0622", # Redefining built-in names
"R0903", # Too few public methods
"R0801", # Duplicate code
"W0621",
"C0415",
"R1719", # The if expression can be replaced with 'bool(test)'
"R1705", # Unnecessary "elif" after "return"
"R0401",
]
max-line-length = 88
ignore = [
"migrations/*",
"venv/*",
"build/*",
"dist/*",
".git/*",
".tox/*",
"__pycache__/*",
"*.egg-info/*",
".mypy_cache/*",
".pytest_cache/*"
]
django-settings-module= "kernel.settings"
load-plugins = [
"pylint_django",
"pylint.extensions.docparams",
]

suggestion-mode = true
const-rgx = "([A-Z_][A-Z0-9_]*)|(__.*__)"
attr-rgx = "[a-z_][a-z0-9_]{2,30}$"
variable-rgx = "[a-z_][a-z0-9_]{2,30}$"
argument-rgx = "[a-z_][a-z0-9_]{2,30}$"
method-rgx = "[a-z_][a-z0-9_]{2,30}$"
function-rgx = "[a-z_][a-z0-9_]{2,30}$"
class-rgx = "[A-Z_][a-zA-Z0-9]+$"
module-rgx = "(([a-z_][a-z0-9_]*)|(__.*__))$"


[tool.mypy]
mypy_path = "stubs"
disallow_untyped_calls = true
disallow_untyped_defs = true
ignore_missing_imports = true
explicit_package_bases = true
exclude = """
^docs/source/conf.py|
^build/|
^tests/|
^stubs/|
^kernel/
"""

codecov = "^2.1.13"

[tool.black]
line-length = 88
Expand All @@ -151,52 +58,141 @@ exclude = '''
)/
'''


[tool.isort]
profile = "black"
line_length = 88
skip = [
"venv",
".venv",
".tox",
"build",
"dist",
".git",
"__pycache__",
"*.egg-info",
".mypy_cache",
".pytest_cache",
"migrations",
"node_modules",
"env",
"kernel"
"venv",
".venv",
".tox",
"build",
"dist",
".git",
"__pycache__",
"*.egg-info",
".mypy_cache",
".pytest_cache",
"migrations",
"node_modules",
"env",
"kernel",
]

[tool.pylint]
disable = [
"C0103", # Invalid constant name
"C0114", # Missing module docstring
"C0115", # Missing class docstring
"C0116", # Missing function or method docstring
"E1101", # Instance of 'Foo' has no 'bar' member
"W0212", # Access to a protected member
"C0301", # Line too long
"C0411", # Wrong import order
"W0611", # Unused imports
"W0613", # Unused arguments
"W0622", # Redefining built-in names
"R0903", # Too few public methods
"R0801", # Duplicate code
"W0621",
"C0415",
"R1719", # The if expression can be replaced with 'bool(test)'
"R1705", # Unnecessary "elif" after "return"
"R0401",
]
max-line-length = 88
ignore = [
"tests",
"migrations/*",
"venv/*",
"build/*",
"dist/*",
".git/*",
".tox/*",
"__pycache__/*",
"*.egg-info/*",
".mypy_cache/*",
".pytest_cache/*",
]
django-settings-module = "kernel.settings"
load-plugins = [
"pylint_django",
"pylint.extensions.docparams",
]

suggestion-mode = true
const-rgx = "([A-Z_][A-Z0-9_]*)|(__.*__)"
attr-rgx = "[a-z_][a-z0-9_]{2,30}$"
variable-rgx = "[a-z_][a-z0-9_]{2,30}$"
argument-rgx = "[a-z_][a-z0-9_]{2,30}$"
method-rgx = "[a-z_][a-z0-9_]{2,30}$"
function-rgx = "[a-z_][a-z0-9_]{2,30}$"
class-rgx = "[A-Z_][a-zA-Z0-9]+$"
module-rgx = "(([a-z_][a-z0-9_]*)|(__.*__))$"

[tool.pytest.ini_options]
python_files = [ "tests.py", "test_*.py" ]
addopts = "--cov --cov-report=term-missing --cov-report=html --cov-fail-under=90"
markers = [
"commands: Tests for Django management commands in the logging package.",
"commands_send_logs: Tests focused on the `send_logs` management command.",
"filters: Tests that verify log filtering mechanisms.",
"filters_level_filter: Tests for filtering logs based on their severity level.",
"formatters: Tests for log formatters that structure log messages.",
"colored_formatter: Tests for a formatter that adds color coding to log messages.",
"handlers: Tests for components that dispatch log messages to their destinations.",
"email_handler: Tests for the handler responsible for sending logs via email.",
"middleware: Tests related to middleware components in logging.",
"request_middleware: Tests for middleware handling incoming HTTP requests in logging.",
"settings: Tests that ensure logging settings are correctly applied.",
"settings_checks: Tests for validating the correctness of logging settings.",
"settings_conf: Tests for verifying the configuration of logging settings.",
"utils: Tests for utility functions supporting the logging package.",
"utils_context_manager: Tests for context managers handling resources in logging.",
"utils_email_notifier: Tests for utilities that send notifications via email.",
"utils_get_conf: Tests for utility functions that retrieve configuration settings.",
"utils_log_and_notify: Tests for logging utilities that trigger notifications.",
"utils_set_conf: Tests for utility functions that set configuration settings.",
"validators: Tests for validating configurations and inputs in the logging package.",
"config_validator: Tests focused on validators that check configuration settings.",
"email_settings_validator: Tests for validators that ensure email settings are valid.",
]

[tool.coverage.run]
source = [ "django_logging" ]
omit = [
"*/migrations/*",
"kernel/*",
"*/apps.py",
"manage.py",
"*/tests/*",
"*/migrations/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self\\.debug",
"raise AssertionError",
"if 0:",
"if __name__ == .__main__.:"
"pragma: no cover",
"def __repr__",
"if self\\.debug",
"raise AssertionError",
"if 0:",
"if __name__ == .__main__.:",
]

[tool.mypy]
mypy_path = "stubs"
disallow_untyped_calls = true
disallow_untyped_defs = true
ignore_missing_imports = true
explicit_package_bases = true
exclude = """
^docs/source/conf.py|
^build/|
^tests/|
^stubs/|
^kernel/
"""

[tool.bandit]
targets = ["./django_logging"]
targets = [ "./django_logging" ]
exclude_dirs = [
"tests",
"migrations",
"tests",
"migrations",
]
severity = "medium"
confidence = "medium"
Expand All @@ -205,21 +201,15 @@ progress = true
reports = true
output_format = "screen"
output_file = "bandit_report.txt"
include = ["B101", "B102"]
exclude_tests = ["B301", "B302"]
include = [ "B101", "B102" ]
exclude_tests = [ "B301", "B302" ]

[tool.bandit.plugins]
B104 = { check_typed_list = true }


[tool.commitizen]
name = "cz_conventional_commits"
version = "0.1.0"

[tool.commitizen.settings]
increment_types = ["feat", "fix"]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
increment_types = [ "feat", "fix" ]

0 comments on commit a2f2e99

Please sign in to comment.