Repository: pvlib/pvanalytics (language: python)

Issue:
Requirements in setup.py are redundant, and partially inconsistent, with requirements.txt
`index.rst` advertises the contents of `requirements.txt` as the package's dependencies:

https://github.com/pvlib/pvanalytics/blob/a3d3860ee848afd5cb7184b36beedcd14dbbdc60/requirements.txt#L1-L6

But the pandas version range specified in `setup.py` is in fact slightly different ([ref](https://github.com/pvlib/pvanalytics/pull/67/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552R2)):

https://github.com/pvlib/pvanalytics/blob/a3d3860ee848afd5cb7184b36beedcd14dbbdc60/setup.py#L33-L40

Worth considering having a "single source of truth" for the requirement ranges so that there's no way for redundant specs to get out of sync.  I think some packages solve this by including a line in `setup.py` like this: `INSTALL_REQUIRES = open('requirements.txt').read().split('\n')`.  Maybe eliminating `requirements.txt` and keeping version ranges in `setup.py` would make more sense in this case.

Same goes for `DOCS_REQUIRE` and `docs/requirements.txt`.


Discussion / hints:
Great suggestion @kanderso-nrel, I've got it on my to-do list to do some general maintenance on dependencies for this project (notably work to support higher versions of pandas) and it would be good to address this as well.
Worth reading this discussion of setup.py vs requirements.txt if you've not already done so: https://caremad.io/posts/2013/07/setup-vs-requirement/ 

It's now 8 years old (a lifetime in python packaging) but so far as I'm aware the advice still applies. TLDR: pvanalytics should not have requirements.txt files (at least that's my understanding)

Fix patch:
diff --git a/docs/index.rst b/docs/index.rst
index c21d65c1..2e1489f7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -82,9 +82,6 @@ It supports:
   and at minimum the last three minor versions
 - The latest release of `PVLib <https://pvlib-python.readthedocs.io>`_.
 
-PVAnalytics depends on the following packages:
-
-.. literalinclude:: ../requirements.txt
 
 Contents
 ========
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 8cd5c46c..00000000
--- a/requirements.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-numpy>=1.15.0
-pandas>=0.24.0,!=1.1.*
-pvlib>=0.8.0
-scipy>=1.2.0
-statsmodels>=0.9.0
-scikit-image>=0.16.0
diff --git a/setup.py b/setup.py
index 7727e61d..7a5920d8 100644
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,7 @@
 
 TESTS_REQUIRE = [
     'pytest',
+    'pytest-cov',
 ]
 
 INSTALL_REQUIRES = [


Test patch:
diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml
index 29b663ef..8d488f35 100644
--- a/.github/workflows/lint-and-test.yml
+++ b/.github/workflows/lint-and-test.yml
@@ -9,9 +9,9 @@ jobs:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
         python-version: [3.7, 3.8, 3.9, "3.10"]
-        requirements: [requirements.txt]
+        requirements: ['']
         include:
-          - requirements: requirements-min.txt
+          - requirements: "-r requirements-min.txt"
             python-version: 3.7
             os: ubuntu-latest
 
@@ -23,13 +23,12 @@ jobs:
       uses: actions/setup-python@v1
       with:
         python-version: ${{ matrix.python-version }}
-    - name: Install dependencies in ${{ matrix.requirements }}
+    - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install -r ${{ matrix.requirements }} .[all]
+        pip install ${{ matrix.requirements }} .[test,optional]
     - name: Test with pytest
       run: |
-        pip install pytest pytest-cov
         pytest --cov=pvanalytics --cov-config=.coveragerc --cov-report term-missing pvanalytics --runslow
     - name: Upload Coverage
       run: |
@@ -75,11 +74,8 @@ jobs:
       uses: actions/setup-python@v1
       with:
         python-version: ${{ matrix.python-version }}
-    - name: Install dependencies
-      run: |
-        python -m pip install --upgrade pip
-        pip install -r requirements.txt
     - name: Lint with flake8
       run: |
+        python -m pip install --upgrade pip
         pip install flake8
         flake8 . --count --statistics --show-source
diff --git a/pvanalytics/tests/quality/test_data_shifts.py b/pvanalytics/tests/quality/test_data_shifts.py
index d482b003..2c408225 100644
--- a/pvanalytics/tests/quality/test_data_shifts.py
+++ b/pvanalytics/tests/quality/test_data_shifts.py
@@ -3,7 +3,6 @@
 import pytest
 from pvanalytics.quality import data_shifts as dt
 from ..conftest import DATA_DIR, requires_ruptures
-import ruptures
 
 
 test_file_1 = DATA_DIR / "pvlib_data_shift.csv"
@@ -28,6 +27,7 @@ def test_detect_data_shifts(generate_series):
     Unit test that data shifts are correctly identified in the simulated time
     series.
     """
+    import ruptures
     signal_no_index, signal_datetime_index, df_weekly_resample, \
         changepoint_date = generate_series
     # Test that an error is thrown when a Pandas series with no datetime
@@ -62,6 +62,7 @@ def test_detect_data_shifts(generate_series):
     assert (len(shift_index_param.index) == len(signal_datetime_index.index))
 
 
+@requires_ruptures
 def test_get_longest_shift_segment_dates(generate_series):
     """
     Unit test that the longest interval between data shifts is selected for