Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT]: Remove tests from wheel distro #2277

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pytest-remote-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }}
BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }}
BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }}
run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data
run: pytest tests/iotools --cov=./ --cov-report=xml --remote-data

- name: Upload coverage to Codecov
if: matrix.python-version == 3.9 && matrix.suffix == ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
shell: bash -l {0} # necessary for conda env to be active
run: |
# ignore iotools; those tests are run in a separate workflow
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
pytest tests --cov=./ --cov-report=xml --ignore=tests/iotools

- name: Upload coverage to Codecov
if: matrix.python-version == 3.9 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ coverage.xml


# Datafiles
*.csv
# Ignore some csv
!pvlib/data/*.csv
# Do not exclude data directories
!pvlib/data/**
!tests/data/**

# vi
*.swp
Expand Down
11 changes: 6 additions & 5 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ flags:
core:
paths:
- pvlib/
- tests/
- '!pvlib/iotools/'
- '!pvlib/tests/iotools/'
- '!tests/iotools/'
carryforward: false

remote-data:
paths:
- pvlib/iotools/
- pvlib/tests/iotools
- tests/iotools
carryforward: true # if not run, use coverage from previous commit


Expand All @@ -47,15 +48,15 @@ coverage:
tests-core:
target: 95%
paths:
- 'pvlib/tests/.*'
- '!pvlib/tests/iotools/.*'
- 'tests/.*'
- '!tests/iotools/.*'
flags:
- core

tests-remote-data:
target: 95%
paths:
- 'pvlib/tests/iotools/.*'
- 'tests/iotools/.*'
flags:
- remote-data

Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx/source/contributing/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Overview
Developers **must** include comprehensive tests for any additions or
modifications to pvlib. New unit test code should be placed in the
corresponding test module in the
`pvlib/tests <https://github.com/pvlib/pvlib-python/tree/main/pvlib/tests>`_
`tests <https://github.com/pvlib/pvlib-python/tree/main/tests>`_
directory.

A pull request will automatically run the tests for you on a variety of
Expand All @@ -30,11 +30,11 @@ pvlib directory::

or, for a single module::

pytest pvlib/tests/test_clearsky.py
pytest tests/test_clearsky.py

or, for a single test::

pytest pvlib/tests/test_clearsky.py::test_ineichen_nans
pytest tests/test_clearsky.py::test_ineichen_nans

We suggest using pytest's ``--pdb`` flag to debug test failures rather
than using ``print`` or ``logging`` calls. For example::
Expand Down
10 changes: 10 additions & 0 deletions docs/sphinx/source/whatsnew/v0.11.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Deprecations

Enhancements
~~~~~~~~~~~~
* Reduced space requirements by excluding tests and test files from wheel.
Zipped wheel is now 66% of the previous size, and installed size is 50% of
the previous size.
(:issue:`2271`, :pull:`2277`)
* Add :py:func:`~pvlib.atmosphere.rh_from_tdew` and :py:func:`~pvlib.atmosphere.tdew_from_rh`.
(:issue:`1744`, :pull:`2286`)
* :py:func:`~pvlib.ivtools.sdm.fit_desoto` now allows input of initial
Expand Down Expand Up @@ -63,6 +67,12 @@ Documentation

Testing
~~~~~~~
* Moved tests folder to `/tests` and data exclusively used for testing to `/tests/data`.
(:issue:`2271`, :pull:`2277`)

Requirements
~~~~~~~~~~~~

* Update test files to track new PVGIS 5.3 data. (:pull:`2305`)

Maintenance
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/whatsnew/v0.7.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Bug fixes
* Fix :py:func:`~pvlib.iotools.read_tmy3` parsing when February contains
a leap year. (:pull:`866`)
* Implement NREL Developer Network API key for consistent success with API
calls in :py:mod:`pvlib.tests.iotools.test_psm3`. (:pull:`873`)
calls in `pvlib.tests.iotools.test_psm3`. (:pull:`873`)
* Fix issue with :py:class:`pvlib.location.Location` creation when
passing ``tz=datetime.timezone.utc``. (:pull:`879`)
* Fix documentation homepage title to "pvlib python" based on first heading on
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,22 @@ all = ["pvlib[test,optional,doc]"]
Documentation = "https://pvlib-python.readthedocs.io/"
"Source Code" = "https://github.com/pvlib/pvlib-python"

[tool.setuptools]
# do not include all non-python files in the bdist by default, but select them manually
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html#interplay-between-these-keywords (2024-10-22)
include-package-data = false # true by default

[tool.setuptools.packages.find]
include = ["pvlib*"]

[tool.setuptools.package-data]
pvlib = ["data/*"]

[tool.setuptools_scm]

[tool.pytest]
junit_family = "xunit2"
testpaths = "pvlib/tests"
testpaths = "tests"
# warning messages to suppress from pytest output. useful in cases
# where a dependency hasn't addressed a deprecation yet, and there's
# nothing we can do to fix it ourselves.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import pandas as pd
from pvlib.bifacial import infinite_sheds
from ..conftest import assert_series_equal
from tests.conftest import assert_series_equal

import pytest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd
from datetime import datetime
from pvlib.bifacial.pvfactors import pvfactors_timeseries
from ..conftest import requires_pvfactors, assert_series_equal
from tests.conftest import requires_pvfactors, assert_series_equal
import pytest


Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion pvlib/tests/conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def assert_frame_equal(left, right, **kwargs):

# commonly used directories in the tests
TEST_DIR = Path(__file__).parent
DATA_DIR = TEST_DIR.parent / 'data'
PVLIB_DATA_DIR = Path(pvlib.__path__[0]) / 'data'
TESTS_DATA_DIR = TEST_DIR / 'data'


# pytest-rerunfailures variables
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading