Repository: shift-happens-benchmark/icml-2022 (language: python)

Issue:
Package dependencies not properly configured
https://github.com/shift-happens-benchmark/icml-2022/blob/5a567ba9705da3f4d7874cd8124104c577cc1c6a/setup.cfg#L50-L53

Before pushing the package to pypi, it would be great to update the dependencies in the package definition (and move the pip freeze with exact versions to requirements.txt instead). Development dependencies like pytest should be moved under a `[dev]` section or similar in the project cfg.

It would also be great to add an integration test (as a github action) that installs the package from the project config (not requirements.txt) and makes sure all tests run successfully

cc @zimmerrol 


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml
index e247bee5..df806560 100644
--- a/.github/workflows/pypi.yaml
+++ b/.github/workflows/pypi.yaml
@@ -22,5 +22,5 @@ jobs:
         TWINE_USERNAME: __token__
         TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
       run: |
-        python setup.py sdist bdist_wheel
+        python -m build --wheel
         twine upload dist/*
\ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
index 5cbcf53d..2f9a01da 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -46,11 +46,26 @@ package_dir =
     = .
 packages = find:
 python_requires = >=3.8
-
-[options.extras_require]
 install_requires =
-    pytest
     numpy
+    torch
+    torchvision
+    surgeon_pytorch
+
+[options.extras_require]
+dev =
+    flake8==4.0.1
+    click==8.0.1
+    black==22.1.0
+    pytest==7.1.1
+    mypy==0.942
+    pre-commit==2.17.0
+    isort==5.10.1
+    sphinx==4.5.0
+    sphinx_autodoc_typehints==1.18.1
+    sphinx_copybutton==0.5.0
+    pydata_sphinx_theme==0.8.1
+
 
 [options.packages.find]
 where = .


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5f8c0102..91e31956 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -83,6 +83,48 @@ jobs:
     - name: mypy (tests)
       run: |
         mypy tests/
+    - name: Test with pytest
+      run: |
+        pytest --durations=0 --verbose
+
+  wheel-tests:
+    runs-on: ubuntu-latest
+    strategy:
+      max-parallel: 20
+      matrix:
+        python-version: ['3.9']
+
+    steps:
+    - uses: actions/checkout@v2
+    - uses: actions/cache@v1
+      with:
+        path: ~/.cache/pip
+        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+        restore-keys: |
+          ${{ runner.os }}-pip-
+    - uses: actions/cache@v1
+      with:
+        path: ~/.cache/torch
+        key: ${{ runner.os }}-cache-torch
+    - uses: actions/cache@v1
+      with:
+        path: ~/.torch
+        key: ${{ runner.os }}-torch
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v1
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install setuptools wheel build pytest
+    - name: Build wheel
+      run: |
+         python -m build --wheel
+    - name: Install wheel
+      run: |
+        wheelname=$(ls dist/shifthappens-*.whl| head -1)
+        pip install $wheelname
     - name: Test with pytest
       run: |
         pytest --durations=0 --verbose
\ No newline at end of file