Skip to content

Commit

Permalink
Merge branch 'main' into pnast/feature/mic-5710-typing-mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
patricktnast authored Feb 5, 2025
2 parents c0fe6c5 + a05c041 commit 70dd6f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
**3.2.20 - 02/03/25**
**3.2.20 - 02/05/25**

- Remove tests/framework/components/mocks.py

- Get python versions from python_versions.json

**3.2.19 - 02/03/25**

- Type-hinting: Fix mypy errors in tests/framework/artifact/test_hdf.py
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Updating the shared repo will take affect on the next pipeline invocation.
The "_" denotes that all modules will be imported from the shared library.
*/
@Library("vivarium_build_utils") _
reusable_pipeline(scheduled_branches: ["main"], python_versions: ["3.10", "3.11"], upstream_repos: ["layered_config_tree"])
reusable_pipeline(scheduled_branches: ["main"], upstream_repos: ["layered_config_tree"])
1 change: 1 addition & 0 deletions python_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["3.10", "3.11"]
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import json
import sys

min_version, max_version = ((3, 8), "3.8"), ((3, 11), "3.11")
from packaging.version import parse

if not (min_version[0] <= sys.version_info[:2] <= max_version[0]):
with open("python_versions.json", "r") as f:
supported_python_versions = json.load(f)

python_versions = [parse(v) for v in supported_python_versions]
min_version = min(python_versions)
max_version = max(python_versions)

if not (
min_version <= parse(".".join([str(v) for v in sys.version_info[:2]])) <= max_version
):
# Python 3.5 does not support f-strings
py_version = ".".join([str(v) for v in sys.version_info[:3]])
error = (
"\n----------------------------------------\n"
"Error: Vivarium runs under python {min_version}-{max_version}.\n"
"You are running python {py_version}".format(
min_version=min_version[1], max_version=max_version[1], py_version=py_version
min_version=min_version, max_version=max_version, py_version=py_version
)
)
print(error, file=sys.stderr)
Expand Down

0 comments on commit 70dd6f1

Please sign in to comment.