Skip to content

Commit

Permalink
Delete requirements.txt; related CI & test changes (#149)
Browse files Browse the repository at this point in the history
* delete requirements.txt

* add pytest-cov to tests_require

* rework CI config

* don't globally import ruptures in tests

* more ruptures fix

* install [optional] as well as [test]

* nix reference to requirements.txt in sphinx docs
  • Loading branch information
kandersolar authored Aug 15, 2022
1 parent 61e0f54 commit 76a8ccc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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: |
Expand Down Expand Up @@ -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
3 changes: 0 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
========
Expand Down
3 changes: 2 additions & 1 deletion pvanalytics/tests/quality/test_data_shifts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

TESTS_REQUIRE = [
'pytest',
'pytest-cov',
]

INSTALL_REQUIRES = [
Expand Down

0 comments on commit 76a8ccc

Please sign in to comment.