diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml new file mode 100644 index 0000000..f5bb814 --- /dev/null +++ b/.github/workflows/run-test.yml @@ -0,0 +1,34 @@ +name: Windows CI for HwCodecDetect + +on: + push: + branches: [ main, testci ] + pull_request: + branches: [ main, testci ] + +jobs: + test-on-windows: + runs-on: windows-latest + + defaults: + run: + shell: pwsh + + env: + PYTHONIOENCODING: utf-8 + + steps: + - name: Clone HwCodecDetect + run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + + - name: Upgrade pip + run: python -m pip install --upgrade pip + working-directory: HwCodecDetect + + - name: Install dependencies + run: python -m pip install -r requirements.txt + working-directory: HwCodecDetect + + - name: Run tests + run: python -m src.HwCodecDetect.run_tests + working-directory: HwCodecDetect diff --git a/src/HwCodecDetect/__init__.py b/src/HwCodecDetect/__init__.py index 5f5b17d..8675c8b 100644 --- a/src/HwCodecDetect/__init__.py +++ b/src/HwCodecDetect/__init__.py @@ -1,8 +1,16 @@ # HwCodecDetect/__init__.py - +import os from .install_ffmpeg_if_needed import install_ffmpeg_if_needed -from .version import __version__ +def _read_version(): + try: + version_path = os.path.join(os.path.dirname(__file__), '..', '..', 'VERSION') + with open(version_path, encoding='utf-8') as f: + return f.read().strip() + except Exception: + return "0.0.0" + +__version__ = _read_version() __author__ = "whyb" __email__ = "whyber@outlook.com" __license__ = "BSD-3-Clause"