Repository: bittremieux/spectrum_utils (language: python)

Issue:
Unable to install in python 3.11
When install in python 3.11, the following error occurs:

```
Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-glfat_q4/numba_5afd43df9d974845953722af212a915c/setup.py", line 51, in <module>
          _guard_py_ver()
        File "/tmp/pip-install-glfat_q4/numba_5afd43df9d974845953722af212a915c/setup.py", line 48, in _guard_py_ver
          raise RuntimeError(msg.format(cur_py, min_py, max_py))
      RuntimeError: Cannot install on Python version 3.11.0; only versions >=3.7,<3.11 are supported.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
```

Is it possible to modify the setup file to allow installation? Thanks.


Discussion / hints:
Thanks for reporting the issue. The problem lies with Numba, which should [support Python 3.11 very soon, however](https://github.com/numba/numba/issues/8304). I am currently attending a conference and will have time to properly test installing with restricted Numba versions next week.

In the mean time, if this is a pressing matter, using Python 3.10 should be a quick fix.

Fix patch:
diff --git a/environment.yml b/environment.yml
index cbaab0a..081bf14 100644
--- a/environment.yml
+++ b/environment.yml
@@ -9,7 +9,7 @@ dependencies:
   - fastobo
   - lark>=1.0
   - matplotlib
-  - numba>=0.47
+  - numba>=0.57
   - numpy
   - pandas
   - pyteomics>=4.5
diff --git a/setup.cfg b/setup.cfg
index 580e0d8..4dab29a 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -28,7 +28,7 @@ install_requires =
     fastobo
     lark>=1.0
     matplotlib>=3.5
-    numba>=0.47
+    numba>=0.57
     numpy
     pyteomics>=4.5
 
diff --git a/spectrum_utils/spectrum.py b/spectrum_utils/spectrum.py
index 0f1e6c7..83aed3d 100755
--- a/spectrum_utils/spectrum.py
+++ b/spectrum_utils/spectrum.py
@@ -10,7 +10,6 @@
 
 
 class GnpsBackend(pyteomics.usi._PROXIBackend):
-
     _url_template = (
         "https://metabolomics-usi.ucsd.edu/proxi/v{version}/spectra?usi={usi}"
     )


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d291d22..1ed65ed 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -6,9 +6,9 @@ name: tests
 
 on:
   push:
-    branches: [ master ]
+    branches: [ main ]
   pull_request:
-    branches: [ master ]
+    branches: [ main ]
   schedule:
   - cron: "0 0 1 1/1 *" # Run monthly.
 
@@ -18,7 +18,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]
-        python-version: ['3.8', '3.9', '3.10']
+        python-version: ['3.8', '3.9', '3.10', '3.11']
 
     steps:
     - uses: actions/checkout@v2
@@ -41,7 +41,8 @@ jobs:
     - name: Run unit and system tests
       run: |
         pytest --cov=spectrum_utils tests/
-    - name: Upload coverage to codecov
-      uses: codecov/codecov-action@v1
+    - name: Upload coverage reports to Codecov
+      uses: codecov/codecov-action@v3
       with:
+        token: ${{ secrets.CODECOV_TOKEN }}
         fail_ci_if_error: true