Skip to content

Commit

Permalink
Add Python 3.12 to test matrix (#204)
Browse files Browse the repository at this point in the history
* Add python 3.12 to CI test matrix

* whatsnew

* don't use pkg_resources anymore
  • Loading branch information
kandersolar authored Feb 8, 2024
1 parent b38dbc2 commit 75df0ad
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
requirements: ['']
include:
- requirements: "-r requirements-min.txt"
Expand Down
6 changes: 3 additions & 3 deletions docs/whatsnew/0.2.0.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _whatsnew_020:

0.2.0 (anticipated December 2023)
-----------------------------
0.2.0 (anticipated February 2024)
---------------------------------

Breaking Changes
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -55,7 +55,7 @@ Documentation

Testing
~~~~~~~
* Added testing for python 3.11. (:pull:`189`)
* Added testing for python 3.11 and 3.12. (:pull:`189`, :pull:`204`)


Contributors
Expand Down
6 changes: 3 additions & 3 deletions pvanalytics/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from pvlib import location, pvsystem
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
from pathlib import Path
from pkg_resources import Requirement, parse_version
from packaging.version import Version
from packaging.specifiers import SpecifierSet

TEST_DIR = Path(__file__).parent
DATA_DIR = TEST_DIR.parent / 'data'
Expand Down Expand Up @@ -46,8 +47,7 @@ def requires_pvlib(versionspec, reason=''):
reason : str, optional
Additional context to show in pytest log output
"""
req = Requirement.parse('pvlib' + versionspec)
is_satisfied = parse_version(pvlib.__version__) in req
is_satisfied = Version(pvlib.__version__) in SpecifierSet(versionspec)
message = 'requires pvlib' + versionspec
if reason:
message += f'({reason})'
Expand Down
6 changes: 3 additions & 3 deletions pvanalytics/tests/test_pvanalytics.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

from pkg_resources import parse_version
from packaging.version import Version
import pvanalytics


def test___version__():
# check that the version string is determined correctly.
# if the version string is messed up for some reason, it should be
# '0+unknown', which is not greater than '0.0.1'.
version = parse_version(pvanalytics.__version__)
assert version > parse_version('0.0.1')
version = Version(pvanalytics.__version__)
assert version > Version('0.0.1')
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
TESTS_REQUIRE = [
'pytest',
'pytest-cov',
'packaging',
]

INSTALL_REQUIRES = [
Expand Down

0 comments on commit 75df0ad

Please sign in to comment.