Skip to content

Commit

Permalink
Fix requirements for maximal python version (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker authored Jun 25, 2023
1 parent 74e9f55 commit 9593260
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.8,<=3.11"
requires-python = ">=3.8,<3.12"
dynamic = ["version"]

keywords = ["pdes", "partial-differential-equations", "dynamical-systems"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/_templates/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=$MIN_PYTHON_VERSION,<=$MAX_PYTHON_VERSION"
requires-python = ">=$MIN_PYTHON_VERSION,<$MAX_PYTHON_VERSION_NEXT"
dynamic = ["version"]

keywords = ["pdes", "partial-differential-equations", "dynamical-systems"]
Expand Down
5 changes: 5 additions & 0 deletions scripts/create_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,16 @@ def write_from_template(
with template_path.open("r") as fp:
template = Template(fp.read())

# parse python version
major, minor = MAX_PYTHON_VERSION.split(".")
minor_next = int(minor) + 1

# determine template substitutes
substitutes = {
"MIN_PYTHON_VERSION": MIN_PYTHON_VERSION,
"MIN_PYTHON_VERSION_NODOT": MIN_PYTHON_VERSION.replace(".", ""),
"MAX_PYTHON_VERSION": MAX_PYTHON_VERSION,
"MAX_PYTHON_VERSION_NEXT": f"{major}.{minor_next}",
}
if requirements:
req_list = (
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ importlib-metadata>=5
isort>=5.1
jupyter_contrib_nbextensions>=0.5
mypy>=0.770
nbconvert>=5
pyinstrument>=3
pytest>=5.4
pytest-cov>=2.8
Expand Down

0 comments on commit 9593260

Please sign in to comment.