From c128485285b405e5db4ca1d3569e2a8f8916da52 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 7 Jul 2024 02:01:41 +0800 Subject: [PATCH 1/2] fix: Invalid concurrentProcessing return type Fixes #136 Signed-off-by: AlexNg --- src/thread/thread.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/thread/thread.py b/src/thread/thread.py index d531788..b05d98b 100644 --- a/src/thread/thread.py +++ b/src/thread/thread.py @@ -529,7 +529,7 @@ def wrapper( *args: _Target_P.args, **kwargs: _Target_P.kwargs, ) -> List[_Target_T]: - computed: List[Data_Out] = [] + computed: List[_Target_T] = [] i = 0 for data_entry in data_chunk: @@ -547,7 +547,7 @@ def wrapper( return wrapper @property - def results(self) -> List[_Dataset_T]: + def results(self) -> List[_Target_T]: """ The return value of the threads if completed @@ -560,7 +560,7 @@ def results(self) -> List[_Dataset_T]: if len(self._threads) == 0: raise exceptions.ThreadNotInitializedError() - results: List[Data_Out] = [] + results: List[_Target_T] = [] for entry in self._threads: results += entry.thread.result return results @@ -577,7 +577,7 @@ def is_alive(self) -> bool: raise exceptions.ThreadNotInitializedError() return any(entry.thread.is_alive() for entry in self._threads) - def get_return_values(self) -> List[_Dataset_T]: + def get_return_values(self) -> List[_Target_T]: """ Halts the current thread execution until the thread completes @@ -585,7 +585,7 @@ def get_return_values(self) -> List[_Dataset_T]: ------- :returns Any: The return value of the target function """ - results: List[Data_Out] = [] + results: List[_Target_T] = [] for entry in self._threads: entry.thread.join() results += entry.thread.result From 5e4faf57e53b33bcc535df84c975e6cd1981941d Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 7 Jul 2024 02:02:38 +0800 Subject: [PATCH 2/2] chore(ver): bump version from 2.0.3 to 2.0.4 --- CITATION.cff | 10 +++++----- docs/src/pages/_meta.json | 2 +- docs/src/pages/docs/_meta.json | 2 +- docs/src/pages/docs/index.mdx | 13 ++++++++++++- docs/src/pages/docs/latest/index.mdx | 4 ++-- docs/src/pages/index.mdx | 4 ++-- docs/theme.config.tsx | 4 ++-- pyproject.toml | 4 ++-- src/thread/__init__.py | 2 +- 9 files changed, 28 insertions(+), 17 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index f11cdea..83e9aca 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,11 +9,11 @@ identifiers: value: 10.5281/zenodo.10799219 description: This is the collection of archived snapshots of all versions of thread. - type: url - value: https://github.com/python-thread/thread/releases/tag/v2.0.3 - description: The GitHub release URL of tag v2.0.3. + value: https://github.com/python-thread/thread/releases/tag/v2.0.4 + description: The GitHub release URL of tag v2.0.4. - type: url - value: https://pypi.org/project/thread/2.0.3 - description: The PyPI release URL of tag v2.0.3. + value: https://pypi.org/project/thread/2.0.4 + description: The PyPI release URL of tag v2.0.4. cff-version: 1.2.0 date-released: 2024-03-07 keywords: @@ -32,5 +32,5 @@ repository-code: https://github.com/python-thread/thread repository-artifact: https://pypi.org/project/thread title: thread type: software -version: 2.0.3 +version: 2.0.4 url: https://thread.ngjx.org diff --git a/docs/src/pages/_meta.json b/docs/src/pages/_meta.json index cc8c666..7484219 100644 --- a/docs/src/pages/_meta.json +++ b/docs/src/pages/_meta.json @@ -15,7 +15,7 @@ "type": "menu", "items": { "latest-release": { - "title": "2.0.3 Latest Release", + "title": "2.0.4 Latest Release", "href": "/docs/latest" }, "v1-release": { diff --git a/docs/src/pages/docs/_meta.json b/docs/src/pages/docs/_meta.json index da15b0e..37390d8 100644 --- a/docs/src/pages/docs/_meta.json +++ b/docs/src/pages/docs/_meta.json @@ -10,6 +10,6 @@ "timestamp": false } }, - "latest": "v2.0.3 Latest", + "latest": "v2.0.4 Latest", "v1": "v1.1.1" } diff --git a/docs/src/pages/docs/index.mdx b/docs/src/pages/docs/index.mdx index c8411b1..cc0800a 100644 --- a/docs/src/pages/docs/index.mdx +++ b/docs/src/pages/docs/index.mdx @@ -69,7 +69,7 @@ This is a list of all the available releases. >
- Latest v2.0.3 + Latest v2.0.4
This is the latest ***stable*** release. @@ -110,6 +110,17 @@ This is a list of all the available releases. dev + +
+

Release v2.0.4

+

7 July 2024

+
+ stable + +You are viewing the documentation for the `v2.0.4` release.
This is the most recent stable release of `thread`. ## Quick Start diff --git a/docs/src/pages/index.mdx b/docs/src/pages/index.mdx index c604bec..7a862e7 100644 --- a/docs/src/pages/index.mdx +++ b/docs/src/pages/index.mdx @@ -1,5 +1,5 @@ --- -title: Thread v2.0.3 +title: Thread v2.0.4 --- import Link from "next/link"; @@ -71,7 +71,7 @@ export function Feature({ Thread -  - v2.0.3 +  - v2.0.4
diff --git a/docs/theme.config.tsx b/docs/theme.config.tsx index 09eaa15..64719ef 100644 --- a/docs/theme.config.tsx +++ b/docs/theme.config.tsx @@ -50,7 +50,7 @@ const Head = () => { const { route } = useRouter(); const pageTitle = - route === "/" || !title ? "Thread v2.0.3" : `${title} | Thread v2.0.3`; + route === "/" || !title ? "Thread v2.0.4" : `${title} | Thread v2.0.4`; const socialImage = "https://thread.ngjx.org/socialcard-white.jpg"; return ( @@ -125,7 +125,7 @@ const config: DocsThemeConfig = { const { asPath } = useRouter(); if (asPath !== "/") { return { - titleTemplate: "%s | Thread v2.0.3", + titleTemplate: "%s | Thread v2.0.4", }; } }, diff --git a/pyproject.toml b/pyproject.toml index 3d891ac..f7dc33a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "thread" -version = "2.0.3" +version = "2.0.4" description = "Threading module extension" authors = ["Alex "] license = "BSD-3-Clause" @@ -30,7 +30,7 @@ classifiers = [ [tool.poetry.urls] Homepage = "https://thread.ngjx.org" -Documentation = "https://thread.ngjx.org/docs/v2.0.3" +Documentation = "https://thread.ngjx.org/docs/v2.0.4" Source = "https://github.com/python-thread/thread" Download = "https://pypi.org/project/thread/#files" "Release Notes" = "https://github.com/python-thread/thread/releases" diff --git a/src/thread/__init__.py b/src/thread/__init__.py index 51496e7..6b92538 100644 --- a/src/thread/__init__.py +++ b/src/thread/__init__.py @@ -1,6 +1,6 @@ """ ## Thread Library -Documentation at https://thread.ngjx.org/docs/2.0.3 +Documentation at https://thread.ngjx.org/docs/2.0.4 ---