Skip to content

Commit 3b6b657

Browse files
authored
Merge pull request #44 from gunthercox/python
Add support for Python 3.14
2 parents 1336e43 + 2f25c25 commit 3b6b657

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
19+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
2020

2121
steps:
2222
- uses: actions/checkout@v2

mathparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
mathparse is a library for solving mathematical equations contained in strings
33
"""
44

5-
__version__ = '0.2.6'
5+
__version__ = '0.2.7'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version = {attr = "mathparse.__version__"}
1212

1313
[project]
1414
name = "mathparse"
15-
requires-python = ">=3.9,<3.14"
15+
requires-python = ">=3.9,<3.15"
1616
urls = { Documentation = "https://mathparse.chatterbot.us", Repository = "https://github.com/gunthercox/mathparse", Changelog = "https://github.com/gunthercox/mathparse/releases" }
1717
authors = [
1818
{name = "Gunther Cox"},

tests/test_prefix_unary_operations.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ def test_sqrt_with_negative_causes_math_error(self):
155155
# Verify it causes the expected math error
156156
with self.assertRaises(ValueError) as context:
157157
mathparse.parse('sqrt -16')
158-
self.assertIn("math domain error", str(context.exception).lower())
158+
# Python 3.14+ uses more specific error messages
159+
error_msg = str(context.exception).lower()
160+
self.assertTrue(
161+
"math domain error" in error_msg or
162+
"expected a nonnegative input" in error_msg,
163+
f"Unexpected error message: {error_msg}"
164+
)
159165

160166
def test_log_with_negative_causes_math_error(self):
161167
"""
@@ -168,7 +174,13 @@ def test_log_with_negative_causes_math_error(self):
168174
# Verify it causes the expected math error
169175
with self.assertRaises(ValueError) as context:
170176
mathparse.parse('log -10')
171-
self.assertIn("math domain error", str(context.exception).lower())
177+
# Python 3.14+ uses more specific error messages
178+
error_msg = str(context.exception).lower()
179+
self.assertTrue(
180+
"math domain error" in error_msg or
181+
"expected a positive input" in error_msg,
182+
f"Unexpected error message: {error_msg}"
183+
)
172184

173185
def test_sqrt_with_positive_after_operator(self):
174186
"""

0 commit comments

Comments
 (0)