From 70bfc0a33166883f8766737dc29bef14f5d595e7 Mon Sep 17 00:00:00 2001 From: Aatman Vaidya Date: Sat, 4 Jan 2025 16:35:30 +0530 Subject: [PATCH 1/2] fix: semantic version script to support root pyproject --- scripts/semantic_release_workflow.py | 42 +++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/scripts/semantic_release_workflow.py b/scripts/semantic_release_workflow.py index a6b0c0d..5c22d20 100644 --- a/scripts/semantic_release_workflow.py +++ b/scripts/semantic_release_workflow.py @@ -201,25 +201,35 @@ def get_package_commits(self, package_path): Git command runs successfully, and commits are returned. Failure Path: Git command fails due to invalid commit range or other issues. - TODO: Handle git log when its empty - TODO: handle cases when prev commit and current commit is the same """ try: - # Get commits that modified files in this package between two commits - cmd = [ - "git", - "log", - f"{self.prev_commit}^..{self.current_commit}", - "--pretty=format:%s", - "--", - package_path, - ] + paths_to_check = [package_path] + + # Special handling for feluda package to include root pyproject.toml + if package_path == "feluda": + paths_to_check.append("pyproject.toml") + + all_commits = [] + for path in paths_to_check: + # Get commits that modified files in this path between two commits + cmd = [ + "git", + "log", + f"{self.prev_commit}^..{self.current_commit}", + "--pretty=format:%s", + "--", + path, + ] + + result = subprocess.run( + cmd, cwd=self.repo_root, capture_output=True, text=True, check=True + ) - result = subprocess.run( - cmd, cwd=self.repo_root, capture_output=True, text=True, check=True - ) + # Add commits for this path to the total list + all_commits.extend(result.stdout.splitlines()) - return result.stdout.splitlines() + # Remove duplicates while preserving order + return list(dict.fromkeys(all_commits)) except subprocess.CalledProcessError as e: print(f"Error getting commits for {package_path}: {e}") return [] @@ -547,4 +557,4 @@ def update_package_versions(self): except Exception as e: print(f"An error occurred during the version update process: {e}") - sys.exit(1) \ No newline at end of file + sys.exit(1) From d8c0e5ffb2b81919f26fea643f17c7f9e7f1497d Mon Sep 17 00:00:00 2001 From: Aatman Vaidya Date: Sat, 4 Jan 2025 17:48:15 +0530 Subject: [PATCH 2/2] chore: updating operators and feluda dependencies --- operators/cluster_embeddings/pyproject.toml | 17 ++++------------- operators/dimension_reduction/pyproject.toml | 17 ++++------------- operators/vid_vec_rep_clip/pyproject.toml | 14 ++++---------- pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 37 deletions(-) diff --git a/operators/cluster_embeddings/pyproject.toml b/operators/cluster_embeddings/pyproject.toml index 36c8946..3cce95c 100644 --- a/operators/cluster_embeddings/pyproject.toml +++ b/operators/cluster_embeddings/pyproject.toml @@ -2,21 +2,14 @@ name = "feluda-cluster-embeddings" version = "0.1.0" requires-python = ">=3.10" -dependencies = [ - "scikit-learn>=1.5.1", - "numpy>=2.2.1", -] +dependencies = ["scikit-learn>=1.6.0", "numpy>=2.2.1"] [build-system] -requires = [ - "hatchling", -] +requires = ["hatchling"] build-backend = "hatchling.build" [tool.semantic_release] -version_variable = [ - "pyproject.toml:project.version", -] +version_variable = ["pyproject.toml:project.version"] [tool.semantic_release.branches.main] match = "main" @@ -24,6 +17,4 @@ prerelease = false tag_format = "{name}-{version}" [tool.hatch.build.targets.wheel] -packages = [ - ".", -] +packages = ["."] diff --git a/operators/dimension_reduction/pyproject.toml b/operators/dimension_reduction/pyproject.toml index 50a565a..008e7f5 100644 --- a/operators/dimension_reduction/pyproject.toml +++ b/operators/dimension_reduction/pyproject.toml @@ -2,21 +2,14 @@ name = "feluda-dimension-reduction" version = "0.1.0" requires-python = ">=3.10" -dependencies = [ - "scikit-learn>=1.5.1", - "numpy>=2.2.1", -] +dependencies = ["scikit-learn>=1.6.0", "numpy>=2.2.1"] [build-system] -requires = [ - "hatchling", -] +requires = ["hatchling"] build-backend = "hatchling.build" [tool.semantic_release] -version_variable = [ - "pyproject.toml:project.version", -] +version_variable = ["pyproject.toml:project.version"] [tool.semantic_release.branches.main] match = "main" @@ -24,6 +17,4 @@ prerelease = false tag_format = "{name}-{version}" [tool.hatch.build.targets.wheel] -packages = [ - ".", -] +packages = ["."] diff --git a/operators/vid_vec_rep_clip/pyproject.toml b/operators/vid_vec_rep_clip/pyproject.toml index 0f2e840..ac8c4a3 100644 --- a/operators/vid_vec_rep_clip/pyproject.toml +++ b/operators/vid_vec_rep_clip/pyproject.toml @@ -5,20 +5,16 @@ requires-python = ">=3.10" dependencies = [ "torch>=2.5.1", "torchvision>=0.20.1", - "transformers>=4.44.0", + "transformers>=4.47.1", "pillow>=11.1.0", ] [build-system] -requires = [ - "hatchling", -] +requires = ["hatchling"] build-backend = "hatchling.build" [tool.semantic_release] -version_variable = [ - "pyproject.toml:project.version", -] +version_variable = ["pyproject.toml:project.version"] [tool.semantic_release.branches.main] match = "main" @@ -26,6 +22,4 @@ prerelease = false tag_format = "{name}-{version}" [tool.hatch.build.targets.wheel] -packages = [ - ".", -] +packages = ["."] diff --git a/pyproject.toml b/pyproject.toml index 8c53ac9..c563716 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.9.0" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "boto3>=1.35.91", + "boto3>=1.35.92", "dacite>=1.8.1", "pydub>=0.25.1", "pyyaml>=6.0.2",