From c2e1c650664281826c9dc08aa86053939f5469bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:18:42 +0100 Subject: [PATCH 01/33] Bump pytest from 7.4.0 to 8.0.0 (#1073) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 8.0.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...8.0.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3f1ebc023..a4b100591 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ "tox==4.11.0 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", - "pytest==7.4.0 ; python_version>='3.8'", + "pytest==8.0.0 ; python_version>='3.8'", "pytest-cov==2.12.1 ; python_version<'3.8'", "pytest-cov==4.1.0 ; python_version>='3.8'", "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", From 49b5c29c68b1e72acdd60de322d052ffa148a7e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:19:12 +0100 Subject: [PATCH 02/33] Bump tox from 4.11.0 to 4.12.1 (#1074) Bumps [tox](https://github.com/tox-dev/tox) from 4.11.0 to 4.12.1. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.11.0...4.12.1) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a4b100591..421a39a80 100644 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ # Setup. "pre-commit==3.6.0 ; python_version>='3.9'", "tox==3.27.1 ; python_version<'3.8'", - "tox==4.11.0 ; python_version>='3.8'", + "tox==4.12.1 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", "pytest==8.0.0 ; python_version>='3.8'", From af6a310f69f0178e851229ad61eab1e8a41f9d12 Mon Sep 17 00:00:00 2001 From: Delgan <4193924+Delgan@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:24:06 +0100 Subject: [PATCH 03/33] Update "showwarning" example to preserve location (#1076) --- docs/resources/recipes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/recipes.rst b/docs/resources/recipes.rst index a2648e4ac..d82202322 100644 --- a/docs/resources/recipes.rst +++ b/docs/resources/recipes.rst @@ -815,7 +815,7 @@ You may also capture warnings emitted by your application by replacing |warnings showwarning_ = warnings.showwarning def showwarning(message, *args, **kwargs): - logger.warning(message) + logger.opt(depth=2).warning(message) showwarning_(message, *args, **kwargs) warnings.showwarning = showwarning From c1f46bb88aae11b77a1a7a981fb11b967a36e28e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:47:23 +0100 Subject: [PATCH 04/33] Bump codecov/codecov-action from 3 to 4 (#1075) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9d31c567..e9f4cd076 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,7 +47,7 @@ jobs: run: | tox -e tests - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.os }}_${{ matrix.python-version }} From 4e48641f7a3b684066c0e4c0ef2b8b265abf65d7 Mon Sep 17 00:00:00 2001 From: Delgan Date: Sat, 3 Feb 2024 14:48:07 +0100 Subject: [PATCH 05/33] Bump "black" dev dependency for pre-commit --- .pre-commit-config.yaml | 2 +- docs/_extensions/autodoc_stub_file.py | 1 + loguru/__init__.py | 1 + loguru/_colorizer.py | 10 ++++++---- loguru/_logger.py | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93aed8652..867bbbc57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/ambv/black - rev: 23.7.0 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit diff --git a/docs/_extensions/autodoc_stub_file.py b/docs/_extensions/autodoc_stub_file.py index f277a2865..e8267be81 100644 --- a/docs/_extensions/autodoc_stub_file.py +++ b/docs/_extensions/autodoc_stub_file.py @@ -12,6 +12,7 @@ Warning: for some reason, the docs NEEDS to be re-generated for changes in the stub file to be taken into account: ``make clean && make html``. """ + import os import sys import types diff --git a/loguru/__init__.py b/loguru/__init__.py index 0e8488a5c..6570bb12a 100644 --- a/loguru/__init__.py +++ b/loguru/__init__.py @@ -3,6 +3,7 @@ Just ``from loguru import logger``. """ + import atexit as _atexit import sys as _sys diff --git a/loguru/_colorizer.py b/loguru/_colorizer.py index 18c072bd6..102d72cca 100644 --- a/loguru/_colorizer.py +++ b/loguru/_colorizer.py @@ -338,10 +338,12 @@ def colorize(self, ansi_level): def make_coloring_message(self, message, *, ansi_level, colored_message): messages = [ - message - if color_tokens is None - else AnsiParser.wrap( - colored_message.tokens, ansi_level=ansi_level, color_tokens=color_tokens + ( + message + if color_tokens is None + else AnsiParser.wrap( + colored_message.tokens, ansi_level=ansi_level, color_tokens=color_tokens + ) ) for color_tokens in self._messages_color_tokens ] diff --git a/loguru/_logger.py b/loguru/_logger.py index 2ef78c41f..cc514b083 100644 --- a/loguru/_logger.py +++ b/loguru/_logger.py @@ -82,6 +82,7 @@ .. _formatting directives: https://docs.python.org/3/library/string.html#format-string-syntax .. _reentrant: https://en.wikipedia.org/wiki/Reentrancy_(computing) """ + import builtins import contextlib import functools From b80d5d17375fd78f92a49e88754e647dc0397ab4 Mon Sep 17 00:00:00 2001 From: Delgan Date: Sat, 3 Feb 2024 14:51:39 +0100 Subject: [PATCH 06/33] Bump several dev dependencies for pre-commit --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 867bbbc57..13bdfda18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - id: check-added-large-files - repo: https://github.com/crate-ci/typos - rev: v1.16.19 + rev: v1.18.0 hooks: - id: typos - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.10.0 + rev: v2.12.0 hooks: - id: pretty-format-ini args: [--autofix] @@ -23,7 +23,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.286 + rev: v0.2.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From 9311c763bb3528f87c3c5a13a25ec7387f2cc545 Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Sat, 17 Feb 2024 11:14:22 +0000 Subject: [PATCH 07/33] Test against Python 3.12 (non-dev) and 3.13 (dev) (#1079) * Testing against Python 3.12 (non-dev) and Python 3.13 (dev) * Marking `3.13-dev` tests as failable * Fixing `test_pickling` tests for Python 3.13. The `Handler.lock` is substituted for a `nullcontext`, keeping Python 3.13 happy. A no-op stub for `Handler.release` is added, keeping all other Python versions happy. * Fixing `test_pickling` tests for Python 3.13. The `Handler.lock` is substituted for a `MockLock`, keeping Python 3.13 happy. A no-op stub for `Handler.release` is added, keeping all other Python versions happy. --- .github/workflows/tests.yml | 4 +++- loguru/_better_exceptions.py | 12 +++++++++++- setup.py | 1 + tests/test_pickling.py | 14 ++++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9f4cd076..3e235be88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,6 +9,7 @@ on: jobs: tests: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository + continue-on-error: ${{ endsWith(matrix.python-version, '-dev') }} strategy: fail-fast: false matrix: @@ -20,7 +21,8 @@ jobs: - '3.9' - '3.10' - '3.11' - - 3.12-dev + - '3.12' + - 3.13-dev - pypy-3.9 include: - os: ubuntu-20.04 diff --git a/loguru/_better_exceptions.py b/loguru/_better_exceptions.py index e751cf6eb..94610c713 100644 --- a/loguru/_better_exceptions.py +++ b/loguru/_better_exceptions.py @@ -498,7 +498,7 @@ def _format_exception( else: yield from self._indent(introduction + "\n", group_nesting) - frames_lines = traceback.format_list(frames) + exception_only + frames_lines = self._format_list(frames) + exception_only if self._colorize or self._backtrace or self._diagnose: frames_lines = self._format_locations(frames_lines, has_introduction=has_introduction) @@ -526,5 +526,15 @@ def _format_exception( if not is_exception_group(exc) or group_nesting == 10: yield from self._indent("-" * 35, group_nesting + 1, prefix="+-") + def _format_list(self, frames): + result = [] + for filename, lineno, name, line in frames: + row = [] + row.append(' File "{}", line {}, in {}\n'.format(filename, lineno, name)) + if line: + row.append(" {}\n".format(line.strip())) + result.append("".join(row)) + return result + def format_exception(self, type_, value, tb, *, from_decorator=False): yield from self._format_exception(value, tb, is_first=True, from_decorator=from_decorator) diff --git a/setup.py b/setup.py index 421a39a80..b9fc77cea 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: CPython", diff --git a/tests/test_pickling.py b/tests/test_pickling.py index 35ba88837..575ce12e9 100644 --- a/tests/test_pickling.py +++ b/tests/test_pickling.py @@ -50,11 +50,18 @@ def _stop(self): self.stopped = True +class MockLock: + def __enter__(self): + pass + + def __exit__(self, *excinfo): + pass + + class StandardHandler(logging.Handler): def __init__(self, level): super().__init__(level) self.written = "" - self.lock = None def emit(self, record): self.written += record.getMessage() @@ -62,8 +69,11 @@ def emit(self, record): def acquire(self): pass + def release(self): + pass + def createLock(self): # noqa: N802 - return None + self.lock = MockLock() def format_function(record): From 221d7e365f8983370eaf3ec9f50735d02a43733d Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Sat, 2 Mar 2024 09:27:14 +0000 Subject: [PATCH 08/33] Linking to `logot` from docs (#1085) --- docs/resources/migration.rst | 12 +++++++++++ docs/resources/recipes.rst | 39 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/docs/resources/migration.rst b/docs/resources/migration.rst index dbbd4e615..2f4044a5b 100644 --- a/docs/resources/migration.rst +++ b/docs/resources/migration.rst @@ -278,6 +278,8 @@ The |captureWarnings| function which redirects alerts from the |warnings| module warnings.showwarning = showwarning +.. _migration-assert-logs: + Replacing ``assertLogs()`` method from ``unittest`` library ----------------------------------------------------------- @@ -316,6 +318,12 @@ It provides the list of :ref:`logged messages ` for each of which you c self.assertIn("Invalid value", message) self.assertEqual(message.record["level"].name, "ERROR") +.. seealso:: + + See :ref:`testing logging ` for more information. + + +.. _migration-caplog: Replacing ``caplog`` fixture from ``pytest`` library ---------------------------------------------------- @@ -367,3 +375,7 @@ Note that if you want Loguru logs to be propagated to Pytest terminal reporter, handler_id = logger.add(logging_plugin.report_handler, format="{message}") yield logger.remove(handler_id) + +.. seealso:: + + See :ref:`testing logging ` for more information. diff --git a/docs/resources/recipes.rst b/docs/resources/recipes.rst index d82202322..26547e998 100644 --- a/docs/resources/recipes.rst +++ b/docs/resources/recipes.rst @@ -43,6 +43,12 @@ Code snippets and recipes for ``loguru`` .. |if-name-equals-main| replace:: ``if __name__ == "__main__":`` .. _if-name-equals-main: https://docs.python.org/3/library/__main__.html#idiomatic-usage +.. |logot| replace:: ``logot`` +.. _logot: https://logot.readthedocs.io/ + +.. |pytest| replace:: ``pytest`` +.. _pytest: https://docs.pytest.org/en/latest/ + .. |stackprinter| replace:: ``stackprinter`` .. _stackprinter: https://github.com/cknd/stackprinter @@ -1043,3 +1049,36 @@ Another thing to keep in mind when dealing with multiprocessing is the fact that worker = workers_a.Worker() with context.Pool(4, initializer=worker.set_logger, initargs=(logger, )) as pool: results = pool.map(worker.work, [1, 10, 100]) + + +.. _recipes-testing: + +Testing logging +--------------- + +Logging calls can be tested using |logot|_, a high-level log testing library with built-in support for Loguru:: + + from logot import Logot, logged + + def test_something(logot: Logot) -> None: + do_something() + logot.assert_logged(logged.info("Something was done")) + +Enable Loguru log capture in your |pytest|_ configuration: + +.. code:: toml + + [tool.pytest.ini_options] + logot_capturer = "logot.loguru.LoguruCapturer" + +.. seealso:: + + See `using logot with Loguru `_ for more information + about `configuring pytest `_ + and `configuring unittest `_. + +.. note:: + + When migrating an existing project from standard :mod:`logging`, it can be useful to migrate your existing test + cases too. See :ref:`migrating assertLogs() ` and :ref:`migrating caplog ` + for more information. From bd66b55094c4f431e88dd0091f2b8b84fceee624 Mon Sep 17 00:00:00 2001 From: Delgan Date: Sat, 2 Mar 2024 11:43:01 +0100 Subject: [PATCH 09/33] Document fix for "--log-cli-level" pytest compatibility (#1062) --- docs/resources/migration.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/resources/migration.rst b/docs/resources/migration.rst index 2f4044a5b..94fdc59e6 100644 --- a/docs/resources/migration.rst +++ b/docs/resources/migration.rst @@ -376,6 +376,20 @@ Note that if you want Loguru logs to be propagated to Pytest terminal reporter, yield logger.remove(handler_id) +Finally, when dealing with the ``--log-cli-level`` command-line flag, remember that this option controls the standard ``logging`` logs, not ``loguru`` ones. For this reason, you must first install a ``PropagateHandler`` for compatibility:: + + @pytest.fixture(autouse=True) + def propagate_logs(): + + class PropagateHandler(logging.Handler): + def emit(self, record): + if logging.getLogger(record.name).isEnabledFor(record.levelno): + logging.getLogger(record.name).handle(record) + + logger.remove() + logger.add(PropagateHandler(), format="{message}") + yield + .. seealso:: See :ref:`testing logging ` for more information. From 29ae8f95a179fd32dd93e56cb3c5bfa7cbcc226b Mon Sep 17 00:00:00 2001 From: Delgan Date: Sat, 2 Mar 2024 12:17:43 +0100 Subject: [PATCH 10/33] Remove filtering of deprecation warnings from "dateutil" lib No longer required now that 2.9.0 was released. --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b476a545..afb571595 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,9 +12,7 @@ filterwarnings = [ # By default all warnings are treated as errors. 'error', # Mixing threads and "fork()" is deprecated, but we need to test it anyway. - 'ignore:.*use of fork\(\) may lead to deadlocks in the child.*:DeprecationWarning', - # The "dateutil" package used by "freezegun" relies on some deprecated APIs. - 'ignore:.*datetime\.datetime\.utcfromtimestamp\(\) is deprecated.*:DeprecationWarning:dateutil.tz.tz' + 'ignore:.*use of fork\(\) may lead to deadlocks in the child.*:DeprecationWarning' ] testpaths = ["tests"] From 7a3878b1466fcebc967388b567efc796a6dcbd12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:33:44 +0100 Subject: [PATCH 11/33] Bump pytest-mypy-plugins from 3.0.0 to 3.1.0 (#1096) Bumps [pytest-mypy-plugins](https://github.com/TypedDjango/pytest-mypy-plugins) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/TypedDjango/pytest-mypy-plugins/releases) - [Changelog](https://github.com/typeddjango/pytest-mypy-plugins/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypedDjango/pytest-mypy-plugins/compare/3.0.0...3.1.0) --- updated-dependencies: - dependency-name: pytest-mypy-plugins dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b9fc77cea..2c78f24f3 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ "pytest-cov==2.12.1 ; python_version<'3.8'", "pytest-cov==4.1.0 ; python_version>='3.8'", "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", - "pytest-mypy-plugins==3.0.0 ; python_version>='3.8'", + "pytest-mypy-plugins==3.1.0 ; python_version>='3.8'", # Testing utils. "colorama==0.4.5 ; python_version<'3.8'", "colorama==0.4.6 ; python_version>='3.8'", From cd76d95870b83d76287e0e20b474ed08cd3e62ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:34:10 +0100 Subject: [PATCH 12/33] Bump tox from 4.12.1 to 4.13.0 (#1094) Bumps [tox](https://github.com/tox-dev/tox) from 4.12.1 to 4.13.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.12.1...4.13.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2c78f24f3..e3ff0785c 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ # Setup. "pre-commit==3.6.0 ; python_version>='3.9'", "tox==3.27.1 ; python_version<'3.8'", - "tox==4.12.1 ; python_version>='3.8'", + "tox==4.13.0 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", "pytest==8.0.0 ; python_version>='3.8'", From 70e9df2d5d8cd86873456cd88cc45411681aefa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:34:55 +0100 Subject: [PATCH 13/33] Bump sphinx-autobuild from 2021.3.14 to 2024.2.4 (#1095) Bumps [sphinx-autobuild](https://github.com/sphinx-doc/sphinx-autobuild) from 2021.3.14 to 2024.2.4. - [Release notes](https://github.com/sphinx-doc/sphinx-autobuild/releases) - [Changelog](https://github.com/sphinx-doc/sphinx-autobuild/blob/main/NEWS.rst) - [Commits](https://github.com/sphinx-doc/sphinx-autobuild/compare/2021.03.14...2024.02.04) --- updated-dependencies: - dependency-name: sphinx-autobuild dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e3ff0785c..f4dba58b5 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ "mypy==v1.8.0 ; python_version>='3.8'", # Docs. "Sphinx==7.2.5 ; python_version>='3.9'", - "sphinx-autobuild==2021.3.14 ; python_version>='3.9'", + "sphinx-autobuild==2024.2.4 ; python_version>='3.9'", "sphinx-rtd-theme==2.0.0 ; python_version>='3.9'", ] }, From d296350c6ebc6aacb14b49b81f5eab52c74c9276 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:25:26 +0200 Subject: [PATCH 14/33] Bump pre-commit from 3.6.0 to 3.7.0 (#1113) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.6.0 to 3.7.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.7.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f4dba58b5..b61cbd134 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ extras_require={ "dev": [ # Setup. - "pre-commit==3.6.0 ; python_version>='3.9'", + "pre-commit==3.7.0 ; python_version>='3.9'", "tox==3.27.1 ; python_version<'3.8'", "tox==4.13.0 ; python_version>='3.8'", # Testing framework. From 406bea8b0824b242b207d6eba206d00270510166 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:36:08 +0200 Subject: [PATCH 15/33] Bump pytest-cov from 4.1.0 to 5.0.0 (#1115) Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.1.0 to 5.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v4.1.0...v5.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b61cbd134..b25620f81 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ "pytest==6.1.2 ; python_version<'3.8'", "pytest==8.0.0 ; python_version>='3.8'", "pytest-cov==2.12.1 ; python_version<'3.8'", - "pytest-cov==4.1.0 ; python_version>='3.8'", + "pytest-cov==5.0.0 ; python_version>='3.8'", "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", "pytest-mypy-plugins==3.1.0 ; python_version>='3.8'", # Testing utils. From 3466843dacba206ed677811665afbc0e7f340872 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:36:16 +0200 Subject: [PATCH 16/33] Bump pytest from 8.0.0 to 8.1.1 (#1116) Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.0 to 8.1.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.0.0...8.1.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b25620f81..5b92ffc2e 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ "tox==4.13.0 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", - "pytest==8.0.0 ; python_version>='3.8'", + "pytest==8.1.1 ; python_version>='3.8'", "pytest-cov==2.12.1 ; python_version<'3.8'", "pytest-cov==5.0.0 ; python_version>='3.8'", "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", From 712dbadc41fa181b0d38ac19fcd70be7403a4749 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:36:24 +0200 Subject: [PATCH 17/33] Bump mypy from v1.8.0 to 1.9.0 (#1117) Bumps [mypy](https://github.com/python/mypy) from v1.8.0 to 1.9.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.8.0...1.9.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5b92ffc2e..0051819aa 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ "mypy==v0.910 ; python_version<'3.6'", "mypy==v0.971 ; python_version>='3.6' and python_version<'3.7'", "mypy==v1.4.1 ; python_version>='3.7' and python_version<'3.8'", - "mypy==v1.8.0 ; python_version>='3.8'", + "mypy==v1.9.0 ; python_version>='3.8'", # Docs. "Sphinx==7.2.5 ; python_version>='3.9'", "sphinx-autobuild==2024.2.4 ; python_version>='3.9'", From 2ba868ce403b8f7fe0d387286ff43d20ec94fc37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:36:32 +0200 Subject: [PATCH 18/33] Bump tox from 4.13.0 to 4.14.2 (#1114) Bumps [tox](https://github.com/tox-dev/tox) from 4.13.0 to 4.14.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.13.0...4.14.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0051819aa..06ae87782 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ # Setup. "pre-commit==3.7.0 ; python_version>='3.9'", "tox==3.27.1 ; python_version<'3.8'", - "tox==4.13.0 ; python_version>='3.8'", + "tox==4.14.2 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", "pytest==8.1.1 ; python_version>='3.8'", From 69ace6b081d7dab7b61dc91c2443f4960e61ceaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 14:47:34 +0200 Subject: [PATCH 19/33] Bump sphinx-autobuild from 2024.2.4 to 2024.4.16 (#1129) Bumps [sphinx-autobuild](https://github.com/sphinx-doc/sphinx-autobuild) from 2024.2.4 to 2024.4.16. - [Release notes](https://github.com/sphinx-doc/sphinx-autobuild/releases) - [Changelog](https://github.com/sphinx-doc/sphinx-autobuild/blob/main/NEWS.rst) - [Commits](https://github.com/sphinx-doc/sphinx-autobuild/compare/2024.02.04...2024.04.16) --- updated-dependencies: - dependency-name: sphinx-autobuild dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 06ae87782..d790af254 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ "mypy==v1.9.0 ; python_version>='3.8'", # Docs. "Sphinx==7.2.5 ; python_version>='3.9'", - "sphinx-autobuild==2024.2.4 ; python_version>='3.9'", + "sphinx-autobuild==2024.4.16 ; python_version>='3.9'", "sphinx-rtd-theme==2.0.0 ; python_version>='3.9'", ] }, From 35fdc9a4d9930d1134259a33425591f444bbef45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 14:48:14 +0200 Subject: [PATCH 20/33] Bump freezegun from 1.4.0 to 1.5.0 (#1131) Bumps [freezegun](https://github.com/spulec/freezegun) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/spulec/freezegun/releases) - [Changelog](https://github.com/spulec/freezegun/blob/master/CHANGELOG) - [Commits](https://github.com/spulec/freezegun/compare/1.4.0...1.5.0) --- updated-dependencies: - dependency-name: freezegun dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d790af254..13c104486 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ "colorama==0.4.5 ; python_version<'3.8'", "colorama==0.4.6 ; python_version>='3.8'", "freezegun==1.1.0 ; python_version<'3.8'", - "freezegun==1.4.0 ; python_version>='3.8'", + "freezegun==1.5.0 ; python_version>='3.8'", "exceptiongroup==1.1.3 ; python_version>='3.7' and python_version<'3.11'", # Type checking. "mypy==v0.910 ; python_version<'3.6'", From 2d0f25e6396697d190a63ce39a6f566e452036f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 15:06:24 +0200 Subject: [PATCH 21/33] Bump sphinx from 7.2.5 to 7.3.7 (#1130) Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.5 to 7.3.7. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.5...v7.3.7) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 13c104486..277a50b55 100644 --- a/setup.py +++ b/setup.py @@ -82,7 +82,7 @@ "mypy==v1.4.1 ; python_version>='3.7' and python_version<'3.8'", "mypy==v1.9.0 ; python_version>='3.8'", # Docs. - "Sphinx==7.2.5 ; python_version>='3.9'", + "Sphinx==7.3.7 ; python_version>='3.9'", "sphinx-autobuild==2024.4.16 ; python_version>='3.9'", "sphinx-rtd-theme==2.0.0 ; python_version>='3.9'", ] From c1c6184c5a2e755116adceb6358074dbb6944878 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 17:46:55 +0200 Subject: [PATCH 22/33] Bump mypy from v1.9.0 to 1.10.0 (#1132) Bumps [mypy](https://github.com/python/mypy) from v1.9.0 to 1.10.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 277a50b55..a77da39a6 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ "mypy==v0.910 ; python_version<'3.6'", "mypy==v0.971 ; python_version>='3.6' and python_version<'3.7'", "mypy==v1.4.1 ; python_version>='3.7' and python_version<'3.8'", - "mypy==v1.9.0 ; python_version>='3.8'", + "mypy==v1.10.0 ; python_version>='3.8'", # Docs. "Sphinx==7.3.7 ; python_version>='3.9'", "sphinx-autobuild==2024.4.16 ; python_version>='3.9'", From 7273a5eba32b08063d1426f8f022e4734d87afbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 17:47:18 +0200 Subject: [PATCH 23/33] Bump tox from 4.14.2 to 4.15.0 (#1133) Bumps [tox](https://github.com/tox-dev/tox) from 4.14.2 to 4.15.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.14.2...4.15.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a77da39a6..11ea51fd7 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ # Setup. "pre-commit==3.7.0 ; python_version>='3.9'", "tox==3.27.1 ; python_version<'3.8'", - "tox==4.14.2 ; python_version>='3.8'", + "tox==4.15.0 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", "pytest==8.1.1 ; python_version>='3.8'", From 981e38b6ee42c40244f61c93ef7fc5e2250fc2a0 Mon Sep 17 00:00:00 2001 From: Delgan Date: Thu, 16 May 2024 14:33:35 +0200 Subject: [PATCH 24/33] Fix failure of Github CI for Python 3.5 See https://github.com/actions/setup-python/issues/866 --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e235be88..151d331dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,8 @@ jobs: include: - os: ubuntu-20.04 python-version: '3.5' + # Temporary fix for https://github.com/actions/setup-python/issues/866 + env: PIP_TRUSTED_HOST="pypi.python.org pypi.org files.pythonhosted.org" - os: ubuntu-20.04 python-version: '3.6' - os: windows-2022 From f96d9c6d512132dcc144812e13ff06c9f32483a2 Mon Sep 17 00:00:00 2001 From: Delgan Date: Thu, 16 May 2024 14:40:39 +0200 Subject: [PATCH 25/33] Actually fix Github CI for Python 3.5 Previous commit didn't make it. See https://github.com/actions/setup-python/issues/866 --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 151d331dd..68fb23b9a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,10 @@ on: schedule: - cron: 0 0 * * 0 +# Temporary workaround for https://github.com/actions/setup-python/issues/866 +env: + PIP_TRUSTED_HOST: pypi.python.org pypi.org files.pythonhosted.org + jobs: tests: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository @@ -27,8 +31,6 @@ jobs: include: - os: ubuntu-20.04 python-version: '3.5' - # Temporary fix for https://github.com/actions/setup-python/issues/866 - env: PIP_TRUSTED_HOST="pypi.python.org pypi.org files.pythonhosted.org" - os: ubuntu-20.04 python-version: '3.6' - os: windows-2022 From 87e1c6e81bdc95e02fd0d4e71ad645166d0c0019 Mon Sep 17 00:00:00 2001 From: Delgan Date: Thu, 16 May 2024 15:03:34 +0200 Subject: [PATCH 26/33] Fix Github CI for Python 3.13 See https://github.com/crate-py/rpds/issues/72 Unfortunately, setting PYO3_USE_ABI3_FORWARD_COMPATIBILITY and UNSAFE_PYO3_SKIP_VERSION_CHECK changed nothing, so the tests have been disabled. --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68fb23b9a..3dc55e93f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,8 +6,8 @@ on: schedule: - cron: 0 0 * * 0 -# Temporary workaround for https://github.com/actions/setup-python/issues/866 env: + # Temporary workaround for https://github.com/actions/setup-python/issues/866 PIP_TRUSTED_HOST: pypi.python.org pypi.org files.pythonhosted.org jobs: @@ -26,7 +26,8 @@ jobs: - '3.10' - '3.11' - '3.12' - - 3.13-dev + # Temporary disabled because of https://github.com/crate-py/rpds/issues/72 + # - 3.13-dev - pypy-3.9 include: - os: ubuntu-20.04 From be0828877fe8068c849f65ed2542f73245068452 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Fri, 17 May 2024 00:07:47 +0800 Subject: [PATCH 27/33] Add pre-commit hook to normalize line ending (#1142) --- .pre-commit-config.yaml | 7 ++ docs/_static/img/sadhu.svg | 140 ++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 70 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13bdfda18..262735d2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - id: check-added-large-files + - id: mixed-line-ending + args: [--fix=lf] + exclude_types: [batch] + - id: mixed-line-ending + args: [--fix=crlf] + types: [batch] + - repo: https://github.com/crate-ci/typos rev: v1.18.0 hooks: diff --git a/docs/_static/img/sadhu.svg b/docs/_static/img/sadhu.svg index 66a66fb6b..33821a7ab 100644 --- a/docs/_static/img/sadhu.svg +++ b/docs/_static/img/sadhu.svg @@ -1,71 +1,71 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 30ee26aa4091548b8fade46f7c60b78fd2db3923 Mon Sep 17 00:00:00 2001 From: Delgan Date: Fri, 17 May 2024 08:02:04 +0200 Subject: [PATCH 28/33] Remove unneeded .bat file Docs are built on Linux. --- .pre-commit-config.yaml | 5 ----- docs/make.bat | 36 ------------------------------------ 2 files changed, 41 deletions(-) delete mode 100644 docs/make.bat diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 262735d2f..54866927b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,6 @@ repos: - id: check-added-large-files - id: mixed-line-ending args: [--fix=lf] - exclude_types: [batch] - - id: mixed-line-ending - args: [--fix=crlf] - types: [batch] - - repo: https://github.com/crate-ci/typos rev: v1.18.0 hooks: diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 8a28944ac..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=loguru - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd From cf7d2df80a7c685ff53ec962449a23a0d3fed28f Mon Sep 17 00:00:00 2001 From: Trim21 Date: Sat, 1 Jun 2024 23:52:19 +0800 Subject: [PATCH 29/33] Add Pypi release workflow to CI (#1146) --- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..9c4babf8e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.x + + - run: pipx run build + + - run: twine check --strict dist/* + + - run: pipx run twine upload dist/* --disable-progress-bar + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} From 19198317a321f8c30df247e3baa15a6a93994d8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:52:36 +0200 Subject: [PATCH 30/33] Bump pytest from 8.1.1 to 8.2.1 (#1147) Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11ea51fd7..de086831c 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ "tox==4.15.0 ; python_version>='3.8'", # Testing framework. "pytest==6.1.2 ; python_version<'3.8'", - "pytest==8.1.1 ; python_version>='3.8'", + "pytest==8.2.1 ; python_version>='3.8'", "pytest-cov==2.12.1 ; python_version<'3.8'", "pytest-cov==5.0.0 ; python_version>='3.8'", "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", From 6af1cafaa258c5337cafd249f0f81730cba3e8f0 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Sun, 2 Jun 2024 00:11:04 +0800 Subject: [PATCH 31/33] Replace "setup.py" with "pyproject.toml" for builds (#1140) See PEP 517 and PEP 631. --- MANIFEST.in | 2 -- pyproject.toml | 81 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 91 -------------------------------------------------- tox.ini | 1 + 4 files changed, 82 insertions(+), 93 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index ee0a39f23..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include LICENSE -recursive-include tests *.py *.txt *.yml diff --git a/pyproject.toml b/pyproject.toml index afb571595..76b76210c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,89 @@ +[build-system] +build-backend = "flit_core.buildapi" +requires = ["flit_core>=3,<4"] + +[project] +authors = [ + {name = "Delgan", email = "delgan.py@gmail.com"} +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Topic :: System :: Logging", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python :: Implementation :: CPython" +] +dependencies = [ + "colorama>=0.3.4 ; sys_platform=='win32'", + "aiocontextvars>=0.2.0 ; python_version<'3.7'", + "win32-setctime>=1.0.0 ; sys_platform=='win32'" +] +description = "Python logging made (stupidly) simple" +dynamic = ['version'] +keywords = ["loguru", "logging", "logger", "log"] +license = {text = "MIT"} +name = "loguru" +readme = 'README.rst' +requires-python = ">=3.5,<4.0" + +[project.optional-dependencies] +dev = [ + # Setup. + "pre-commit==3.7.0 ; python_version>='3.9'", + "tox==3.27.1 ; python_version<'3.8'", + "tox==4.15.0 ; python_version>='3.8'", + # Testing framework. + "pytest==6.1.2 ; python_version<'3.8'", + "pytest==8.2.1 ; python_version>='3.8'", + "pytest-cov==2.12.1 ; python_version<'3.8'", + "pytest-cov==5.0.0 ; python_version>='3.8'", + "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", + "pytest-mypy-plugins==3.1.0 ; python_version>='3.8'", + # Testing utils. + "colorama==0.4.5 ; python_version<'3.8'", + "colorama==0.4.6 ; python_version>='3.8'", + "freezegun==1.1.0 ; python_version<'3.8'", + "freezegun==1.5.0 ; python_version>='3.8'", + "exceptiongroup==1.1.3 ; python_version>='3.7' and python_version<'3.11'", + # Type checking. + "mypy==v0.910 ; python_version<'3.6'", + "mypy==v0.971 ; python_version>='3.6' and python_version<'3.7'", + "mypy==v1.4.1 ; python_version>='3.7' and python_version<'3.8'", + "mypy==v1.10.0 ; python_version>='3.8'", + # Docs. + "Sphinx==7.3.7 ; python_version>='3.9'", + "sphinx-autobuild==2024.4.16 ; python_version>='3.9'", + "sphinx-rtd-theme==2.0.0 ; python_version>='3.9'" +] + +[project.urls] +Changelog = "https://github.com/Delgan/loguru/blob/master/CHANGELOG.rst" +Documentation = "https://loguru.readthedocs.io/en/stable/index.html" +Homepage = "https://github.com/Delgan/loguru" + [tool.black] force-exclude = "tests/exceptions/source/modern/*" line-length = 100 target-version = ["py35"] +[tool.flit.module] +name = "loguru" + [tool.mypy] strict = true diff --git a/setup.py b/setup.py deleted file mode 100644 index de086831c..000000000 --- a/setup.py +++ /dev/null @@ -1,91 +0,0 @@ -import re - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -with open("loguru/__init__.py", "r") as file: - regex_version = r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]' - version = re.search(regex_version, file.read(), re.MULTILINE).group(1) - -with open("README.rst", "rb") as file: - readme = file.read().decode("utf-8") - -setup( - name="loguru", - version=version, - packages=["loguru"], - package_data={"loguru": ["__init__.pyi", "py.typed"]}, - description="Python logging made (stupidly) simple", - long_description=readme, - long_description_content_type="text/x-rst", - author="Delgan", - author_email="delgan.py@gmail.com", - url="https://github.com/Delgan/loguru", - download_url="https://github.com/Delgan/loguru/archive/{}.tar.gz".format(version), - project_urls={ - "Changelog": "https://github.com/Delgan/loguru/blob/master/CHANGELOG.rst", - "Documentation": "https://loguru.readthedocs.io/en/stable/index.html", - }, - keywords=["loguru", "logging", "logger", "log"], - license="MIT license", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Topic :: System :: Logging", - "Intended Audience :: Developers", - "Natural Language :: English", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: Implementation :: PyPy", - "Programming Language :: Python :: Implementation :: CPython", - ], - install_requires=[ - "colorama>=0.3.4 ; sys_platform=='win32'", - "aiocontextvars>=0.2.0 ; python_version<'3.7'", - "win32-setctime>=1.0.0 ; sys_platform=='win32'", - ], - extras_require={ - "dev": [ - # Setup. - "pre-commit==3.7.0 ; python_version>='3.9'", - "tox==3.27.1 ; python_version<'3.8'", - "tox==4.15.0 ; python_version>='3.8'", - # Testing framework. - "pytest==6.1.2 ; python_version<'3.8'", - "pytest==8.2.1 ; python_version>='3.8'", - "pytest-cov==2.12.1 ; python_version<'3.8'", - "pytest-cov==5.0.0 ; python_version>='3.8'", - "pytest-mypy-plugins==1.9.3 ; python_version>='3.6' and python_version<'3.8'", - "pytest-mypy-plugins==3.1.0 ; python_version>='3.8'", - # Testing utils. - "colorama==0.4.5 ; python_version<'3.8'", - "colorama==0.4.6 ; python_version>='3.8'", - "freezegun==1.1.0 ; python_version<'3.8'", - "freezegun==1.5.0 ; python_version>='3.8'", - "exceptiongroup==1.1.3 ; python_version>='3.7' and python_version<'3.11'", - # Type checking. - "mypy==v0.910 ; python_version<'3.6'", - "mypy==v0.971 ; python_version>='3.6' and python_version<'3.7'", - "mypy==v1.4.1 ; python_version>='3.7' and python_version<'3.8'", - "mypy==v1.10.0 ; python_version>='3.8'", - # Docs. - "Sphinx==7.3.7 ; python_version>='3.9'", - "sphinx-autobuild==2024.4.16 ; python_version>='3.9'", - "sphinx-rtd-theme==2.0.0 ; python_version>='3.9'", - ] - }, - python_requires=">=3.5", -) diff --git a/tox.ini b/tox.ini index 4caea782f..5ebb350af 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] envlist = lint, tests, docs +isolated_build = True [testenv] setenv = PYTHONPATH = {toxinidir} From 318ab29fe5a903ee9f0f4f4f5562b4dd9d0e690b Mon Sep 17 00:00:00 2001 From: Delgan Date: Sun, 23 Jun 2024 09:26:37 +0200 Subject: [PATCH 32/33] Reduce scope of 'PIP_TRUSTED_HOST' workaround in Github workflows --- .github/workflows/tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3dc55e93f..5ee2618a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,10 +6,6 @@ on: schedule: - cron: 0 0 * * 0 -env: - # Temporary workaround for https://github.com/actions/setup-python/issues/866 - PIP_TRUSTED_HOST: pypi.python.org pypi.org files.pythonhosted.org - jobs: tests: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository @@ -46,6 +42,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + env: + # Workaround for https://github.com/actions/setup-python/issues/866 + PIP_TRUSTED_HOST: pypi.python.org pypi.org files.pythonhosted.org - name: Install dependencies run: | python -m pip install --upgrade pip From 1922f716691536bfffbe5ac6ccea4ae05887980b Mon Sep 17 00:00:00 2001 From: Delgan Date: Mon, 8 Jul 2024 22:38:58 +0200 Subject: [PATCH 33/33] Fix CI build failing due to unsupported MacOS version --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ee2618a5..047a26f82 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,9 +31,9 @@ jobs: - os: ubuntu-20.04 python-version: '3.6' - os: windows-2022 - python-version: '3.11' - - os: macos-11 - python-version: '3.11' + python-version: '3.12' + - os: macos-13 + python-version: '3.12' runs-on: ${{ matrix.os }} steps: - name: Checkout repository