From 0806fbd0b6f1ba381ba5c4704050bde8bbd7ec19 Mon Sep 17 00:00:00 2001 From: Wouter Vanden Hove Date: Mon, 24 Apr 2023 23:34:22 +0200 Subject: [PATCH] update --- .env.example | 23 +- .github/workflows/linting.yaml | 12 +- docs/changes.rst | 6 +- docs/index-old.rst | 14 - docs/index.rst | 4 - docs/modules/libranet_logging/index.rst | 33 +- .../libranet_logging/logconfig/index.rst | 62 +--- docs/modules/libranet_logging/utils/index.rst | 66 ++++ .../libranet_logging/validate/index.rst | 58 ++++ docs/readme.md | 58 ++++ docs/unittesting.rst | 2 +- docs/usage.rst | 59 ---- poetry.lock | 316 ++++++++++++------ pyproject.toml | 60 ++-- src/libranet_logging/__init__.py | 6 +- .../etc/{logging.yml => logging.yaml} | 14 +- src/libranet_logging/logconfig.py | 6 +- src/libranet_logging/py.typed | 4 + src/libranet_logging/utils.py | 16 - ...on.yml => logging_email_substitution.yaml} | 2 +- ...schema.yml => logging_invalid_schema.yaml} | 2 +- ...lid_yaml.yml => logging_invalid_yaml.yaml} | 0 .../{logging_valid.yml => logging_valid.yaml} | 19 +- tests/test_logconfig.py | 18 +- tests/test_yaml.py | 5 +- 25 files changed, 510 insertions(+), 355 deletions(-) delete mode 100644 docs/index-old.rst create mode 100644 docs/modules/libranet_logging/utils/index.rst create mode 100644 docs/modules/libranet_logging/validate/index.rst delete mode 100644 docs/usage.rst rename src/libranet_logging/etc/{logging.yml => logging.yaml} (96%) create mode 100644 src/libranet_logging/py.typed rename tests/{logging_email_substitution.yml => logging_email_substitution.yaml} (96%) rename tests/{logging_invalid_schema.yml => logging_invalid_schema.yaml} (77%) rename tests/{logging_invalid_yaml.yml => logging_invalid_yaml.yaml} (100%) rename tests/{logging_valid.yml => logging_valid.yaml} (95%) diff --git a/.env.example b/.env.example index 6fe76f5..05710da 100644 --- a/.env.example +++ b/.env.example @@ -30,22 +30,27 @@ # >> alias source-env='set -a && source .env && set +a' ### project- directory-structure ### -# use double quotes if you use this in variable subsitutions +# use double quotes if you use this in variable subtitutions BASE_DIR="__CWD__" PROJECT_NAME='libranet-logging' -# PYTHON_LOG_DIR="__CWD__/var/log" -LOGGING_YML_FILE="__CWD__/etc/logging.yml" + IPYTHONDIR="__CWD__/etc/ipython" + +# caching +# MYPY_CACHE_DIR, PYTEST_CACHE_DIR, RUFF_CACHE_DIR defined in pyproject.toml CACHE_DIR="__CWD__/var/cache/" -DATA_DIR="__CWD__/var/data/" -DOWNLOAD_DIR="__CWD__/var/download/" -IPYTHONDIR="__CWD__/etc/ipython" -IPYTHON_CACHE_DIR="__CWD__/var/cache/ipython" -# MYPY_CACHE_DIR="__CWD__/var/cache/mypy" BLACK_CACHE_DIR="__CWD__/var/cache/black" +IPYTHON_CACHE_DIR="__CWD__/var/cache/ipython" +PRE_COMMIT_HOME="__CWD__/var/cache/pre-commit" PYLINTHOME="__CWD__/var/cache/pylint" -LOG_DIR="__CWD__/var/log" + +# tmp TMP="__CWD__/var/tmp" TMPDIR="__CWD__/var/tmp" TEMP="__CWD__/var/tmp" TEMPDIR="__CWD__/var/tmp" + +# logging +LOG_DIR="__CWD__/var/log" +LOGGING_YML_FILE="__CWD__/etc/logging.yml" +LOGGING_CFG="__CWD__/etc/logging.yml" diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index e9a07d8..0638036 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -43,9 +43,9 @@ jobs: printenv PATH poetry env info - - name: Flake8 - run: | - make flake8 + # - name: Flake8 + # run: | + # make flake8 - name: Ruff run: | @@ -55,9 +55,9 @@ jobs: run: | make pylint - - name: Mypy - run: | - make mypy + # - name: Mypy + # run: | + # make mypy - name: Pyroma run: | diff --git a/docs/changes.rst b/docs/changes.rst index a830243..8f15b27 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,7 +4,11 @@ Changelog 1.4 (unreleased) ---------------- -- Deprecate ``PYTHON_LOG_DIR``, use ``LOG_DIR`` instead. +- Change yaml-extension from ``*.yml`` to ``*.yaml``. + +- Renamed environment-variable ``PYTHON_LOG_CONFIG`` into ````. + +- Renamed environment-variable ``PYTHON_LOG_DIR`` into ``LOG_DIR``. - Replace ``pkg_resources`` with ``importlib.resources``. diff --git a/docs/index-old.rst b/docs/index-old.rst deleted file mode 100644 index 6ba189e..0000000 --- a/docs/index-old.rst +++ /dev/null @@ -1,14 +0,0 @@ -libranet_logging -================ - -.. toctree:: - :maxdepth: 2 - - readme - installation - usage - unittesting - Test Coverage - changes - contributors - license diff --git a/docs/index.rst b/docs/index.rst index 9bb169e..48d821d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,7 +5,6 @@ libranet-logging :maxdepth: 2 readme - installation usage unittesting changes @@ -27,9 +26,6 @@ libranet-logging modules/libranet_logging/index.rst - - - Indices and tables ================== diff --git a/docs/modules/libranet_logging/index.rst b/docs/modules/libranet_logging/index.rst index 7804cab..e970317 100644 --- a/docs/modules/libranet_logging/index.rst +++ b/docs/modules/libranet_logging/index.rst @@ -15,10 +15,11 @@ Submodules :titlesonly: :maxdepth: 1 - cli/index.rst filters/index.rst logconfig/index.rst loglevel/index.rst + utils/index.rst + validate/index.rst yaml/index.rst @@ -31,11 +32,11 @@ Functions .. autoapisummary:: - libranet_logging.print_loggers - libranet_logging.print_tree libranet_logging.initialize libranet_logging.output_logging_tree libranet_logging.create_loglevel + libranet_logging.print_loggers + libranet_logging.print_tree @@ -45,6 +46,8 @@ Attributes .. autoapisummary:: libranet_logging.__version__ + libranet_logging.__copyright__ + libranet_logging.__license__ libranet_logging.create_loglevel_trace @@ -53,19 +56,17 @@ Attributes -.. py:function:: print_loggers() +.. py:data:: __copyright__ + :value: 'Copyright 2015 - 2023 Libranet' - Returns: +.. py:data:: __license__ + :value: 'MIT License' -.. py:function:: print_tree() - - Returns: - -.. py:function:: initialize(path='', logdir='', capture_warnings=True, silent=False, use_print=False, variables=None) +.. py:function:: initialize(path='', logdir='', capture_warnings = True, silent = False, use_print = False, variables=None) Initialize logging configuration with a yaml-file. @@ -125,3 +126,15 @@ Attributes +.. py:function:: print_loggers() + + Returns: + + + +.. py:function:: print_tree() + + Returns: + + + diff --git a/docs/modules/libranet_logging/logconfig/index.rst b/docs/modules/libranet_logging/logconfig/index.rst index cffc735..f4e2b2a 100644 --- a/docs/modules/libranet_logging/logconfig/index.rst +++ b/docs/modules/libranet_logging/logconfig/index.rst @@ -18,14 +18,10 @@ Functions .. autoapisummary:: - libranet_logging.logconfig.is_interactive_shell libranet_logging.logconfig.get_sorted_lognames libranet_logging.logconfig.remove_console - libranet_logging.logconfig.ensure_dir libranet_logging.logconfig.convert_filenames libranet_logging.logconfig.remove_lower_level_handlers - libranet_logging.logconfig.validate_logging - libranet_logging.logconfig.strtobool libranet_logging.logconfig.output_logging_tree libranet_logging.logconfig.get_default_logging_yml libranet_logging.logconfig.initialize @@ -37,46 +33,16 @@ Attributes .. autoapisummary:: - libranet_logging.logconfig.cerberus libranet_logging.logconfig.log - libranet_logging.logconfig.logging_schema - - -.. py:data:: cerberus - .. py:data:: log -.. py:data:: logging_schema - - - -.. py:exception:: CerberusValidationError - - Bases: :py:obj:`Exception` - - CerberusValidationError-class. - - -.. py:function:: is_interactive_shell() - - Decide if this process is run in an interactive shell or not. - - If environment-variable $TERM is present, - we are running this code in a interactive shell, - else we are run from cron or called via nrpe as a nagios-check. - - Returns: boolean - - - .. py:function:: get_sorted_lognames() - Returns: - + Returns a sorted list of logging level names. .. py:function:: remove_console(config, disable_console=False) @@ -88,17 +54,9 @@ Attributes -.. py:function:: ensure_dir(directory) - - :param directory: - - Returns: - - - .. py:function:: convert_filenames(config, logdir='') - "Convert all relative filenames in the handlers to absolute paths. + "Convert relative filenames in the handlers to absolute paths. :param config: :param logdir: @@ -122,20 +80,6 @@ Attributes -.. py:function:: validate_logging(log_config, path) - - Validate the syntax of a logging.yml-file. - - -.. py:function:: strtobool(val) - - Convert a string representation of truth to true (1) or false (0). - - True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values - are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if - 'val' is anything else. - - .. py:function:: output_logging_tree(use_print=False) :param use_print: @@ -151,7 +95,7 @@ Attributes :returns: A `Path` object representing the path to the default logging configuration file. -.. py:function:: initialize(path='', logdir='', capture_warnings=True, silent=False, use_print=False, variables=None) +.. py:function:: initialize(path='', logdir='', capture_warnings = True, silent = False, use_print = False, variables=None) Initialize logging configuration with a yaml-file. diff --git a/docs/modules/libranet_logging/utils/index.rst b/docs/modules/libranet_logging/utils/index.rst new file mode 100644 index 0000000..e4fbdcd --- /dev/null +++ b/docs/modules/libranet_logging/utils/index.rst @@ -0,0 +1,66 @@ +:py:mod:`libranet_logging.utils` +================================ + +.. py:module:: libranet_logging.utils + +.. autoapi-nested-parse:: + + libranet_logging.utils + + + +Module Contents +--------------- + + +Functions +~~~~~~~~~ + +.. autoapisummary:: + + libranet_logging.utils.print_tree + libranet_logging.utils.print_loggers + libranet_logging.utils.strtobool + libranet_logging.utils.is_interactive_shell + libranet_logging.utils.ensure_dir + + + +.. py:function:: print_tree() + + Returns: + + + +.. py:function:: print_loggers() + + Returns: + + + +.. py:function:: strtobool(val) + + Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + + +.. py:function:: is_interactive_shell() + + Decide if this process is run in an interactive shell or not. + + If environment-variable $TERM is present, + we are running this code in a interactive shell, + else we are run from cron or called via nrpe as a nagios-check. + + Returns: boolean + + + +.. py:function:: ensure_dir(required_dir) + + Ensure the required directory exists. + + diff --git a/docs/modules/libranet_logging/validate/index.rst b/docs/modules/libranet_logging/validate/index.rst new file mode 100644 index 0000000..4d3b654 --- /dev/null +++ b/docs/modules/libranet_logging/validate/index.rst @@ -0,0 +1,58 @@ +:py:mod:`libranet_logging.validate` +=================================== + +.. py:module:: libranet_logging.validate + +.. autoapi-nested-parse:: + + libranet_logging.validate. + + + +Module Contents +--------------- + + +Functions +~~~~~~~~~ + +.. autoapisummary:: + + libranet_logging.validate.validate_logging + + + +Attributes +~~~~~~~~~~ + +.. autoapisummary:: + + libranet_logging.validate.cerberus + libranet_logging.validate.log + libranet_logging.validate.logging_schema + + +.. py:data:: cerberus + + + +.. py:data:: log + + + +.. py:data:: logging_schema + + + +.. py:exception:: CerberusValidationError + + Bases: :py:obj:`Exception` + + CerberusValidationError-class. + + +.. py:function:: validate_logging(log_config, path) + + Validate the syntax of a logging.yml-file. + + diff --git a/docs/readme.md b/docs/readme.md index a66bdfa..758081a 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -58,6 +58,64 @@ Move all config out of code and into a config-file "logging.yml" >>> logging.getLogger('panicmode') ``` + +# Usage + +## In your deployment + +You can use following env-variables: + + - LOGGING_YML_FILE, path to logging.yml, e.g /opt/miniconda/envs/libranet/etc/logging.yml + - LOG_DIR, path to log-directory where logfiles will be created, /var/tmp/python + - PYTHON_ENABLE_LOGGING_TREE 1|0 + + optional env-vars: + - LOGLEVEL_ROOT + - LOGLEVEL_libranet_logging + - LOG_HANDLERS="console|debug_file|info_file|warning_file|error_file" + + + If missing, these default to DEBUG + + +## In your code + +To initialize the logging-infrastructure and set-up all configured +loggers, handlers, formatters and filters: + +```python + > import libranet_logging + > libranet_logging.initialize() + 2018/06/01 10:00:00 - root - DEBUG - Logging configured from /logging.yml +``` + +You do this once in your application, +in the function that starts execution, not at the top of your module. + +```python + # Calling getLogger without arguments returns the root-logger, + # of which all other loggers descend. + # Normally you do NOT need this logger. + > import logging + > root_log = logging.getLogger() + + # You normally use the module-logger + > log = logging.getLogger(__name__) + + # and starting using it + > log.debug('This is debugging-information.') + > log.info('This is useful information.') + > log.warning('This is a warning.') + > log.error('This is a warning.') + + # You can log a full-traceback by providing the exception to log.exception(). + > try: + > import foo + > except ImportError as e: + > log.exception(e) +``` + + # Features - load logging-configuration from a yaml-config diff --git a/docs/unittesting.rst b/docs/unittesting.rst index e34c45a..64e5a41 100644 --- a/docs/unittesting.rst +++ b/docs/unittesting.rst @@ -5,7 +5,7 @@ Unittesting Introduction ------------ -Our python-package ``libranet_logging`` comes with a series of tests to check +Our python-package ``libranet-logging`` comes with a series of tests to check the validity of our code. Some are unittests, others are full integration-tests. The distinction between the several types of tests is of lesser importance. diff --git a/docs/usage.rst b/docs/usage.rst deleted file mode 100644 index fc1ed42..0000000 --- a/docs/usage.rst +++ /dev/null @@ -1,59 +0,0 @@ -Usage -===== - -In your deployment ------------------- - -You can use following env-variables: - - - PYTHON_LOG_CONFIG, path to logging.yml, e.g /opt/miniconda/envs/libranet/etc/logging.yml - - PYTHON_LOG_DIR, path to log-directory where logfiles will be created, /var/tmp/python - - PYTHON_ENABLE_LOGGING_TREE 1|0 - - optional env-vars: - - LOGLEVEL_ROOT - - LOGLEVEL_libranet_logging - - LOG_HANDLERS="console|debug_file|info_file|warning_file|error_file" - - - If missing, these default to DEBUG - - -In your code ------------- -To initialize the logging-infrastructure and set-up all configured -loggers, handlers, formatters and filters: - -.. code-block:: python - - > import libranet_logging - > libranet_logging.initialize() - 2018/06/01 10:00:00 - root - DEBUG - Logging configured from /logging.yml - -You do this once in your application, -in the function that starts execution, not at the top of your module. - -.. code-block:: python - - # Calling getLogger without arguments returns the root-logger, - # of which all other loggers descend. - # Normally you do NOT need this logger. - > import logging - > root_log = logging.getLogger() - - # You normally use the module-logger - > log = logging.getLogger(__name__) - - - # and starting using it - > log.debug('This is debugging-information.') - > log.info('This is useful information.') - > log.warning('This is a warning.') - > log.error('This is a warning.') - - # You can log a full-traceback by providing the exception to log.exception(). - > try: - > import foo - > except ImportError as e: - > log.exception(e) - diff --git a/poetry.lock b/poetry.lock index 0492e03..d15d120 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,16 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. + +[[package]] +name = "absolufy-imports" +version = "0.3.1" +description = "A tool to automatically replace relative imports with absolute ones." +category = "dev" +optional = false +python-versions = ">=3.6.1" +files = [ + {file = "absolufy_imports-0.3.1-py2.py3-none-any.whl", hash = "sha256:49bf7c753a9282006d553ba99217f48f947e3eef09e18a700f8a82f75dc7fc5c"}, + {file = "absolufy_imports-0.3.1.tar.gz", hash = "sha256:c90638a6c0b66826d1fb4880ddc20ef7701af34192c94faf40b95d32b59f9793"}, +] [[package]] name = "alabaster" @@ -64,22 +76,22 @@ test = ["astroid", "pytest"] [[package]] name = "attrs" -version = "22.2.0" +version = "23.1.0" description = "Classes Without Boilerplate" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, - {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, ] [package.extras] -cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope.interface"] -tests = ["attrs[tests-no-zope]", "zope.interface"] -tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] [[package]] name = "autoapi" @@ -488,63 +500,63 @@ test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] [[package]] name = "coverage" -version = "7.2.2" +version = "7.2.3" description = "Code coverage measurement for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "coverage-7.2.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c90e73bdecb7b0d1cea65a08cb41e9d672ac6d7995603d6465ed4914b98b9ad7"}, - {file = "coverage-7.2.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e2926b8abedf750c2ecf5035c07515770944acf02e1c46ab08f6348d24c5f94d"}, - {file = "coverage-7.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57b77b9099f172804e695a40ebaa374f79e4fb8b92f3e167f66facbf92e8e7f5"}, - {file = "coverage-7.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:efe1c0adad110bf0ad7fb59f833880e489a61e39d699d37249bdf42f80590169"}, - {file = "coverage-7.2.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2199988e0bc8325d941b209f4fd1c6fa007024b1442c5576f1a32ca2e48941e6"}, - {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:81f63e0fb74effd5be736cfe07d710307cc0a3ccb8f4741f7f053c057615a137"}, - {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:186e0fc9cf497365036d51d4d2ab76113fb74f729bd25da0975daab2e107fd90"}, - {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:420f94a35e3e00a2b43ad5740f935358e24478354ce41c99407cddd283be00d2"}, - {file = "coverage-7.2.2-cp310-cp310-win32.whl", hash = "sha256:38004671848b5745bb05d4d621526fca30cee164db42a1f185615f39dc997292"}, - {file = "coverage-7.2.2-cp310-cp310-win_amd64.whl", hash = "sha256:0ce383d5f56d0729d2dd40e53fe3afeb8f2237244b0975e1427bfb2cf0d32bab"}, - {file = "coverage-7.2.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3eb55b7b26389dd4f8ae911ba9bc8c027411163839dea4c8b8be54c4ee9ae10b"}, - {file = "coverage-7.2.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d2b96123a453a2d7f3995ddb9f28d01fd112319a7a4d5ca99796a7ff43f02af5"}, - {file = "coverage-7.2.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:299bc75cb2a41e6741b5e470b8c9fb78d931edbd0cd009c58e5c84de57c06731"}, - {file = "coverage-7.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5e1df45c23d4230e3d56d04414f9057eba501f78db60d4eeecfcb940501b08fd"}, - {file = "coverage-7.2.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:006ed5582e9cbc8115d2e22d6d2144a0725db542f654d9d4fda86793832f873d"}, - {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d683d230b5774816e7d784d7ed8444f2a40e7a450e5720d58af593cb0b94a212"}, - {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8efb48fa743d1c1a65ee8787b5b552681610f06c40a40b7ef94a5b517d885c54"}, - {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4c752d5264053a7cf2fe81c9e14f8a4fb261370a7bb344c2a011836a96fb3f57"}, - {file = "coverage-7.2.2-cp311-cp311-win32.whl", hash = "sha256:55272f33da9a5d7cccd3774aeca7a01e500a614eaea2a77091e9be000ecd401d"}, - {file = "coverage-7.2.2-cp311-cp311-win_amd64.whl", hash = "sha256:92ebc1619650409da324d001b3a36f14f63644c7f0a588e331f3b0f67491f512"}, - {file = "coverage-7.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5afdad4cc4cc199fdf3e18088812edcf8f4c5a3c8e6cb69127513ad4cb7471a9"}, - {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0484d9dd1e6f481b24070c87561c8d7151bdd8b044c93ac99faafd01f695c78e"}, - {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d530191aa9c66ab4f190be8ac8cc7cfd8f4f3217da379606f3dd4e3d83feba69"}, - {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ac0f522c3b6109c4b764ffec71bf04ebc0523e926ca7cbe6c5ac88f84faced0"}, - {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ba279aae162b20444881fc3ed4e4f934c1cf8620f3dab3b531480cf602c76b7f"}, - {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:53d0fd4c17175aded9c633e319360d41a1f3c6e352ba94edcb0fa5167e2bad67"}, - {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c99cb7c26a3039a8a4ee3ca1efdde471e61b4837108847fb7d5be7789ed8fd9"}, - {file = "coverage-7.2.2-cp37-cp37m-win32.whl", hash = "sha256:5cc0783844c84af2522e3a99b9b761a979a3ef10fb87fc4048d1ee174e18a7d8"}, - {file = "coverage-7.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:817295f06eacdc8623dc4df7d8b49cea65925030d4e1e2a7c7218380c0072c25"}, - {file = "coverage-7.2.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6146910231ece63facfc5984234ad1b06a36cecc9fd0c028e59ac7c9b18c38c6"}, - {file = "coverage-7.2.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:387fb46cb8e53ba7304d80aadca5dca84a2fbf6fe3faf6951d8cf2d46485d1e5"}, - {file = "coverage-7.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:046936ab032a2810dcaafd39cc4ef6dd295df1a7cbead08fe996d4765fca9fe4"}, - {file = "coverage-7.2.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e627dee428a176ffb13697a2c4318d3f60b2ccdde3acdc9b3f304206ec130ccd"}, - {file = "coverage-7.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fa54fb483decc45f94011898727802309a109d89446a3c76387d016057d2c84"}, - {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3668291b50b69a0c1ef9f462c7df2c235da3c4073f49543b01e7eb1dee7dd540"}, - {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:7c20b731211261dc9739bbe080c579a1835b0c2d9b274e5fcd903c3a7821cf88"}, - {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5764e1f7471cb8f64b8cda0554f3d4c4085ae4b417bfeab236799863703e5de2"}, - {file = "coverage-7.2.2-cp38-cp38-win32.whl", hash = "sha256:4f01911c010122f49a3e9bdc730eccc66f9b72bd410a3a9d3cb8448bb50d65d3"}, - {file = "coverage-7.2.2-cp38-cp38-win_amd64.whl", hash = "sha256:c448b5c9e3df5448a362208b8d4b9ed85305528313fca1b479f14f9fe0d873b8"}, - {file = "coverage-7.2.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bfe7085783cda55e53510482fa7b5efc761fad1abe4d653b32710eb548ebdd2d"}, - {file = "coverage-7.2.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9d22e94e6dc86de981b1b684b342bec5e331401599ce652900ec59db52940005"}, - {file = "coverage-7.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:507e4720791977934bba016101579b8c500fb21c5fa3cd4cf256477331ddd988"}, - {file = "coverage-7.2.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bc4803779f0e4b06a2361f666e76f5c2e3715e8e379889d02251ec911befd149"}, - {file = "coverage-7.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db8c2c5ace167fd25ab5dd732714c51d4633f58bac21fb0ff63b0349f62755a8"}, - {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4f68ee32d7c4164f1e2c8797535a6d0a3733355f5861e0f667e37df2d4b07140"}, - {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d52f0a114b6a58305b11a5cdecd42b2e7f1ec77eb20e2b33969d702feafdd016"}, - {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:797aad79e7b6182cb49c08cc5d2f7aa7b2128133b0926060d0a8889ac43843be"}, - {file = "coverage-7.2.2-cp39-cp39-win32.whl", hash = "sha256:db45eec1dfccdadb179b0f9ca616872c6f700d23945ecc8f21bb105d74b1c5fc"}, - {file = "coverage-7.2.2-cp39-cp39-win_amd64.whl", hash = "sha256:8dbe2647bf58d2c5a6c5bcc685f23b5f371909a5624e9f5cd51436d6a9f6c6ef"}, - {file = "coverage-7.2.2-pp37.pp38.pp39-none-any.whl", hash = "sha256:872d6ce1f5be73f05bea4df498c140b9e7ee5418bfa2cc8204e7f9b817caa968"}, - {file = "coverage-7.2.2.tar.gz", hash = "sha256:36dd42da34fe94ed98c39887b86db9d06777b1c8f860520e21126a75507024f2"}, + {file = "coverage-7.2.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e58c0d41d336569d63d1b113bd573db8363bc4146f39444125b7f8060e4e04f5"}, + {file = "coverage-7.2.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:344e714bd0fe921fc72d97404ebbdbf9127bac0ca1ff66d7b79efc143cf7c0c4"}, + {file = "coverage-7.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:974bc90d6f6c1e59ceb1516ab00cf1cdfbb2e555795d49fa9571d611f449bcb2"}, + {file = "coverage-7.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0743b0035d4b0e32bc1df5de70fba3059662ace5b9a2a86a9f894cfe66569013"}, + {file = "coverage-7.2.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d0391fb4cfc171ce40437f67eb050a340fdbd0f9f49d6353a387f1b7f9dd4fa"}, + {file = "coverage-7.2.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4a42e1eff0ca9a7cb7dc9ecda41dfc7cbc17cb1d02117214be0561bd1134772b"}, + {file = "coverage-7.2.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:be19931a8dcbe6ab464f3339966856996b12a00f9fe53f346ab3be872d03e257"}, + {file = "coverage-7.2.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72fcae5bcac3333a4cf3b8f34eec99cea1187acd55af723bcbd559adfdcb5535"}, + {file = "coverage-7.2.3-cp310-cp310-win32.whl", hash = "sha256:aeae2aa38395b18106e552833f2a50c27ea0000122bde421c31d11ed7e6f9c91"}, + {file = "coverage-7.2.3-cp310-cp310-win_amd64.whl", hash = "sha256:83957d349838a636e768251c7e9979e899a569794b44c3728eaebd11d848e58e"}, + {file = "coverage-7.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:dfd393094cd82ceb9b40df4c77976015a314b267d498268a076e940fe7be6b79"}, + {file = "coverage-7.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:182eb9ac3f2b4874a1f41b78b87db20b66da6b9cdc32737fbbf4fea0c35b23fc"}, + {file = "coverage-7.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bb1e77a9a311346294621be905ea8a2c30d3ad371fc15bb72e98bfcfae532df"}, + {file = "coverage-7.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca0f34363e2634deffd390a0fef1aa99168ae9ed2af01af4a1f5865e362f8623"}, + {file = "coverage-7.2.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55416d7385774285b6e2a5feca0af9652f7f444a4fa3d29d8ab052fafef9d00d"}, + {file = "coverage-7.2.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:06ddd9c0249a0546997fdda5a30fbcb40f23926df0a874a60a8a185bc3a87d93"}, + {file = "coverage-7.2.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:fff5aaa6becf2c6a1699ae6a39e2e6fb0672c2d42eca8eb0cafa91cf2e9bd312"}, + {file = "coverage-7.2.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ea53151d87c52e98133eb8ac78f1206498c015849662ca8dc246255265d9c3c4"}, + {file = "coverage-7.2.3-cp311-cp311-win32.whl", hash = "sha256:8f6c930fd70d91ddee53194e93029e3ef2aabe26725aa3c2753df057e296b925"}, + {file = "coverage-7.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:fa546d66639d69aa967bf08156eb8c9d0cd6f6de84be9e8c9819f52ad499c910"}, + {file = "coverage-7.2.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b2317d5ed777bf5a033e83d4f1389fd4ef045763141d8f10eb09a7035cee774c"}, + {file = "coverage-7.2.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be9824c1c874b73b96288c6d3de793bf7f3a597770205068c6163ea1f326e8b9"}, + {file = "coverage-7.2.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c3b2803e730dc2797a017335827e9da6da0e84c745ce0f552e66400abdfb9a1"}, + {file = "coverage-7.2.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f69770f5ca1994cb32c38965e95f57504d3aea96b6c024624fdd5bb1aa494a1"}, + {file = "coverage-7.2.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1127b16220f7bfb3f1049ed4a62d26d81970a723544e8252db0efde853268e21"}, + {file = "coverage-7.2.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:aa784405f0c640940595fa0f14064d8e84aff0b0f762fa18393e2760a2cf5841"}, + {file = "coverage-7.2.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3146b8e16fa60427e03884301bf8209221f5761ac754ee6b267642a2fd354c48"}, + {file = "coverage-7.2.3-cp37-cp37m-win32.whl", hash = "sha256:1fd78b911aea9cec3b7e1e2622c8018d51c0d2bbcf8faaf53c2497eb114911c1"}, + {file = "coverage-7.2.3-cp37-cp37m-win_amd64.whl", hash = "sha256:0f3736a5d34e091b0a611964c6262fd68ca4363df56185902528f0b75dbb9c1f"}, + {file = "coverage-7.2.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:981b4df72c93e3bc04478153df516d385317628bd9c10be699c93c26ddcca8ab"}, + {file = "coverage-7.2.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c0045f8f23a5fb30b2eb3b8a83664d8dc4fb58faddf8155d7109166adb9f2040"}, + {file = "coverage-7.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f760073fcf8f3d6933178d67754f4f2d4e924e321f4bb0dcef0424ca0215eba1"}, + {file = "coverage-7.2.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c86bd45d1659b1ae3d0ba1909326b03598affbc9ed71520e0ff8c31a993ad911"}, + {file = "coverage-7.2.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:172db976ae6327ed4728e2507daf8a4de73c7cc89796483e0a9198fd2e47b462"}, + {file = "coverage-7.2.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d2a3a6146fe9319926e1d477842ca2a63fe99af5ae690b1f5c11e6af074a6b5c"}, + {file = "coverage-7.2.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:f649dd53833b495c3ebd04d6eec58479454a1784987af8afb77540d6c1767abd"}, + {file = "coverage-7.2.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:7c4ed4e9f3b123aa403ab424430b426a1992e6f4c8fd3cb56ea520446e04d152"}, + {file = "coverage-7.2.3-cp38-cp38-win32.whl", hash = "sha256:eb0edc3ce9760d2f21637766c3aa04822030e7451981ce569a1b3456b7053f22"}, + {file = "coverage-7.2.3-cp38-cp38-win_amd64.whl", hash = "sha256:63cdeaac4ae85a179a8d6bc09b77b564c096250d759eed343a89d91bce8b6367"}, + {file = "coverage-7.2.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:20d1a2a76bb4eb00e4d36b9699f9b7aba93271c9c29220ad4c6a9581a0320235"}, + {file = "coverage-7.2.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ea748802cc0de4de92ef8244dd84ffd793bd2e7be784cd8394d557a3c751e21"}, + {file = "coverage-7.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21b154aba06df42e4b96fc915512ab39595105f6c483991287021ed95776d934"}, + {file = "coverage-7.2.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd214917cabdd6f673a29d708574e9fbdb892cb77eb426d0eae3490d95ca7859"}, + {file = "coverage-7.2.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c2e58e45fe53fab81f85474e5d4d226eeab0f27b45aa062856c89389da2f0d9"}, + {file = "coverage-7.2.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:87ecc7c9a1a9f912e306997ffee020297ccb5ea388421fe62a2a02747e4d5539"}, + {file = "coverage-7.2.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:387065e420aed3c71b61af7e82c7b6bc1c592f7e3c7a66e9f78dd178699da4fe"}, + {file = "coverage-7.2.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ea3f5bc91d7d457da7d48c7a732beaf79d0c8131df3ab278e6bba6297e23c6c4"}, + {file = "coverage-7.2.3-cp39-cp39-win32.whl", hash = "sha256:ae7863a1d8db6a014b6f2ff9c1582ab1aad55a6d25bac19710a8df68921b6e30"}, + {file = "coverage-7.2.3-cp39-cp39-win_amd64.whl", hash = "sha256:3f04becd4fcda03c0160d0da9c8f0c246bc78f2f7af0feea1ec0930e7c93fa4a"}, + {file = "coverage-7.2.3-pp37.pp38.pp39-none-any.whl", hash = "sha256:965ee3e782c7892befc25575fa171b521d33798132692df428a09efacaffe8d0"}, + {file = "coverage-7.2.3.tar.gz", hash = "sha256:d298c2815fa4891edd9abe5ad6e6cb4207104c7dd9fd13aea3fdebf6f9b91259"}, ] [package.dependencies] @@ -555,31 +567,31 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "40.0.1" +version = "40.0.2" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "dev" optional = false python-versions = ">=3.6" files = [ - {file = "cryptography-40.0.1-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:918cb89086c7d98b1b86b9fdb70c712e5a9325ba6f7d7cfb509e784e0cfc6917"}, - {file = "cryptography-40.0.1-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:9618a87212cb5200500e304e43691111570e1f10ec3f35569fdfcd17e28fd797"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a4805a4ca729d65570a1b7cac84eac1e431085d40387b7d3bbaa47e39890b88"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63dac2d25c47f12a7b8aa60e528bfb3c51c5a6c5a9f7c86987909c6c79765554"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:0a4e3406cfed6b1f6d6e87ed243363652b2586b2d917b0609ca4f97072994405"}, - {file = "cryptography-40.0.1-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1e0af458515d5e4028aad75f3bb3fe7a31e46ad920648cd59b64d3da842e4356"}, - {file = "cryptography-40.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d8aa3609d337ad85e4eb9bb0f8bcf6e4409bfb86e706efa9a027912169e89122"}, - {file = "cryptography-40.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cf91e428c51ef692b82ce786583e214f58392399cf65c341bc7301d096fa3ba2"}, - {file = "cryptography-40.0.1-cp36-abi3-win32.whl", hash = "sha256:650883cc064297ef3676b1db1b7b1df6081794c4ada96fa457253c4cc40f97db"}, - {file = "cryptography-40.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:a805a7bce4a77d51696410005b3e85ae2839bad9aa38894afc0aa99d8e0c3160"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cd033d74067d8928ef00a6b1327c8ea0452523967ca4463666eeba65ca350d4c"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d36bbeb99704aabefdca5aee4eba04455d7a27ceabd16f3b3ba9bdcc31da86c4"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:32057d3d0ab7d4453778367ca43e99ddb711770477c4f072a51b3ca69602780a"}, - {file = "cryptography-40.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f5d7b79fa56bc29580faafc2ff736ce05ba31feaa9d4735048b0de7d9ceb2b94"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7c872413353c70e0263a9368c4993710070e70ab3e5318d85510cc91cce77e7c"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:28d63d75bf7ae4045b10de5413fb1d6338616e79015999ad9cf6fc538f772d41"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6f2bbd72f717ce33100e6467572abaedc61f1acb87b8d546001328d7f466b778"}, - {file = "cryptography-40.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:cc3a621076d824d75ab1e1e530e66e7e8564e357dd723f2533225d40fe35c60c"}, - {file = "cryptography-40.0.1.tar.gz", hash = "sha256:2803f2f8b1e95f614419926c7e6f55d828afc614ca5ed61543877ae668cc3472"}, + {file = "cryptography-40.0.2-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:8f79b5ff5ad9d3218afb1e7e20ea74da5f76943ee5edb7f76e56ec5161ec782b"}, + {file = "cryptography-40.0.2-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:05dc219433b14046c476f6f09d7636b92a1c3e5808b9a6536adf4932b3b2c440"}, + {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4df2af28d7bedc84fe45bd49bc35d710aede676e2a4cb7fc6d103a2adc8afe4d"}, + {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0dcca15d3a19a66e63662dc8d30f8036b07be851a8680eda92d079868f106288"}, + {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:a04386fb7bc85fab9cd51b6308633a3c271e3d0d3eae917eebab2fac6219b6d2"}, + {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:adc0d980fd2760c9e5de537c28935cc32b9353baaf28e0814df417619c6c8c3b"}, + {file = "cryptography-40.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d5a1bd0e9e2031465761dfa920c16b0065ad77321d8a8c1f5ee331021fda65e9"}, + {file = "cryptography-40.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:a95f4802d49faa6a674242e25bfeea6fc2acd915b5e5e29ac90a32b1139cae1c"}, + {file = "cryptography-40.0.2-cp36-abi3-win32.whl", hash = "sha256:aecbb1592b0188e030cb01f82d12556cf72e218280f621deed7d806afd2113f9"}, + {file = "cryptography-40.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:b12794f01d4cacfbd3177b9042198f3af1c856eedd0a98f10f141385c809a14b"}, + {file = "cryptography-40.0.2-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:142bae539ef28a1c76794cca7f49729e7c54423f615cfd9b0b1fa90ebe53244b"}, + {file = "cryptography-40.0.2-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:956ba8701b4ffe91ba59665ed170a2ebbdc6fc0e40de5f6059195d9f2b33ca0e"}, + {file = "cryptography-40.0.2-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4f01c9863da784558165f5d4d916093737a75203a5c5286fde60e503e4276c7a"}, + {file = "cryptography-40.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:3daf9b114213f8ba460b829a02896789751626a2a4e7a43a28ee77c04b5e4958"}, + {file = "cryptography-40.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:48f388d0d153350f378c7f7b41497a54ff1513c816bcbbcafe5b829e59b9ce5b"}, + {file = "cryptography-40.0.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c0764e72b36a3dc065c155e5b22f93df465da9c39af65516fe04ed3c68c92636"}, + {file = "cryptography-40.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:cbaba590180cba88cb99a5f76f90808a624f18b169b90a4abb40c1fd8c19420e"}, + {file = "cryptography-40.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7a38250f433cd41df7fcb763caa3ee9362777fdb4dc642b9a349721d2bf47404"}, + {file = "cryptography-40.0.2.tar.gz", hash = "sha256:c33c0d32b8594fa647d2e01dbccc303478e16fdd7cf98652d5b3ed11aa5e5c99"}, ] [package.dependencies] @@ -681,6 +693,21 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "execnet" +version = "1.9.0" +description = "execnet: rapid multi-Python deployment" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142"}, + {file = "execnet-1.9.0.tar.gz", hash = "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5"}, +] + +[package.extras] +testing = ["pre-commit"] + [[package]] name = "executing" version = "1.2.0" @@ -698,19 +725,19 @@ tests = ["asttokens", "littleutils", "pytest", "rich"] [[package]] name = "filelock" -version = "3.10.7" +version = "3.12.0" description = "A platform independent file lock." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "filelock-3.10.7-py3-none-any.whl", hash = "sha256:bde48477b15fde2c7e5a0713cbe72721cb5a5ad32ee0b8f419907960b9d75536"}, - {file = "filelock-3.10.7.tar.gz", hash = "sha256:892be14aa8efc01673b5ed6589dbccb95f9a8596f0507e232626155495c18105"}, + {file = "filelock-3.12.0-py3-none-any.whl", hash = "sha256:ad98852315c2ab702aeb628412cbf7e95b7ce8c3bf9565670b4eaecf1db370a9"}, + {file = "filelock-3.12.0.tar.gz", hash = "sha256:fc03ae43288c013d2ea83c8597001b1129db351aad9c57fe2409327916b8e718"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2023.3.27)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.3)", "diff-cover (>=7.5)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] [[package]] name = "flake8" @@ -853,14 +880,14 @@ files = [ [[package]] name = "importlib-metadata" -version = "6.1.0" +version = "6.6.0" description = "Read metadata from Python packages" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "importlib_metadata-6.1.0-py3-none-any.whl", hash = "sha256:ff80f3b5394912eb1b108fcfd444dc78b7f1f3e16b16188054bd01cb9cb86f09"}, - {file = "importlib_metadata-6.1.0.tar.gz", hash = "sha256:43ce9281e097583d758c2c708c4376371261a02c34682491a8e98352365aad20"}, + {file = "importlib_metadata-6.6.0-py3-none-any.whl", hash = "sha256:43dd286a2cd8995d5eaef7fee2066340423b818ed3fd70adf0bad5f1fac53fed"}, + {file = "importlib_metadata-6.6.0.tar.gz", hash = "sha256:92501cdf9cc66ebd3e612f1b4f0c0765dfa42f0fa38ffb319b6bd84dd675d705"}, ] [package.dependencies] @@ -1577,6 +1604,18 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pprintpp" +version = "0.4.0" +description = "A drop-in replacement for pprint that's actually pretty" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "pprintpp-0.4.0-py2.py3-none-any.whl", hash = "sha256:b6b4dcdd0c0c0d75e4d7b2f21a9e933e5b2ce62b26e1a54537f9651ae5a5c01d"}, + {file = "pprintpp-0.4.0.tar.gz", hash = "sha256:ea826108e2c7f49dc6d66c752973c3fc9749142a798d6b254e1e301cfdbc6403"}, +] + [[package]] name = "pre-commit" version = "3.2.2" @@ -1710,14 +1749,14 @@ files = [ [[package]] name = "pygments" -version = "2.14.0" +version = "2.15.1" description = "Pygments is a syntax highlighting package written in Python." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "Pygments-2.14.0-py3-none-any.whl", hash = "sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717"}, - {file = "Pygments-2.14.0.tar.gz", hash = "sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297"}, + {file = "Pygments-2.15.1-py3-none-any.whl", hash = "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1"}, + {file = "Pygments-2.15.1.tar.gz", hash = "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c"}, ] [package.extras] @@ -1830,6 +1869,22 @@ tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] +[[package]] +name = "pytest-clarity" +version = "1.0.1" +description = "A plugin providing an alternative, colourful diff output for failing assertions." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pytest-clarity-1.0.1.tar.gz", hash = "sha256:505fe345fad4fe11c6a4187fe683f2c7c52c077caa1e135f3e483fe112db7772"}, +] + +[package.dependencies] +pprintpp = ">=0.4.0" +pytest = ">=3.5.0" +rich = ">=8.0.0" + [[package]] name = "pytest-click" version = "1.1.0" @@ -1865,6 +1920,45 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] +[[package]] +name = "pytest-mock" +version = "3.10.0" +description = "Thin-wrapper around the mock package for easier use with pytest" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-mock-3.10.0.tar.gz", hash = "sha256:fbbdb085ef7c252a326fd8cdcac0aa3b1333d8811f131bdcc701002e1be7ed4f"}, + {file = "pytest_mock-3.10.0-py3-none-any.whl", hash = "sha256:f4c973eeae0282963eb293eb173ce91b091a79c1334455acfac9ddee8a1c784b"}, +] + +[package.dependencies] +pytest = ">=5.0" + +[package.extras] +dev = ["pre-commit", "pytest-asyncio", "tox"] + +[[package]] +name = "pytest-xdist" +version = "3.2.1" +description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-xdist-3.2.1.tar.gz", hash = "sha256:1849bd98d8b242b948e472db7478e090bf3361912a8fed87992ed94085f54727"}, + {file = "pytest_xdist-3.2.1-py3-none-any.whl", hash = "sha256:37290d161638a20b672401deef1cba812d110ac27e35d213f091d15b8beb40c9"}, +] + +[package.dependencies] +execnet = ">=1.1" +pytest = ">=6.2.0" + +[package.extras] +psutil = ["psutil (>=3.0)"] +setproctitle = ["setproctitle"] +testing = ["filelock"] + [[package]] name = "pytz" version = "2023.3" @@ -2030,14 +2124,14 @@ idna2008 = ["idna"] [[package]] name = "rich" -version = "13.3.3" +version = "13.3.4" 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 = [ - {file = "rich-13.3.3-py3-none-any.whl", hash = "sha256:540c7d6d26a1178e8e8b37e9ba44573a3cd1464ff6348b99ee7061b95d1c6333"}, - {file = "rich-13.3.3.tar.gz", hash = "sha256:dc84400a9d842b3a9c5ff74addd8eb798d155f36c1c91303888e0a66850d2a15"}, + {file = "rich-13.3.4-py3-none-any.whl", hash = "sha256:22b74cae0278fd5086ff44144d3813be1cedc9115bdfabbfefd86400cb88b20a"}, + {file = "rich-13.3.4.tar.gz", hash = "sha256:b5d573e13605423ec80bdd0cd5f8541f7844a0e71a13f74cf454ccb2f490708b"}, ] [package.dependencies] @@ -2182,14 +2276,14 @@ jeepney = ">=0.6" [[package]] name = "setuptools" -version = "67.6.1" +version = "67.7.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, - {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, + {file = "setuptools-67.7.2-py3-none-any.whl", hash = "sha256:23aaf86b85ca52ceb801d32703f12d77517b2556af839621c641fca11287952b"}, + {file = "setuptools-67.7.2.tar.gz", hash = "sha256:f104fa03692a2602fa0fec6c6a9e63b6c8a968de13e17c026957dd1f53d80990"}, ] [package.extras] @@ -2512,14 +2606,14 @@ test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"] [[package]] name = "trove-classifiers" -version = "2023.3.9" +version = "2023.4.22" description = "Canonical source for classifiers on PyPI (pypi.org)." category = "dev" optional = false python-versions = "*" files = [ - {file = "trove-classifiers-2023.3.9.tar.gz", hash = "sha256:ee42f2f8c1d4bcfe35f746e472f07633570d485fab45407effc0379270a3bb03"}, - {file = "trove_classifiers-2023.3.9-py3-none-any.whl", hash = "sha256:06fd10c95d285e7ddebd59e6a4ba299f03d7417d38d369248a4a40c9754a68fa"}, + {file = "trove-classifiers-2023.4.22.tar.gz", hash = "sha256:65e8cb3929e3788141db90a0776b76fcafbeb548a4fbe6aee4bfd9656e899939"}, + {file = "trove_classifiers-2023.4.22-py3-none-any.whl", hash = "sha256:f8823bc4b002fb60ad102f1a97fbb0086efe149123f5701bcbae93d330321cca"}, ] [[package]] @@ -2612,24 +2706,24 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.21.0" +version = "20.22.0" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.21.0-py3-none-any.whl", hash = "sha256:31712f8f2a17bd06234fa97fdf19609e789dd4e3e4bf108c3da71d710651adbc"}, - {file = "virtualenv-20.21.0.tar.gz", hash = "sha256:f50e3e60f990a0757c9b68333c9fdaa72d7188caa417f96af9e52407831a3b68"}, + {file = "virtualenv-20.22.0-py3-none-any.whl", hash = "sha256:48fd3b907b5149c5aab7c23d9790bea4cac6bc6b150af8635febc4cfeab1275a"}, + {file = "virtualenv-20.22.0.tar.gz", hash = "sha256:278753c47aaef1a0f14e6db8a4c5e1e040e90aea654d0fc1dc7e0d8a42616cc3"}, ] [package.dependencies] distlib = ">=0.3.6,<1" -filelock = ">=3.4.1,<4" -platformdirs = ">=2.4,<4" +filelock = ">=3.11,<4" +platformdirs = ">=3.2,<4" [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] -test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.3)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.3.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] [[package]] name = "wcwidth" @@ -2759,4 +2853,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.8.0,<4.0" -content-hash = "79206bc4d433b2d36ff200f1d436f9f0137643915a49f554c74552e885ccc506" +content-hash = "9209d5937bd00f4a113bdd85ccdbcd35991f6fcc8ff8e2d3919f8793c8bb6ca1" diff --git a/pyproject.toml b/pyproject.toml index 79e6b1a..85b7893 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,55 +130,59 @@ packages = [{ include = "libranet_logging", from = "src" }] [tool.poetry.dependencies] python = ">=3.8.0,<4.0" -cerberus = ">=1.3.4" -colorlog = ">=6.7.0" +cerberus = ">=1.3" +colorlog = ">=6.7" logging-tree = ">=1.9" pyyaml = ">=6.0" [tool.poetry.group.dev.dependencies] -black = { version = ">=22.1.0", allow-prereleases = true } -flake8 = ">=5.0.4" -flake8-bugbear = ">=23.2.13" -flake8-docstrings = ">=1.6.0" -flake8-pyproject = ">=1.2.2" -isort = ">=5.10.1" -pre-commit = ">=2.20.0" -pre-commit-hooks = ">=4.4.0" -pylint = ">=2.15.0" -ruff = ">=0.0.252" +absolufy-imports = ">=0.3" +black = { version = ">=22.1", allow-prereleases = true } +flake8 = ">=5.0" +flake8-bugbear = ">=23.2" +flake8-docstrings = ">=1.6" +flake8-pyproject = ">=1.2" +isort = ">=5.10" +pre-commit = ">=2.20" +pre-commit-hooks = ">=4.4" +pylint = ">=2.15" +ruff = ">=0.0" [tool.poetry.group.dist.dependencies] pyroma = ">=4.2" twine = ">=4.0.2" [tool.poetry.group.docs.dependencies] -autoapi = ">=2.0.1" -recommonmark = ">=0.7.1" -Sphinx = ">=4.4.0" -sphinx-autoapi = ">=1.8.4" -sphinx-rtd-theme = ">=1.0.0" +autoapi = ">=2.0" +recommonmark = ">=0.7" +Sphinx = ">=4.4" +sphinx-autoapi = ">=1.8" +sphinx-rtd-theme = ">=1.0" [tool.poetry.group.ipython.dependencies] -ipdb = ">=0.13.9" -ipython = ">=8.4.0" +ipdb = ">=0.13" +ipython = ">=8.4" [tool.poetry.group.profiling.dependencies] -importtime-waterfall = ">=1.0.0" -tuna = ">=0.5.11" +importtime-waterfall = ">=1.0" +tuna = ">=0.5" [tool.poetry.group.security.dependencies] -bandit = { extras = ["toml"], version = ">=1.7.5" } -safety = ">=2.3.5" +bandit = { extras = ["toml"], version = ">=1.7" } +safety = ">=2.3" [tool.poetry.group.testing.dependencies] pytest = ">=7.0" -pytest-cov = ">=4.0.0" -pytest-click = ">=1.1.0" +pytest-clarity = "^1.0" +pytest-click = ">=1.1" +pytest-cov = ">=4.0" +pytest-mock = ">=3.10" +pytest-xdist = ">=3.2" [tool.poetry.group.typing.dependencies] -lxml = { version = ">=4.9.2", optional = true, allow-prereleases = false } # mypy coverage-report -mypy = ">=0.931" -types-pyyaml = ">=6.0.12.8" +lxml = { version = ">=4.9", optional = true, allow-prereleases = false } # mypy coverage-report +mypy = ">=0.9" +types-pyyaml = ">=6.0" [tool.poetry.urls] Issues = "https://github.com/libranet/libranet-logging/issues" diff --git a/src/libranet_logging/__init__.py b/src/libranet_logging/__init__.py index 58d18d6..e2a87d2 100644 --- a/src/libranet_logging/__init__.py +++ b/src/libranet_logging/__init__.py @@ -4,6 +4,6 @@ __copyright__ = "Copyright 2015 - 2023 Libranet" __license__ = "MIT License" -from .logconfig import initialize, output_logging_tree # noqa -from .loglevel import create_loglevel, create_loglevel_trace # noqa -from .utils import print_loggers, print_tree # noqa +from libranet_logging.logconfig import initialize, output_logging_tree # noqa +from libranet_logging.loglevel import create_loglevel, create_loglevel_trace # noqa +from libranet_logging.utils import print_loggers, print_tree # noqa diff --git a/src/libranet_logging/etc/logging.yml b/src/libranet_logging/etc/logging.yaml similarity index 96% rename from src/libranet_logging/etc/logging.yml rename to src/libranet_logging/etc/logging.yaml index 2946ae2..c31da01 100644 --- a/src/libranet_logging/etc/logging.yml +++ b/src/libranet_logging/etc/logging.yaml @@ -198,6 +198,12 @@ handlers: filename: 40-errors.log level: ERROR + ipython_startupfile: + <<: *default + filename: "ipython-startup.log" + formatter: "generic" + level: "DEBUG" + loggers: # Notes: # -) A disabled logger does nothing. If your application, or a library it uses underneath, @@ -206,6 +212,13 @@ loggers: # propagate defaults to True. # Therefore propagate is not applicable for the root-logger. + ipython-startup: + level: !env LOGLEVEL_IPYTHON _STARTUP, NOTSET + propagate: false + handlers: + - console + - ipython_startupfile + libranet_logging: level: !env LOGLEVEL_libranet_logging, DEBUG @@ -226,5 +239,4 @@ root: # Normally you don't need to use the root-logger directly, since all other loggers descend from it. # The dedicated "_file"-handlers are automatically removed if the root-loglevel is set higher. level: !env LOGLEVEL_ROOT, NOTSET - handlers: !env LOG_HANDLERS, "console|debug_file|info_file|warning_file|error_file" diff --git a/src/libranet_logging/logconfig.py b/src/libranet_logging/logconfig.py index dec9c94..ed72046 100644 --- a/src/libranet_logging/logconfig.py +++ b/src/libranet_logging/logconfig.py @@ -119,14 +119,14 @@ def output_logging_tree(use_print=False): log.debug(configured_log_description) -def get_default_logging_yml() -> pl.Path: +def get_default_logging_yaml() -> pl.Path: """ Returns the path to the default logging configuration file. Returns: A `Path` object representing the path to the default logging configuration file. """ - return pl.Path(importlib.resources.files("libranet_logging") / "etc/logging.yml") + return pl.Path(importlib.resources.files("libranet_logging") / "etc/logging.yaml") def initialize( @@ -151,7 +151,7 @@ def initialize( """ variables = variables or {} - path = str(path) or os.environ.get("PYTHON_LOG_CONFIG", "") or str(get_default_logging_yml()) + path = str(path) or os.environ.get("PYTHON_LOG_CONFIG", "") or str(get_default_logging_yaml()) config = read_yaml(path, variables=variables) config = convert_filenames(config, logdir=logdir) diff --git a/src/libranet_logging/py.typed b/src/libranet_logging/py.typed new file mode 100644 index 0000000..059d9b6 --- /dev/null +++ b/src/libranet_logging/py.typed @@ -0,0 +1,4 @@ +# This is a comment. +# +# py.typed is a marker file for PEP 561, +# see https://peps.python.org/pep-0561. \ No newline at end of file diff --git a/src/libranet_logging/utils.py b/src/libranet_logging/utils.py index 1fb7221..d4a0f12 100644 --- a/src/libranet_logging/utils.py +++ b/src/libranet_logging/utils.py @@ -82,22 +82,6 @@ def is_interactive_shell(): return False -# def ensure_dir(directory): -# """ - -# Args: -# directory: - -# Returns: - -# """ -# if os.path.exists(directory): -# if not os.path.isdir(directory): -# raise OSError(f"The provided path to the log-directory exist but is not a directory: {directory}") -# else: -# os.makedirs(directory) - - def ensure_dir(required_dir: tp.Union[pl.Path, str]) -> None: """Ensure the required directory exists.""" diff --git a/tests/logging_email_substitution.yml b/tests/logging_email_substitution.yaml similarity index 96% rename from tests/logging_email_substitution.yml rename to tests/logging_email_substitution.yaml index 4149982..f3c68ef 100644 --- a/tests/logging_email_substitution.yml +++ b/tests/logging_email_substitution.yaml @@ -1,6 +1,6 @@ # This is a comment. -logdir: !env PYTHON_LOG_DIR +logdir: !env LOG_DIR version: 1 diff --git a/tests/logging_invalid_schema.yml b/tests/logging_invalid_schema.yaml similarity index 77% rename from tests/logging_invalid_schema.yml rename to tests/logging_invalid_schema.yaml index 09c70d7..bf22d1d 100644 --- a/tests/logging_invalid_schema.yml +++ b/tests/logging_invalid_schema.yaml @@ -1,6 +1,6 @@ # This is a comment. -logdir: !env PYTHON_LOG_DIR +logdir: !env LOG_DIR # version: 1 # violates the logging-schema diff --git a/tests/logging_invalid_yaml.yml b/tests/logging_invalid_yaml.yaml similarity index 100% rename from tests/logging_invalid_yaml.yml rename to tests/logging_invalid_yaml.yaml diff --git a/tests/logging_valid.yml b/tests/logging_valid.yaml similarity index 95% rename from tests/logging_valid.yml rename to tests/logging_valid.yaml index 2669ad7..cc352d1 100644 --- a/tests/logging_valid.yml +++ b/tests/logging_valid.yaml @@ -37,7 +37,7 @@ # : # level: !env , -logdir: !env PYTHON_LOG_DIR +logdir: !env LOG_DIR version: 1 @@ -250,19 +250,6 @@ loggers: root: # You can get the root-logger via logging.getLogger(), # Normally you don't need to use the root-logger directly, since all other loggers descend from it. - - # The console-handler is automatically removed if not-interactive. # The dedicated "_file"-handlers are automatically removed if the root-loglevel is set higher. - - level: !env LOGLEVEL_ROOT, DEBUG - handlers: - - console - - debug_file - - info_file - - warning_file - - error_file - # - email - # - logstash_udp - # - logstash_tcp - # - syslog_local6 - # - syslog_remote + level: !env LOGLEVEL_ROOT, NOTSET + handlers: !env LOG_HANDLERS, "console|debug_file|info_file|warning_file|error_file" diff --git a/tests/test_logconfig.py b/tests/test_logconfig.py index c414967..243f2c6 100644 --- a/tests/test_logconfig.py +++ b/tests/test_logconfig.py @@ -24,7 +24,7 @@ def test_initialize_non_logging_yml(tmpdir): from libranet_logging.logconfig import initialize - non_logging_yml = tmpdir / "logging.yml" + non_logging_yml = tmpdir / "logging.yaml" with pytest.raises(SystemExit) as excinfo: initialize(non_logging_yml) expected_msg = f"\nThe configfile {non_logging_yml} does not exist.\n" @@ -42,7 +42,7 @@ def test_initialize_no_path(): def test_initialize_with_invalid_yaml(tests_dir): from libranet_logging.logconfig import initialize - logging_yml = tests_dir / "logging_invalid_yaml.yml" + logging_yml = tests_dir / "logging_invalid_yaml.yaml" with pytest.raises(SystemExit) as excinfo: initialize(logging_yml) assert excinfo.value.code.startswith("Failed to load yml-file") @@ -52,7 +52,7 @@ def test_initialize_with_invalid_yaml2(tests_dir): from libranet_logging.logconfig import initialize from libranet_logging.validate import CerberusValidationError - logging_yml = tests_dir / "logging_invalid_schema.yml" + logging_yml = tests_dir / "logging_invalid_schema.yaml" with pytest.raises(CerberusValidationError) as excinfo: initialize(logging_yml) @@ -68,7 +68,7 @@ def test_initialize_with_invalid_yaml2(tests_dir): def test_initialize_with_valid_yaml(env, tests_dir): from libranet_logging.logconfig import initialize - logging_yml = tests_dir / "logging_valid.yml" + logging_yml = tests_dir / "logging_valid.yaml" initialize(logging_yml) expected = ["console", "debug_file", "info_file", "warning_file", "error_file"] assert [x.get_name() for x in logging.root.handlers] == expected @@ -79,7 +79,7 @@ def test_initialize_with_non_existing_logdir(monkeypatch, tests_dir, tmpdir): monkeypatch.delenv("LOG_DIR") monkeypatch.setenv("HOME", str(tmpdir)) - logging_yml = tests_dir / "logging_valid.yml" + logging_yml = tests_dir / "logging_valid.yaml" initialize(logging_yml, logdir=tmpdir / "log_non_default") assert (tmpdir / "log_non_default").exists() @@ -91,7 +91,7 @@ def test_initialize_with_conflicting_logdir(monkeypatch, tests_dir, tmpdir): monkeypatch.setenv("HOME", str(tmpdir)) log_file = tmpdir.join("logs") log_file.write("content") - logging_yml = tests_dir / "logging_valid.yml" + logging_yml = tests_dir / "logging_valid.yaml" with pytest.raises(OSError): initialize(logging_yml, logdir=tmpdir / "logs") assert (tmpdir / "logs").exists() @@ -102,7 +102,7 @@ def test_initialize_with_conflicting_logdir(monkeypatch, tests_dir, tmpdir): # from libranet_logging.logconfig import initialize # monkeypatch.delenv("TERM") -# logging_yml = tests_dir / "logging_valid.yml" +# logging_yml = tests_dir / "logging_valid.yaml" # initialize(logging_yml) # expected = [ # "console", @@ -118,7 +118,7 @@ def test_initialize_with_logging_tree(capsys, env, monkeypatch, tests_dir): from libranet_logging.logconfig import initialize monkeypatch.setenv("PYTHON_ENABLE_LOGGING_TREE", "1") - logging_yml = tests_dir / "logging_valid.yml" + logging_yml = tests_dir / "logging_valid.yaml" initialize(logging_yml) out, err = capsys.readouterr() @@ -139,7 +139,7 @@ def test_initialize_without_logging_tree(capsys, env, monkeypatch, tests_dir): from libranet_logging.logconfig import initialize monkeypatch.delenv("PYTHON_ENABLE_LOGGING_TREE", raising=False) - logging_yml = tests_dir / "logging_valid.yml" + logging_yml = tests_dir / "logging_valid.yaml" initialize(logging_yml) out, err = capsys.readouterr() diff --git a/tests/test_yaml.py b/tests/test_yaml.py index 07c1869..fa8a29e 100644 --- a/tests/test_yaml.py +++ b/tests/test_yaml.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # pylint: disable=import-outside-toplevel # pylint: disable=missing-function-docstring """Testing of module libranet_logging.yaml.""" @@ -11,7 +10,7 @@ def test_read_yaml(env, monkeypatch, tests_dir): monkeypatch.setenv("SMTP_FROM", "test@example.com") monkeypatch.setenv("SMTP_TO", "xxx@example.com|yyy@example.com") - existing_yaml_path = tests_dir / "logging_email_substitution.yml" + existing_yaml_path = tests_dir / "logging_email_substitution.yaml" data = read_yaml(existing_yaml_path) email = data["handlers"]["email"] @@ -27,7 +26,7 @@ def test_read_yaml_unset_envvar(env, monkeypatch, tests_dir): monkeypatch.delenv("SMTP_FROM", raising=False) monkeypatch.delenv("SMTP_TO", raising=False) - existing_yaml_path = tests_dir / "logging_email_substitution.yml" + existing_yaml_path = tests_dir / "logging_email_substitution.yaml" data = read_yaml(existing_yaml_path) email = data["handlers"]["email"]