diff --git a/.editorconfig b/.editorconfig index 3cffdea..9095826 100644 --- a/.editorconfig +++ b/.editorconfig @@ -48,4 +48,4 @@ insert_final_newline = true indent_size = 2 [*.html] -insert_final_newline = true \ No newline at end of file +insert_final_newline = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f64388..c04822e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-toml @@ -13,7 +13,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.5.1 + rev: v0.7.0 hooks: - id: ruff args: ["--fix"] diff --git a/asyncz/tasks/base.py b/asyncz/tasks/base.py index a586935..82a9144 100644 --- a/asyncz/tasks/base.py +++ b/asyncz/tasks/base.py @@ -114,11 +114,7 @@ def update_task( # type: ignore else: raise TypeError("fn must be a callable or a textual reference to a callable.") - if ( - fn is not None - and not getattr(self, "name", None) - and updates.get("name", None) is None - ): + if fn is not None and not getattr(self, "name", None) and updates.get("name") is None: updates["name"] = get_callable_name(cast(Callable[..., Any], fn)) if isinstance(args, str) or not isinstance(args, Iterable): diff --git a/docs/events.md b/docs/events.md index 191ce2d..efb830a 100644 --- a/docs/events.md +++ b/docs/events.md @@ -43,4 +43,4 @@ Event relared to the running of a task within the executor. * **scheduled_run_times** - The time when the task was scheduled to be run. * **return_value** - The return value of the task successfully executed. * **exception** - The exception raised by the task. -* **traceback** - A formated traceback for the exception. \ No newline at end of file +* **traceback** - A formated traceback for the exception. diff --git a/docs/overrides/nav.html b/docs/overrides/nav.html index d6744c6..068800a 100644 --- a/docs/overrides/nav.html +++ b/docs/overrides/nav.html @@ -51,4 +51,4 @@ {% endcomment %} - {% extends "base.html" %} \ No newline at end of file + {% extends "base.html" %} diff --git a/docs/triggers.md b/docs/triggers.md index 2384408..5f4d233 100644 --- a/docs/triggers.md +++ b/docs/triggers.md @@ -101,7 +101,7 @@ Use the `start_at` and `end_at` to provide a limit in which the scheduler should {!> ../docs_src/triggers/interval/example2.py !} ``` -What about using the `scheduled_task` decorator? +What about using `add_task` as decorator? ```python hl_lines="8" {!> ../docs_src/triggers/interval/example3.py !} @@ -246,7 +246,7 @@ Use the `start_at` and `end_at` to provide a limit in which the scheduler should {!> ../docs_src/triggers/cron/example2.py !} ``` -What about using the `scheduled_task` decorator? +What about using `add_task` as decorator? ```python hl_lines="7" {!> ../docs_src/triggers/cron/example3.py !} diff --git a/docs_src/triggers/cron/example3.py b/docs_src/triggers/cron/example3.py index 59ee7d7..5c3181a 100644 --- a/docs_src/triggers/cron/example3.py +++ b/docs_src/triggers/cron/example3.py @@ -5,7 +5,7 @@ scheduler = AsyncIOScheduler() -@scheduler.scheduled_task("cron", hours=1, id="my_task_id", day="last sat") +@scheduler.add_task("cron", hours=1, id="my_task_id", day="last sat") def my_task(): logger.info("My task working") diff --git a/docs_src/triggers/interval/example3.py b/docs_src/triggers/interval/example3.py index 65828bb..51b349e 100644 --- a/docs_src/triggers/interval/example3.py +++ b/docs_src/triggers/interval/example3.py @@ -6,7 +6,7 @@ # Run every 5 hours -@scheduler.scheduled_task("interval", hours=5, id="my_task_id") +@scheduler.add_task("interval", hours=5, id="my_task_id") def my_task(): logger.info("My task working") diff --git a/pyproject.toml b/pyproject.toml index c8e73f2..0ca742e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ Source = "https://github.com/dymmond/asyncz" [tool.hatch.envs.default] -dependencies = ["pre-commit>=2.17.0,<3.0.0", "ipdb", "types-tzlocal"] +dependencies = ["pre-commit>=3.0.0,<5.0.0", "ipdb", "types-tzlocal"] [project.optional-dependencies] localtime=["tzlocal"] @@ -151,7 +151,7 @@ line-length=99 select = ["E", "W", "F", "C", "B", "I", "UP", "SIM"] ignore = ["E501", "B008", "C901", "B026"] -exclude = ["docs_src/*"] +exclude = ["docs_src/*", ".pdbrc"] [tool.ruff.lint.isort] known-third-party = ["esmerald", "pydantic", "starlette"] diff --git a/vendors/apscheduler/LICENSE b/vendors/apscheduler/LICENSE index b9ef562..238c0d3 100644 --- a/vendors/apscheduler/LICENSE +++ b/vendors/apscheduler/LICENSE @@ -17,4 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendors/notes.txt b/vendors/notes.txt index a39c904..8aa6aff 100644 --- a/vendors/notes.txt +++ b/vendors/notes.txt @@ -1 +1 @@ -All the vendors notes go in this folder. \ No newline at end of file +All the vendors notes go in this folder.