diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 6477a5d..38da6b2 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -1,32 +1,12 @@ name: Run Build Tests on: push: + branches: [master] + pull_request: + branches: [dev] workflow_dispatch: jobs: build_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt install python3-dev swig libssl-dev - - name: Build Source Packages - run: | - python setup.py sdist - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Install core repo - run: | - pip install .[extras] + uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev + secrets: inherit diff --git a/.github/workflows/install_tests.yml b/.github/workflows/install_tests.yml deleted file mode 100644 index 43556a2..0000000 --- a/.github/workflows/install_tests.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Run Install Tests -on: - push: - branches: - - master - - dev - workflow_dispatch: - -jobs: - install: - strategy: - max-parallel: 2 - matrix: - python-version: [3.9, "3.10", "3.11"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt install python3-dev swig libssl-dev - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Install package - run: | - pip install .[all] \ No newline at end of file diff --git a/.github/workflows/publish_stable.yml b/.github/workflows/publish_stable.yml index 95fa036..c65ec9a 100644 --- a/.github/workflows/publish_stable.yml +++ b/.github/workflows/publish_stable.yml @@ -6,53 +6,12 @@ on: jobs: publish_stable: - uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master + if: github.actor != 'github-actions[bot]' + uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev secrets: inherit with: branch: 'master' version_file: 'ovos_gui/version.py' - setup_py: 'setup.py' + publish_pypi: true + sync_dev: true 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@v4 - with: - ref: master - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - 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@v4 - 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 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 40b11bf..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include requirements.txt -include LICENSE.md \ No newline at end of file diff --git a/ovos_gui/version.py b/ovos_gui/version.py index abf08b7..7147a1b 100644 --- a/ovos_gui/version.py +++ b/ovos_gui/version.py @@ -4,3 +4,5 @@ VERSION_BUILD = 7 VERSION_ALPHA = 1 # END_VERSION_BLOCK + +__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + (f"a{VERSION_ALPHA}" if VERSION_ALPHA else "") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4ae89de --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "ovos-gui" +dynamic = ["version"] +description = "ovos-core gui service daemon" +readme = "README.md" +license = {text = "Apache-2.0"} +authors = [{name = "JarbasAi", email = "jarbasai@mailfence.com"}] +keywords = ["ovos", "gui"] +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", +] +dependencies = [ + "ovos_bus_client>=1.0.0,<3.0.0", + "ovos-utils>=0.0.37,<1.0.0", + "ovos-config>=0.0.12,<3.0.0", + "tornado~=6.0, >=6.0.3", + "ovos-plugin-manager>=0.5.5,<3.0.0", +] + +[project.optional-dependencies] +extras = ["ovos-gui-plugin-shell-companion>=1.0.1,<2.0.0"] + +[project.urls] +Homepage = "https://github.com/OpenVoiceOS/ovos-gui" + +[project.scripts] +ovos-gui-service = "ovos_gui.__main__:main" +ovos-gui-debug-tui = "ovos_gui.tui:main" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["ovos_gui*"] + +[tool.setuptools.package-data] +ovos_gui = ["res/**/*"] + +[tool.setuptools.dynamic] +version = {attr = "ovos_gui.version.__version__"} diff --git a/requirements/extras.txt b/requirements/extras.txt deleted file mode 100644 index 34b7479..0000000 --- a/requirements/extras.txt +++ /dev/null @@ -1 +0,0 @@ -ovos-gui-plugin-shell-companion>=1.0.1,<2.0.0 diff --git a/requirements/requirements.txt b/requirements/requirements.txt deleted file mode 100644 index 0378143..0000000 --- a/requirements/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -ovos_bus_client>=1.0.0,<3.0.0 -ovos-utils>=0.0.37,<1.0.0 -ovos-config>=0.0.12,<3.0.0 -tornado~=6.0, >=6.0.3 -ovos-plugin-manager>=0.5.5,<3.0.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 10afbb4..0000000 --- a/setup.py +++ /dev/null @@ -1,93 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import os.path - -from setuptools import setup - -BASEDIR = os.path.abspath(os.path.dirname(__file__)) -os.chdir(BASEDIR) # For relative `packages` spec in setup below - - -def required(requirements_file): - """ Read requirements file and remove comments and empty lines. """ - with open(os.path.join(BASEDIR, requirements_file), 'r') as f: - requirements = f.read().splitlines() - if 'MYCROFT_LOOSE_REQUIREMENTS' in os.environ: - print('USING LOOSE REQUIREMENTS!') - requirements = [r.replace('==', '>=').replace('~=', '>=') for r in requirements] - return [pkg for pkg in requirements - if pkg.strip() and not pkg.startswith("#")] - - -def get_version(): - """ Find the version of ovos-core""" - version = None - version_file = os.path.join(BASEDIR, 'ovos_gui', 'version.py') - major, minor, build, alpha = (None, None, None, None) - with open(version_file) as f: - for line in f: - if 'VERSION_MAJOR' in line: - major = line.split('=')[1].strip() - elif 'VERSION_MINOR' in line: - minor = line.split('=')[1].strip() - elif 'VERSION_BUILD' in line: - build = line.split('=')[1].strip() - elif 'VERSION_ALPHA' in line: - alpha = line.split('=')[1].strip() - - if ((major and minor and build and alpha) or - '# END_VERSION_BLOCK' in line): - break - version = f"{major}.{minor}.{build}" - if int(alpha): - version += f"a{alpha}" - return version - - -def package_files(directory): - paths = [] - for (path, _, filenames) in os.walk(directory): - for filename in filenames: - paths.append(os.path.join('..', path, filename)) - return paths - - -def get_description(): - with open(os.path.join(BASEDIR, "README.md"), "r") as f: - long_description = f.read() - return long_description - - -setup( - name='ovos_gui', - version=get_version(), - license='Apache-2.0', - url='https://github.com/OpenVoiceOS/ovos-gui', - description='ovos-core gui service daemon', - long_description=get_description(), - long_description_content_type="text/markdown", - include_package_data=True, - packages=["ovos_gui"], - package_data={"": package_files('ovos_gui/res')}, - install_requires=required('requirements/requirements.txt'), - extras_require={ - "extras": required("requirements/extras.txt") - }, - entry_points={ - 'console_scripts': [ - 'ovos-gui-service=ovos_gui.__main__:main', - 'ovos-gui-debug-tui=ovos_gui.tui:main' - ] - } -)