Repository: neuromodulation/py_neuromodulation (language: python)

Issue:
Use Rye to install dependencies during automated tests
So @timonmerk and I talked about this during the meeting, and it seems that there is a way to customize the way tox installs packages, see docs here: https://tox.wiki/en/latest/config.html#install_command

So it defaults to `python -I -m pip install  {opts} {packages}`

Right now the output in the Github Action is:
```python -I -m pip install 'filterpy>=1.4.5' fooof 'hatch>=1.9.4' imbalanced-learn 'joblib>=1.3.2' 'matplotlib>=3.3.4' mne 'mne-bids>=0.8' mne-connectivity mrmr-selection nolds 'numpy>=1.21.2' 'pandas>=1.2.2' pip 'pyarrow>=14.0.2' pybids 'pybispectra>=1.0.0' pynput pyparrm scikit-image 'scikit-learn>=0.24.2' scikit-optimize 'scipy>=1.7.1' 'seaborn>=0.11' wget```

So we can experiment with adding this to the tox configuration:
```  
[testenv]
install_command = rye sync
```
Provided that the Github workflow is modified to install Rye beforehand, instead of Pip.

We could maybe do this modification together with adding the Windows tests, @SamedVossberg





Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index d734c914..b846a67f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -160,16 +160,12 @@ sub/
 
 py_neuromodulation/data/derivatives/*
 
-requirements.lock
-requirements-dev.lock
-
 .python-version
 
 py_neuromodulation/ConnectivityDecoding/connectome_folder/*
 
 plot_0_first_demo.py
+plot_1_example_BIDS.py
 
 requirements.lock
-requirements-dev.lock
-
-plot_1_example_BIDS.py
+requirements-dev.lock
\ No newline at end of file
diff --git a/README.rst b/README.rst
index b0a5a2d5..fbe38084 100644
--- a/README.rst
+++ b/README.rst
@@ -40,21 +40,6 @@ py_neuromodulation requires at least python 3.10. For installation you can use p
 
     pip install py-neuromodulation
 
-
-We recommend however installing the package using `rye <https://rye-up.com/guide/installation/>`_:
-
-.. code-block::
-
-    git clone https://github.com/neuromodulation/py_neuromodulation.git
-    rye pin 3.11
-    rye sync
-
-And then activating the virtual environment e.g. in Windows using:
-
-.. code-block::
-
-    .\.venv\Scripts\activate
-
 Alternatively you can also install the package in a conda environment:
 
 .. code-block::
diff --git a/pyproject.toml b/pyproject.toml
index fafaf750..5ca718f3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -61,6 +61,7 @@ dev = [
     "black>=24.2.0",
     "pytest>=8.0.2",
     "pytest-cov",
+    "pytest-sugar",
     "notebook",
 ]
 
@@ -81,22 +82,7 @@ docs = [
 
 [tool.rye]
 dev-dependencies = [
-    "black>=24.2.0",
-    "pytest>=8.0.2",
-    "pytest-cov",
-    "notebook",
     "py-neuromodulation[dev]",
-    "nbsphinx",
-    "sphinx",
-    "pandoc",
-    "recommonmark",
-    "sphinx",
-    "numpydoc",
-    "sphinx-gallery",
-    "nbsphinx_link",
-    "pydata-sphinx-theme",
-    "pypandoc",
-    "sphinx_togglebutton",
 ]
 
 [project.urls]
@@ -115,24 +101,4 @@ packages = ["py_neuromodulation"]
 exclude = [
   "py_neuromodulation/data/derivatives",
   "py_neuromodulation/ConnectivityDecoding/connectome_folder",
-]
-
-[tool.tox]
-legacy_tox_ini = """
-  [tox]
-  env_list =
-    py3{10, 11}
-  
-  skip_missing_interpreters = true
-  isolated_build = true
-
-
-  [testenv]
-  description = install pytest in a virtual environment and invoke it on the tests folder
-  deps =
-      pytest>=7
-      pytest-sugar
-  commands = pytest tests {posargs}
-"""
-
-# check https://stackoverflow.com/a/40831237/5060208 for adding posargs to pytest
+]
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index ac93998a..62f73914 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -20,34 +20,31 @@ on:
       - '*.txt'
 jobs:
   tests:
-    name: ${{ matrix.name }}
-    runs-on: ${{ matrix.os }}
-    env:
-      APPDATA: DefaultNonExistingPath 
+    name: ${{ matrix.platform.name }} Python ${{ matrix.python }}
+    runs-on: ${{ matrix.platform.os }}
     strategy:
       fail-fast: false
       matrix:
-        include:
-          - {name: 3.10 Mac, python: '3.10', os: macos-latest, tox: py310}
-          - {name: 3.10 Linux, python: '3.10', os: ubuntu-latest, tox: py310}
+        platform:
+          - os: ubuntu-latest
+            name: Linux
+          - os: macos-latest
+            name: MacOS
+          - os: windows-latest
+            name: Windows
+        python:
+          - '3.10'
     steps:
-      - uses: actions/checkout@v3
-      - uses: actions/setup-python@v4
+      - uses: actions/checkout@v4
+      - name: Set up Python with uv
+        uses: drivendataorg/setup-python-uv-action@v1
         with:
           python-version: ${{ matrix.python }}
-      - name: update pip
-        run: |
-          python -m pip install -U pip
-      - name: get pip cache dir
-        id: pip-cache
-        run: echo "::set-output name=dir::$(pip cache dir)"
-      - name: cache pip
-        uses: actions/cache@v3
-        with:
-          path: ${{ steps.pip-cache.outputs.dir }}
-          key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('requirements/*.txt') }}
-          restore-keys: pip|${{ runner.os }}|${{ matrix.python }}
-      - run: pip install tox
-        env:
-          APPDATA: DefaultNonExistingPath 
-      - run: tox -e ${{ matrix.tox }}
+          cache: packages
+          cache-dependency-path: pyproject.toml
+      - name: Install dependencies
+        run: uv pip install .
+      - name: Install pytest
+        run: uv pip install pytest pytest-xdist pytest-sugar
+      - name: Run tests
+        run: pytest -n auto tests/