Skip to content

Commit de52119

Browse files
committed
Revert "Upgrade to Python 3.10"
This reverts commit 2537833. Python 3.9 is useful to keep for PyJobShop.
1 parent 2537833 commit de52119

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

psplib/parse.py

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

34
from .parse_mplib import parse_mplib
45
from .parse_patterson import parse_patterson
@@ -8,7 +9,7 @@
89

910

1011
def parse(
11-
loc: str | Path,
12+
loc: Union[str, Path],
1213
instance_format: str = "psplib",
1314
) -> ProjectInstance:
1415
"""

psplib/parse_mplib.py

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

34
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
45

56

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

psplib/parse_patterson.py

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

34
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
45

56

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

psplib/parse_psplib.py

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

45
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
56

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

1415

15-
def parse_psplib(loc: str | Path) -> ProjectInstance:
16+
def parse_psplib(loc: Union[str, Path]) -> ProjectInstance:
1617
"""
1718
Parses an PSPLIB-formatted instance from a file.
1819
@@ -41,7 +42,7 @@ def parse_psplib(loc: str | Path) -> ProjectInstance:
4142
]
4243
resources = [
4344
Resource(capacity, is_renewable)
44-
for capacity, is_renewable in zip(capacities, renewable, strict=False)
45+
for capacity, is_renewable in zip(capacities, renewable)
4546
]
4647
num_resources = len(resources)
4748

psplib/parse_rcpsp_max.py

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

34
from .ProjectInstance import Activity, Mode, Project, ProjectInstance, Resource
45

56

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

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.10"
24+
requires-python = ">=3.9"
2525
dependencies = []
2626

2727

0 commit comments

Comments
 (0)