Repository: gsp-eeg/PyGSP2 (language: python)

Issue:
adds hatchling requirement



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml
index 263feb2..1f4ffde 100644
--- a/.github/workflows/release-pypi.yml
+++ b/.github/workflows/release-pypi.yml
@@ -2,6 +2,8 @@ name: Release to PyPI
 
 on:
   push:
+    #branches:
+    #  - main
     tags:
       - "v*.*.*"
 
@@ -41,4 +43,4 @@ jobs:
         env:
           TWINE_USERNAME: __token__
           TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
-        run: twine upload dist/*
\ No newline at end of file
+        run: twine upload dist/*
diff --git a/README.rst b/README.rst
index 8d2271e..33d1964 100644
--- a/README.rst
+++ b/README.rst
@@ -11,9 +11,9 @@ and development takes place on
 A (mostly unmaintained) `Matlab version <https://epfl-lts2.github.io/gspbox-html>`_ exists.
 
 +-----------------------------------+
-| |doc|  |pypi|                     |
+||doc|   |pypi|   |release|   |test||
 +-----------------------------------+
-| |zenodo|  |license|  |pyversions| |
+||zenodo|   |license|   |pyversions||
 +-----------------------------------+
 
 .. |doc| image:: https://readthedocs.org/projects/pygsp2/badge/?version=latest
@@ -26,6 +26,10 @@ A (mostly unmaintained) `Matlab version <https://epfl-lts2.github.io/gspbox-html
    :target: https://github.com/gsp-eeg/pygsp2/blob/master/LICENSE.txt
 .. |pyversions| image:: https://img.shields.io/pypi/pyversions/pygsp2.svg
    :target: https://pypi.org/project/PyGSP2
+.. |release| image:: https://img.shields.io/github/actions/workflow/status/gsp-eeg/PyGSP2/release-pypi.yml?label=release
+   :target: https://github.com/gsp-eeg/PyGSP2/actions
+.. |test| image:: https://img.shields.io/github/actions/workflow/status/gsp-eeg/PyGSP2/test-examples.yml?label=testing
+   :target: https://github.com/gsp-eeg/PyGSP2/actions
 
 The PyGSP2 facilitates a wide variety of operations on graphs, like computing
 their Fourier basis, filtering or interpolating signals, plotting graphs,
diff --git a/setup.py b/setup.py
index f04ac98..f558a0b 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,9 @@
         'unidecode',
         'utm',
         'pyxlsb',
-        'charset-normalizer'
+        'charset-normalizer',
+        'requests',
+        'hatchling'
     ],
     extras_require={
         # Optional dependencies for development. Some bring additional
@@ -80,6 +82,8 @@
             # Build and upload packages.
             'wheel',
             'twine',
+            'requests',
+            'hatchling'
         ],
     },
     license="BSD",


Test patch:
diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml
new file mode 100644
index 0000000..7a5937c
--- /dev/null
+++ b/.github/workflows/test_examples.yml
@@ -0,0 +1,43 @@
+name: Test Examples and Auto Merge
+
+on:
+  pull_request:
+    branches:
+      - testing
+
+jobs:
+  test-and-merge:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v3
+
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: '3.11' # Specify the version of Python you need
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install requests
+          pip install -e . # Install the PyGSP2 package in editable mode
+
+      - name: Run example scripts
+        run: |
+          for script in examples/*.py; do
+            echo "Running $script"
+            python "$script"
+          done
+
+      - name: Merge PR if tests pass
+        if: success()
+        run: |
+          git config --global user.name 'github-actions[bot]'
+          git config --global user.email 'github-actions[bot]@users.noreply.github.com'
+          git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
+          git fetch origin
+          git checkout latest
+          git merge --no-ff origin/${{ github.head_ref }} -m "Auto-merging PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
+          git push origin latest