Skip to content

Commit 1d1528d

Browse files
authored
Fix deprecated pytest imports (#7)
* Fix deprecated pytest raises import * Update pulp_engine variable lower bound definition * Update releases documentation
1 parent e938984 commit 1d1528d

File tree

12 files changed

+26
-12
lines changed

12 files changed

+26
-12
lines changed

docs/release-notes.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ hide:
1212

1313
[//]: # (--------------------------------------------------------------------------------------------------------------)
1414

15+
## [v0.1.3](https://github.com/dapensoft/pyorlib/releases/tag/0.1.3) <small>July 30, 2025</small> { id="0.1.3" }
16+
17+
<hr class="divider">
18+
19+
##### Changed
20+
21+
- Updated the lower bound variable definition in `pulp_engine` to set it to `None` when `-inf` is specified as the lower bound.
22+
23+
##### Fixed
24+
25+
- Updated deprecated `_pytest.python_api.raises` imports in several tests.
26+
27+
[//]: # (--------------------------------------------------------------------------------------------------------------)
28+
1529
## [v0.1.2](https://github.com/dapensoft/pyorlib/releases/tag/0.1.2) <small>April 9, 2024</small> { id="0.1.2" }
1630

1731
<hr class="divider">

src/pyorlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mathematical models in a standardized manner across different optimization packages.
44
"""
55

6-
__version__ = "0.1.2"
6+
__version__ = "0.1.3"
77

88
from .engines import Engine
99
from .model import Model

src/pyorlib/engines/pulp/pulp_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ def __init__(
100100
pulp_var = LpVariable(
101101
name=name,
102102
cat=LpInteger,
103-
lowBound=lower_bound,
103+
lowBound=lower_bound if lower_bound > -inf else None,
104104
upBound=upper_bound if upper_bound < inf else None,
105105
)
106106
elif self.value_type == ValueType.CONTINUOUS:
107107
pulp_var = LpVariable(
108108
name=name,
109109
cat=LpContinuous,
110-
lowBound=lower_bound,
110+
lowBound=lower_bound if lower_bound > -inf else None,
111111
upBound=upper_bound if upper_bound < inf else None,
112112
)
113113
else:

tests/algebra/expressions/test_expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import isclose
22

3-
from _pytest.python_api import raises
3+
from pytest import raises
44

55
from pyorlib.algebra import Element, Expression
66

tests/algebra/terms/constants/test_constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import inf
22

3-
from _pytest.python_api import raises
3+
from pytest import raises
44

55
from pyorlib.algebra import Term, Constant
66
from pyorlib.enums import ValueType, TermType

tests/algebra/terms/test_term.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from math import isclose
22
from typing import Any
33

4-
from _pytest.python_api import raises
4+
from pytest import raises
55

66
from pyorlib.algebra import Element, Expression, Term, Constant
77
from pyorlib.enums import ValueType

tests/algebra/terms/variables/test_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import inf
22

3-
from _pytest.python_api import raises
3+
from pytest import raises
44

55
from pyorlib.algebra import Term, Variable
66
from pyorlib.engines import Engine

tests/model/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from math import inf
22
from typing import List
33

4-
from _pytest.python_api import raises
4+
from pytest import raises
55

66
from pyorlib import Model, Engine
77
from pyorlib.algebra import Term, Element

tests/structures/parameters/test_multi_value_parameter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import inf
22

3-
from _pytest.python_api import raises
3+
from pytest import raises
44

55
from pyorlib.enums import ParameterType, ValueType
66
from pyorlib.structures import MultiValueParameter, Parameter

tests/structures/parameters/test_single_value_parameter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import inf
22

3-
from _pytest.python_api import raises
3+
from pytest import raises
44

55
from pyorlib.enums import ParameterType, ValueType
66
from pyorlib.structures import SingleValueParameter, Parameter

0 commit comments

Comments
 (0)