From 6288f5e5347f5457116f883c00f4b7dd985d857f Mon Sep 17 00:00:00 2001 From: endomorphosis Date: Wed, 24 Jul 2024 03:26:32 -0700 Subject: [PATCH] update --- .github/workflows/publish_to_pipy.yml | 72 --------------------------- .github/workflows/workflow.yml | 53 ++++++++++++++++++++ .gitignore | 1 + pyproject.toml | 21 ++++++++ 4 files changed, 75 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/publish_to_pipy.yml create mode 100644 .github/workflows/workflow.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/publish_to_pipy.yml b/.github/workflows/publish_to_pipy.yml deleted file mode 100644 index 16cbc29..0000000 --- a/.github/workflows/publish_to_pipy.yml +++ /dev/null @@ -1,72 +0,0 @@ -jobs: - build: - name: Build distribution 📦 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/ipfs_transformers # Replace with your PyPI project name - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - github-release: - name: >- - Sign the Python 🐍 distribution 📦 with Sigstore - and upload them to GitHub Release - needs: - - publish-to-pypi - runs-on: ubuntu-latest - permissions: - contents: write # IMPORTANT: mandatory for making GitHub Releases - id-token: write # IMPORTANT: mandatory for sigstore - - steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v1.2.3 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - '${{ github.ref_name }}' - --repo '${{ github.repository }}' - --notes "" - - name: Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - '${{ github.ref_name }}' dist/** - --repo '${{ github.repository }}' \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..2cfd854 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,53 @@ +name: Publish Python Package + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + release: + types: [created] + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip setuptools wheel + - name: Build the package + run: python setup.py sdist bdist_wheel + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish Python 🐍 distribution 📦 to PyPI + if: github.ref == 'refs/heads/main' # only publish to PyPI on pushes to main branch + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ipfs-transformers # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index f51cb14..8da33b3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ build ipfs_transformers.egg-info config/config.toml config.toml +dist \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bb44a3d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "ipfs_transformers" +version = "0.0.1" +authors = [ + { name="Benjamin Barber", email="starworks5@gmail.com" }, +] +description = "A wrapper around huggingface transformers, invoking an IPFS model manager." +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Operating System :: POSIX :: Linux", +] +[project.urls] +Homepage = "https://github.com/endomorphosis/ipfs_transformers" +Issues = "https://github.com/endomorphosis/ipfs_transformers/issues" \ No newline at end of file