From 79de4b22e130943b58c074f2cb2ebe9aafac6961 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:06:37 +0100 Subject: [PATCH 01/12] chore:semver_automations (#265) --- .github/workflows/conventional-label.yaml | 10 ++ .github/workflows/notify_matrix.yml | 23 ----- .github/workflows/propose_release.yml | 32 ------- .github/workflows/publish_alpha.yml | 48 ---------- .github/workflows/publish_release.yml | 43 --------- .github/workflows/publish_stable.yml | 58 ++++++++++++ .github/workflows/release_workflow.yml | 108 ++++++++++++++++++++++ 7 files changed, 176 insertions(+), 146 deletions(-) create mode 100644 .github/workflows/conventional-label.yaml delete mode 100644 .github/workflows/notify_matrix.yml delete mode 100644 .github/workflows/propose_release.yml delete mode 100644 .github/workflows/publish_alpha.yml delete mode 100644 .github/workflows/publish_release.yml create mode 100644 .github/workflows/publish_stable.yml create mode 100644 .github/workflows/release_workflow.yml diff --git a/.github/workflows/conventional-label.yaml b/.github/workflows/conventional-label.yaml new file mode 100644 index 00000000..0a449cba --- /dev/null +++ b/.github/workflows/conventional-label.yaml @@ -0,0 +1,10 @@ +# auto add labels to PRs +on: + pull_request_target: + types: [ opened, edited ] +name: conventional-release-labels +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: bcoe/conventional-release-labels@v1 \ No newline at end of file diff --git a/.github/workflows/notify_matrix.yml b/.github/workflows/notify_matrix.yml deleted file mode 100644 index 8e1036f4..00000000 --- a/.github/workflows/notify_matrix.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Notify Matrix Chat - -# only trigger on pull request closed events -on: - pull_request: - types: [ closed ] - -jobs: - merge_job: - # this job will only run if the PR has been merged - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Send message to Matrix bots channel - id: matrix-chat-message - uses: fadenb/matrix-chat-message@v0.0.6 - with: - homeserver: 'matrix.org' - token: ${{ secrets.MATRIX_TOKEN }} - channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org' - message: | - new ovos-utils PR merged! https://github.com/OpenVoiceOS/ovos_utils/pull/${{ github.event.number }} diff --git a/.github/workflows/propose_release.yml b/.github/workflows/propose_release.yml deleted file mode 100644 index 47a12301..00000000 --- a/.github/workflows/propose_release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Propose Stable Release -on: - workflow_dispatch: - inputs: - release_type: - type: choice - description: Release Type - options: - - build - - minor - - major -jobs: - update_version: - uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master - with: - release_type: ${{ inputs.release_type }} - version_file: ovos_utils/version.py - alpha_var: VERSION_ALPHA - build_var: VERSION_BUILD - minor_var: VERSION_MINOR - major_var: VERSION_MAJOR - update_changelog: True - branch: dev - - pull_changes: - needs: update_version - uses: neongeckocom/.github/.github/workflows/pull_master.yml@master - with: - pr_assignee: ${{ github.actor }} - pr_draft: false - pr_title: ${{ needs.update_version.outputs.version }} - pr_body: ${{ needs.update_version.outputs.changelog }} diff --git a/.github/workflows/publish_alpha.yml b/.github/workflows/publish_alpha.yml deleted file mode 100644 index d17dc6e4..00000000 --- a/.github/workflows/publish_alpha.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Alpha Build ...aX -on: - push: - branches: - - dev - paths-ignore: - - 'ovos_utils/version.py' - - 'test/**' - - 'examples/**' - - '.github/**' - - '.gitignore' - - 'LICENSE' - - 'CHANGELOG.md' - - 'MANIFEST.in' - - 'readme.md' - - 'scripts/**' - workflow_dispatch: - -jobs: - update_version: - uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master - with: - release_type: "alpha" - version_file: ovos_utils/version.py - alpha_var: VERSION_ALPHA - build_var: VERSION_BUILD - minor_var: VERSION_MINOR - major_var: VERSION_MAJOR - update_changelog: True - branch: dev - build_and_publish: - runs-on: ubuntu-latest - needs: update_version - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{secrets.PYPI_TOKEN}} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml deleted file mode 100644 index 97ee396a..00000000 --- a/.github/workflows/publish_release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Publish Release -on: - push: - branches: - - master - -jobs: - github_release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: version - run: echo "::set-output name=version::$(python setup.py --version)" - id: version - - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - id: changelog - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: V${{ steps.version.outputs.version }} - release_name: Release ${{ steps.version.outputs.version }} - body: | - Changes in this Release - ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: false - commitish: master - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{secrets.PYPI_TOKEN}} diff --git a/.github/workflows/publish_stable.yml b/.github/workflows/publish_stable.yml new file mode 100644 index 00000000..0138e1e9 --- /dev/null +++ b/.github/workflows/publish_stable.yml @@ -0,0 +1,58 @@ +name: Stable Release +on: + push: + branches: [master] + workflow_dispatch: + +jobs: + publish_stable: + uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master + secrets: inherit + with: + branch: 'master' + version_file: 'ovos_utils/version.py' + setup_py: 'setup.py' + publish_release: true + + publish_pypi: + needs: publish_stable + if: success() # Ensure this job only runs if the previous job succeeds + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: dev + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install Build Tools + run: | + python -m pip install build wheel + - name: version + run: echo "::set-output name=version::$(python setup.py --version)" + id: version + - name: Build Distribution Packages + run: | + python setup.py sdist bdist_wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{secrets.PYPI_TOKEN}} + + + sync_dev: + needs: publish_stable + if: success() # Ensure this job only runs if the previous job succeeds + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + ref: master + - name: Push master -> dev + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: dev \ No newline at end of file diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml new file mode 100644 index 00000000..5124362c --- /dev/null +++ b/.github/workflows/release_workflow.yml @@ -0,0 +1,108 @@ +name: Release Alpha and Propose Stable + +on: + pull_request: + types: [closed] + branches: [dev] + +jobs: + publish_alpha: + if: github.event.pull_request.merged == true + uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master + secrets: inherit + with: + branch: 'dev' + version_file: 'ovos_utils/version.py' + setup_py: 'setup.py' + update_changelog: true + publish_prerelease: true + changelog_max_issues: 100 + + notify: + if: github.event.pull_request.merged == true + needs: publish_alpha + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Send message to Matrix bots channel + id: matrix-chat-message + uses: fadenb/matrix-chat-message@v0.0.6 + with: + homeserver: 'matrix.org' + token: ${{ secrets.MATRIX_TOKEN }} + channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org' + message: | + new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }} + + publish_pypi: + needs: publish_alpha + if: success() # Ensure this job only runs if the previous job succeeds + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: dev + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install Build Tools + run: | + python -m pip install build wheel + - name: version + run: echo "::set-output name=version::$(python setup.py --version)" + id: version + - name: Build Distribution Packages + run: | + python setup.py sdist bdist_wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{secrets.PYPI_TOKEN}} + + + propose_release: + needs: publish_alpha + if: success() # Ensure this job only runs if the previous job succeeds + runs-on: ubuntu-latest + steps: + - name: Checkout dev branch + uses: actions/checkout@v3 + with: + ref: dev + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Get version from setup.py + id: get_version + run: | + VERSION=$(python setup.py --version) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Create and push new branch + run: | + git checkout -b release-${{ env.VERSION }} + git push origin release-${{ env.VERSION }} + + - name: Open Pull Request from dev to master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Variables + BRANCH_NAME="release-${{ env.VERSION }}" + BASE_BRANCH="master" + HEAD_BRANCH="release-${{ env.VERSION }}" + PR_TITLE="Release ${{ env.VERSION }}" + PR_BODY="Human review requested!" + + # Create a PR using GitHub API + curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \ + https://api.github.com/repos/${{ github.repository }}/pulls + From 37382cb79f00fe8040c1d9185ef72ab53b21c590 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Tue, 10 Sep 2024 18:06:52 +0000 Subject: [PATCH 02/12] Increment Version to --- ovos_utils/version.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ovos_utils/version.py b/ovos_utils/version.py index 316a5fd0..5fcf6d3f 100644 --- a/ovos_utils/version.py +++ b/ovos_utils/version.py @@ -1,7 +1,6 @@ -# The following lines are replaced during the release process. # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 1 VERSION_BUILD = 0 -VERSION_ALPHA = 0 -# END_VERSION_BLOCK +VERSION_ALPHA = 1 +# END_VERSION_BLOCK \ No newline at end of file From 5e1f8afd2ed44c98380cb359a5779e89c4727b4b Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Tue, 10 Sep 2024 18:07:19 +0000 Subject: [PATCH 03/12] Update Changelog --- CHANGELOG.md | 114 +-------------------------------------------------- 1 file changed, 2 insertions(+), 112 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8291a017..fdf32cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased](https://github.com/OpenVoiceOS/ovos-utils/tree/HEAD) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V...HEAD) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0...HEAD) **Implemented enhancements:** @@ -22,122 +22,12 @@ - fix/log\_spam [\#251](https://github.com/OpenVoiceOS/ovos-utils/pull/251) ([JarbasAl](https://github.com/JarbasAl)) - feat: mac support for ram cache [\#231](https://github.com/OpenVoiceOS/ovos-utils/pull/231) ([mikejgray](https://github.com/mikejgray)) -**Closed issues:** - -- "systemctl restart" not working when using with ovos-phal-plugin-system [\#259](https://github.com/OpenVoiceOS/ovos-utils/issues/259) -- add some trivial unit test coverage that log config changes are reacted to [\#253](https://github.com/OpenVoiceOS/ovos-utils/issues/253) -- log.py - New functions are missing test coverage [\#239](https://github.com/OpenVoiceOS/ovos-utils/issues/239) - **Merged pull requests:** +- chore:semver\_automations [\#265](https://github.com/OpenVoiceOS/ovos-utils/pull/265) ([JarbasAl](https://github.com/JarbasAl)) - log module unit test coverage [\#260](https://github.com/OpenVoiceOS/ovos-utils/pull/260) ([NeonDaniel](https://github.com/NeonDaniel)) - deprecate/signal utils [\#249](https://github.com/OpenVoiceOS/ovos-utils/pull/249) ([JarbasAl](https://github.com/JarbasAl)) -## [V](https://github.com/OpenVoiceOS/ovos-utils/tree/V) (2024-03-10) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a16...V) - -**Merged pull requests:** - -- chore\(docs\): add a long description to PyPi [\#229](https://github.com/OpenVoiceOS/ovos-utils/pull/229) ([mikejgray](https://github.com/mikejgray)) - -## [V0.1.0a16](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a16) (2024-03-10) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a15...V0.1.0a16) - -**Merged pull requests:** - -- chore\(docs\): rename readme.md to README.md [\#230](https://github.com/OpenVoiceOS/ovos-utils/pull/230) ([mikejgray](https://github.com/mikejgray)) - -## [V0.1.0a15](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a15) (2024-02-18) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a13...V0.1.0a15) - -**Merged pull requests:** - -- Option for systemd-timesyncd [\#200](https://github.com/OpenVoiceOS/ovos-utils/pull/200) ([builderjer](https://github.com/builderjer)) - -## [V0.1.0a13](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a13) (2024-01-30) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a12...V0.1.0a13) - -**Merged pull requests:** - -- Update rapidfuzz requirement from ~=2.0 to ~=3.6 in /requirements [\#224](https://github.com/OpenVoiceOS/ovos-utils/pull/224) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Update pexpect requirement from ~=4.6 to ~=4.9 in /requirements [\#223](https://github.com/OpenVoiceOS/ovos-utils/pull/223) ([dependabot[bot]](https://github.com/apps/dependabot)) - -## [V0.1.0a12](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a12) (2024-01-25) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a11...V0.1.0a12) - -**Fixed bugs:** - -- fix/ocp\_playlist [\#221](https://github.com/OpenVoiceOS/ovos-utils/pull/221) ([NeonJarbas](https://github.com/NeonJarbas)) - -## [V0.1.0a11](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a11) (2024-01-25) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a10...V0.1.0a11) - -**Fixed bugs:** - -- fix/restore deprecated OCP enums compat [\#220](https://github.com/OpenVoiceOS/ovos-utils/pull/220) ([NeonJarbas](https://github.com/NeonJarbas)) - -## [V0.1.0a10](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a10) (2024-01-15) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a9...V0.1.0a10) - -**Merged pull requests:** - -- clarify datetime arg [\#219](https://github.com/OpenVoiceOS/ovos-utils/pull/219) ([emphasize](https://github.com/emphasize)) - -## [V0.1.0a9](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a9) (2024-01-12) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a8...V0.1.0a9) - -**Implemented enhancements:** - -- OCP serialization [\#218](https://github.com/OpenVoiceOS/ovos-utils/pull/218) ([NeonJarbas](https://github.com/NeonJarbas)) - -## [V0.1.0a8](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a8) (2024-01-08) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a7...V0.1.0a8) - -**Implemented enhancements:** - -- refactor/ocp\_utils [\#216](https://github.com/OpenVoiceOS/ovos-utils/pull/216) ([NeonJarbas](https://github.com/NeonJarbas)) - -## [V0.1.0a7](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a7) (2024-01-06) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a6...V0.1.0a7) - -**Merged pull requests:** - -- refactor/ocp\_utils [\#215](https://github.com/OpenVoiceOS/ovos-utils/pull/215) ([NeonJarbas](https://github.com/NeonJarbas)) - -## [V0.1.0a6](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a6) (2023-12-30) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a5...V0.1.0a6) - -**Implemented enhancements:** - -- Feat/ovos logs script [\#203](https://github.com/OpenVoiceOS/ovos-utils/pull/203) ([emphasize](https://github.com/emphasize)) - -## [V0.1.0a5](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a5) (2023-12-30) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a4...V0.1.0a5) - -**Merged pull requests:** - -- fix/log\_spam [\#213](https://github.com/OpenVoiceOS/ovos-utils/pull/213) ([JarbasAl](https://github.com/JarbasAl)) - -## [V0.1.0a4](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a4) (2023-12-29) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0a3...V0.1.0a4) - -## [V0.1.0a3](https://github.com/OpenVoiceOS/ovos-utils/tree/V0.1.0a3) (2023-12-29) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.0.38...V0.1.0a3) - \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From ff2573048f6e00cf0b4708bd6cd6be10dccfdc09 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:19:15 +0100 Subject: [PATCH 04/12] chore:semver_versioning (#266) * chore:semver_versioning * Update extras.txt --- requirements/extras.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/extras.txt b/requirements/extras.txt index 60a6dc97..512caa9c 100644 --- a/requirements/extras.txt +++ b/requirements/extras.txt @@ -1,5 +1,5 @@ rapidfuzz~=3.6 -ovos_plugin_manager>=0.0.25a2 -ovos-config>=0.0.12 -ovos-workshop>=0.0.13a22 -ovos-bus-client >=0.0.8a1 \ No newline at end of file +ovos-plugin-manager>=0.0.25,<1.0.0 +ovos-config>=0.0.12,<1.0.0 +ovos-workshop>=0.0.13,<1.0.0 +ovos_bus_client>=0.0.8,<1.0.0 From 5696c2d8104735e96ebb7fb133863784885227c3 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Tue, 10 Sep 2024 19:19:40 +0000 Subject: [PATCH 05/12] Increment Version to --- ovos_utils/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovos_utils/version.py b/ovos_utils/version.py index 5fcf6d3f..5edd75ba 100644 --- a/ovos_utils/version.py +++ b/ovos_utils/version.py @@ -2,5 +2,5 @@ VERSION_MAJOR = 0 VERSION_MINOR = 1 VERSION_BUILD = 0 -VERSION_ALPHA = 1 +VERSION_ALPHA = 2 # END_VERSION_BLOCK \ No newline at end of file From 903b6d54560a5ef3237740caf223181384c2643b Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Tue, 10 Sep 2024 19:20:06 +0000 Subject: [PATCH 06/12] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf32cf0..2d4deb67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ **Merged pull requests:** +- chore:semver\_versioning [\#266](https://github.com/OpenVoiceOS/ovos-utils/pull/266) ([JarbasAl](https://github.com/JarbasAl)) - chore:semver\_automations [\#265](https://github.com/OpenVoiceOS/ovos-utils/pull/265) ([JarbasAl](https://github.com/JarbasAl)) - log module unit test coverage [\#260](https://github.com/OpenVoiceOS/ovos-utils/pull/260) ([NeonDaniel](https://github.com/NeonDaniel)) - deprecate/signal utils [\#249](https://github.com/OpenVoiceOS/ovos-utils/pull/249) ([JarbasAl](https://github.com/JarbasAl)) From 72d2653247fafc8fb1fea13a27088eea0f013c0c Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:56:40 +0100 Subject: [PATCH 07/12] feat:standardize_lang_tag new utils (#267) ported from some TTS/STT plugins, will be useful across OVOS ecosystem --- ovos_utils/lang/__init__.py | 11 +++++++++++ requirements/extras.txt | 1 + 2 files changed, 12 insertions(+) diff --git a/ovos_utils/lang/__init__.py b/ovos_utils/lang/__init__.py index 38a87162..38951b2a 100644 --- a/ovos_utils/lang/__init__.py +++ b/ovos_utils/lang/__init__.py @@ -4,6 +4,17 @@ from ovos_utils.file_utils import resolve_resource_file +def standardize_lang_tag(lang_code, macro=True): + """https://langcodes-hickford.readthedocs.io/en/sphinx/index.html""" + try: + from langcodes import standardize_tag as std + return std(lang_code, macro=macro) + except: + if macro: + return lang_code.split("-")[0].lower() + return lang_code.lower() + + def get_language_dir(base_path, lang="en-us"): """ checks for all language variations and returns best path """ lang_path = join(base_path, lang) diff --git a/requirements/extras.txt b/requirements/extras.txt index 512caa9c..ccf5ccff 100644 --- a/requirements/extras.txt +++ b/requirements/extras.txt @@ -3,3 +3,4 @@ ovos-plugin-manager>=0.0.25,<1.0.0 ovos-config>=0.0.12,<1.0.0 ovos-workshop>=0.0.13,<1.0.0 ovos_bus_client>=0.0.8,<1.0.0 +langcodes \ No newline at end of file From 159db18c8c1e6e1381399244bbe105cf29522e53 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 16 Sep 2024 19:56:54 +0000 Subject: [PATCH 08/12] Increment Version to --- ovos_utils/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_utils/version.py b/ovos_utils/version.py index 5edd75ba..59c1ec1b 100644 --- a/ovos_utils/version.py +++ b/ovos_utils/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 -VERSION_MINOR = 1 +VERSION_MINOR = 2 VERSION_BUILD = 0 -VERSION_ALPHA = 2 +VERSION_ALPHA = 1 # END_VERSION_BLOCK \ No newline at end of file From 62378518987ca5e39a1f0cbfa5808f8207adc7ad Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 16 Sep 2024 19:57:25 +0000 Subject: [PATCH 09/12] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d4deb67..310364e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ **Merged pull requests:** +- feat:standardize\_lang\_tag new utils [\#267](https://github.com/OpenVoiceOS/ovos-utils/pull/267) ([JarbasAl](https://github.com/JarbasAl)) - chore:semver\_versioning [\#266](https://github.com/OpenVoiceOS/ovos-utils/pull/266) ([JarbasAl](https://github.com/JarbasAl)) - chore:semver\_automations [\#265](https://github.com/OpenVoiceOS/ovos-utils/pull/265) ([JarbasAl](https://github.com/JarbasAl)) - log module unit test coverage [\#260](https://github.com/OpenVoiceOS/ovos-utils/pull/260) ([NeonDaniel](https://github.com/NeonDaniel)) From 48d543f750f5255c708a32621b27258043c7dd11 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:04:22 +0100 Subject: [PATCH 10/12] fix:long description (#268) needs absolute path to readme file --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1f926149..85204f8c 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ def required(requirements_file): return [pkg for pkg in requirements if pkg.strip() and not pkg.startswith("#")] -with open("README.md", "r") as f: +with open(BASEDIR + "/README.md", "r") as f: long_description = f.read() setup( From 31bc523fcdc5c549ed1b29dde12469d0bff49254 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 16 Sep 2024 20:04:36 +0000 Subject: [PATCH 11/12] Increment Version to 0.2.1a1 --- ovos_utils/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovos_utils/version.py b/ovos_utils/version.py index 59c1ec1b..27c6206f 100644 --- a/ovos_utils/version.py +++ b/ovos_utils/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 2 -VERSION_BUILD = 0 +VERSION_BUILD = 1 VERSION_ALPHA = 1 # END_VERSION_BLOCK \ No newline at end of file From f546c48e8e994c3d317ed22d78a7ee2c6e6218df Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 16 Sep 2024 20:05:07 +0000 Subject: [PATCH 12/12] Update Changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 310364e4..401e24b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Changelog -## [Unreleased](https://github.com/OpenVoiceOS/ovos-utils/tree/HEAD) +## [0.2.1a1](https://github.com/OpenVoiceOS/ovos-utils/tree/0.2.1a1) (2024-09-16) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0...HEAD) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-utils/compare/V0.1.0...0.2.1a1) **Implemented enhancements:** @@ -24,6 +24,7 @@ **Merged pull requests:** +- fix:long description [\#268](https://github.com/OpenVoiceOS/ovos-utils/pull/268) ([JarbasAl](https://github.com/JarbasAl)) - feat:standardize\_lang\_tag new utils [\#267](https://github.com/OpenVoiceOS/ovos-utils/pull/267) ([JarbasAl](https://github.com/JarbasAl)) - chore:semver\_versioning [\#266](https://github.com/OpenVoiceOS/ovos-utils/pull/266) ([JarbasAl](https://github.com/JarbasAl)) - chore:semver\_automations [\#265](https://github.com/OpenVoiceOS/ovos-utils/pull/265) ([JarbasAl](https://github.com/JarbasAl))