diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..085d231 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,44 @@ +name: CD + +on: + release: + types: [published] + +jobs: + build_and_deploy: + + runs-on: ubuntu-latest + + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: tag to version + shell: bash -l {0} + run: echo "__version__='${GITHUB_REF#refs/*/}'" >> semi_ate_installer/__init__.py + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + +# - name: directory structure +# shell: bash -l {0} +# run: | +# pwd +# tree +# cat semi_ate_installer/__init__.py + + - name: Build package + run: python -m build + +# - name: Publish package +# uses: pypa/gh-action-pypi-publish +# with: +# user: __token__ +# password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..1daf653 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + workflow_dispatch: + pull_request: + branches: [main] + + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: tag to version + shell: bash -l {0} + run: echo "__version__='0.0.0'" >> semi_ate_installer/__init__.py + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: python -m build + diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 62854ee..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Upload Python Package - -on: - release: - types: [published] - -permissions: - contents: read - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: directory structure - shell: bash -l {0} - run: | - tree - - - name: Build package - run: python -m build - - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7be1aac --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "semi-ate-installer" +dynamic = ["version"] +description = "Semi ATE Installer package for ATE Projects" +readme = "README.md" +license = "GPL-2.0-only" +authors = [ + { name = "The Semi-ATE Project Contributors", email = "ate.organization@gmail.com" }, +] +keywords = [ + "ATE", + "Automatic", + "Equipment", + "Plugin", + "Semiconductor", + "Spyder", + "Test", +] +classifiers = [ + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", +] +dependencies = [ + "packaging", + "pyfiglet>=0.8", + "questionary==1.10.0", +] + +[project.scripts] +ate-installer = "semi_ate_installer.cli:main" + +[tool.hatch.version] +path = "semi_ate_installer/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/semi_ate_installer", +] diff --git a/setup.py b/setup.py deleted file mode 100644 index 302b903..0000000 --- a/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -from setuptools import find_packages, setup -from pathlib import Path - -requirements_path = Path(Path(__file__).parents[0], 'requirements/run.txt') -print(f">>>>> requiremets_path ={requirements_path}") - -with requirements_path.open('r') as f: - install_requires = list(f) - - -setup( - name='semi-ate-installer', - version='0.0.0', - description='Semi ATE Installer package for ATE Projects', - long_description='', - long_description_content_type='text/markdown', - author="The Semi-ATE Project Contributors", - author_email="ate.organization@gmail.com", - license="GPL-2.0-only", - keywords="Semiconductor ATE Automatic Test Equipment Spyder Plugin", - platforms=["Windows", "Linux", "Mac OS-X"], - packages=find_packages(), - include_package_data=True, - classifiers=[ - 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', - ], - install_requires=install_requires, - entry_points={ - 'console_scripts': ['ate-installer=semi_ate_installer.cli:main'] - }, -)