Skip to content

Commit

Permalink
Refactor setup.py: Update versioning logic to include acceleration ta…
Browse files Browse the repository at this point in the history
…g and enhance package metadata
  • Loading branch information
royshil committed Nov 8, 2024
1 parent e96927e commit 386bd78
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ def build_extension(self, ext):
)


acceleration = os.environ.get("SIMPLER_WHISPER_ACCELERATION", "")


class CustomBdistWheel(bdist_wheel):
def get_tag(self):
python, abi, platform = super().get_tag()
acceleration = os.environ.get("SIMPLER_WHISPER_ACCELERATION", "")
if acceleration:
# Store original version
orig_version = self.distribution.get_version()
Expand All @@ -112,9 +114,14 @@ def get_tag(self):
return python, abi, platform


# Make version
pkg_version = "0.2.2"
if acceleration:
pkg_version = f"{pkg_version}+{acceleration}"

setup(
name="simpler-whisper",
version="0.2.2",
version=pkg_version,
author="Roy Shilkrot",
author_email="[email protected]",
description="A simple Python wrapper for whisper.cpp",
Expand All @@ -128,4 +135,11 @@ def get_tag(self):
packages=[
"simpler_whisper"
], # Add this line to ensure the package directory is created
python_requires=">=3.10",
install_requires=[
"numpy",
],
package_data={
"simpler_whisper": ["*.dll", "*.pyd", "*.so", "*.metal"],
},
)

0 comments on commit 386bd78

Please sign in to comment.