Skip to content

Add Python 3.12 to test matrix #204

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

Merged
merged 4 commits into from
Feb 8, 2024
Merged
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/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