From 84122de339279e6a889417a0d7e6afdd2295b13e Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Fri, 13 Oct 2023 16:13:49 +0800 Subject: [PATCH 1/4] add version --- setup.py | 4 +++- whisper_live/__version__.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 whisper_live/__version__.py diff --git a/setup.py b/setup.py index 1b23d24..64cdccf 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ import pathlib from setuptools import find_packages, setup +from mypackage.__version__ import __version__ + # The directory containing this file HERE = pathlib.Path(__file__).parent @@ -9,7 +11,7 @@ README = (HERE / "README.md").read_text() # This call to setup() does all the work setup(name="whisper-live", - version="0.0.6", + version=__version__, description="A nearly-live implementation of OpenAI's Whisper.", long_description=README, long_description_content_type="text/markdown", diff --git a/whisper_live/__version__.py b/whisper_live/__version__.py new file mode 100644 index 0000000..10ce742 --- /dev/null +++ b/whisper_live/__version__.py @@ -0,0 +1 @@ +__version__="0.0.7" \ No newline at end of file From 06189ab37cadbe744928fbc76a2851adc9f24340 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Fri, 13 Oct 2023 17:21:48 +0800 Subject: [PATCH 2/4] add ci --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ setup.py | 10 ++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..76ab2df --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Check Out Repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Set up FFmpeg + uses: FedericoCarboni/setup-ffmpeg@v2 + + - name: Install Additional Requirements + run: | + sudo apt-get -y install portaudio19-dev wget + shell: bash + + - name: Install Client Requirements + run: pip install -r requirements/client.txt + + - name: Install Server Requirements + run: pip install -r requirements/server.txt + + - name: Install Wheel for Build + run: pip install wheel twine + + - name: Build and Publish Package to PyPI + run: | + python setup.py sdist bdist_wheel + twine upload --repository-url https://upload.pypi.org/legacy/ dist/* + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/setup.py b/setup.py index 64cdccf..c60bcd0 100644 --- a/setup.py +++ b/setup.py @@ -21,9 +21,15 @@ setup(name="whisper-live", author_email="vineet.suryan@collabora.com", license="MIT", classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Topic :: Scientific/Engineering :: Artificial Intelligence", ], packages=find_packages( exclude=("examples", @@ -43,4 +49,6 @@ setup(name="whisper-live", "ffmpeg-python", "scipy", "websocket-client", - ]) \ No newline at end of file + ], + python_requires=">=3.8" +) \ No newline at end of file From 0ea554f297e5abfb1963aeff875c341384b6e1a2 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Fri, 13 Oct 2023 17:26:15 +0800 Subject: [PATCH 3/4] fix: typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c60bcd0..3801c87 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import pathlib from setuptools import find_packages, setup -from mypackage.__version__ import __version__ +from whisper_live.__version__ import __version__ # The directory containing this file From 28d4bac210f9db0b14613b6836ce0a1a1fe82103 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Fri, 13 Oct 2023 19:11:58 +0800 Subject: [PATCH 4/4] push package only on new tag --- .github/workflows/ci.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ab2df..29010bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,12 +4,14 @@ on: push: branches: - main + tags: + - v* pull_request: branches: - main jobs: - publish: + build-and-push-package: runs-on: ubuntu-latest steps: @@ -20,11 +22,11 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.8 - + - name: Set up FFmpeg uses: FedericoCarboni/setup-ffmpeg@v2 - - - name: Install Additional Requirements + + - name: Install Additional requirements run: | sudo apt-get -y install portaudio19-dev wget shell: bash @@ -35,13 +37,16 @@ jobs: - name: Install Server Requirements run: pip install -r requirements/server.txt - - name: Install Wheel for Build + - name: Install Wheel for build run: pip install wheel twine - - - name: Build and Publish Package to PyPI + + - name: Build wheel run: | python setup.py sdist bdist_wheel - twine upload --repository-url https://upload.pypi.org/legacy/ dist/* - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + + - name: Push package on Test PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}