Skip to content

Commit 2537833

Browse files
committed
Upgrade to Python 3.10
1 parent f42d4a8 commit 2537833

File tree

6 files changed

+7
-12
lines changed

6 files changed

+7
-12
lines changed

psplib/parse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from pathlib import Path
2-
from typing import Union
32

43
from .parse_mplib import parse_mplib
54
from .parse_patterson import parse_patterson
@@ -9,7 +8,7 @@
98

109

1110
def parse(
12-
loc: Union[str, Path],
11+
loc: str | Path,
1312
instance_format: str = "psplib",
1413
) -> ProjectInstance:
1514
"""

psplib/parse_mplib.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from pathlib import Path
2-
from typing import Union
32

43
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
54

65

7-
def parse_mplib(loc: Union[str, Path]) -> ProjectInstance:
6+
def parse_mplib(loc: str | Path) -> ProjectInstance:
87
"""
98
Parses a multi-project resource-constrained project scheduling problem
109
instances from MPLIB.

psplib/parse_patterson.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from pathlib import Path
2-
from typing import Union
32

43
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
54

65

7-
def parse_patterson(loc: Union[str, Path]) -> ProjectInstance:
6+
def parse_patterson(loc: str | Path) -> ProjectInstance:
87
"""
98
Parses a Patterson-formatted instance. This format is used for pure
109
resource-constrained project scheduling problem (RCPSP) instances.

psplib/parse_psplib.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import re
22
from pathlib import Path
3-
from typing import Union
43

54
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
65

@@ -13,7 +12,7 @@ def _find(lines: list[str], pattern: str) -> int:
1312
raise ValueError(f"Pattern '{pattern}' not found in lines.")
1413

1514

16-
def parse_psplib(loc: Union[str, Path]) -> ProjectInstance:
15+
def parse_psplib(loc: str | Path) -> ProjectInstance:
1716
"""
1817
Parses an PSPLIB-formatted instance from a file.
1918
@@ -42,7 +41,7 @@ def parse_psplib(loc: Union[str, Path]) -> ProjectInstance:
4241
]
4342
resources = [
4443
Resource(capacity, is_renewable)
45-
for capacity, is_renewable in zip(capacities, renewable)
44+
for capacity, is_renewable in zip(capacities, renewable, strict=False)
4645
]
4746
num_resources = len(resources)
4847

psplib/parse_rcpsp_max.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from pathlib import Path
2-
from typing import Union
32

43
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
54

65

7-
def parse_rcpsp_max(loc: Union[str, Path]) -> ProjectInstance:
6+
def parse_rcpsp_max(loc: str | Path) -> ProjectInstance:
87
"""
98
Parses the RCPSP/max instance format.
109

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
"License :: OSI Approved :: MIT License",
2222
"Programming Language :: Python :: 3",
2323
]
24-
requires-python = ">=3.9"
24+
requires-python = ">=3.10"
2525
dependencies = []
2626

2727

0 commit comments

Comments
 (0)