diff --git a/README.rst b/README.rst index 5f58b8cd11..8b24edd787 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,7 @@ possible. Development Site ================ -The current development version is 2.6.0b1. The current stable version is +The current development version is 2.6.0b2. The current stable version is 2.5.1. The `latest Cantera source code `_, the `issue tracker `_ for bugs and enhancement requests, `downloads of Cantera releases and binary installers diff --git a/SConstruct b/SConstruct index 0381fd96b1..9874f18b9e 100644 --- a/SConstruct +++ b/SConstruct @@ -872,7 +872,7 @@ for arg in ARGUMENTS: logger.error(f"Encountered unexpected command line option: '{arg}'") sys.exit(1) -env["cantera_version"] = "2.6.0b1" +env["cantera_version"] = "2.6.0b2" # For use where pre-release tags are not permitted (MSI, sonames) env['cantera_pure_version'] = re.match(r'(\d+\.\d+\.\d+)', env['cantera_version']).group(0) env['cantera_short_version'] = re.match(r'(\d+\.\d+)', env['cantera_version']).group(0) diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index ebd204021a..1628911b97 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = Cantera # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.6.0b1 +PROJECT_NUMBER = 2.6.0b2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/interfaces/cython/cantera/ck2yaml.py b/interfaces/cython/cantera/ck2yaml.py index 7691f36be2..69a67076b0 100644 --- a/interfaces/cython/cantera/ck2yaml.py +++ b/interfaces/cython/cantera/ck2yaml.py @@ -1902,7 +1902,7 @@ def write_yaml(self, name='gas', out_name='mech.yaml'): metadata = BlockMap([ ("generator", "ck2yaml"), ("input-files", FlowList(files)), - ("cantera-version", "2.6.0b1"), + ("cantera-version", "2.6.0b2"), ("date", formatdate(localtime=True)), ]) if desc.strip(): diff --git a/interfaces/cython/cantera/cti2yaml.py b/interfaces/cython/cantera/cti2yaml.py index a38c093f7e..7976942059 100644 --- a/interfaces/cython/cantera/cti2yaml.py +++ b/interfaces/cython/cantera/cti2yaml.py @@ -1661,7 +1661,7 @@ def convert(filename=None, output_name=None, text=None, encoding="latin-1"): # information regarding conversion metadata = BlockMap([ ("generator", "cti2yaml"), - ("cantera-version", "2.6.0b1"), + ("cantera-version", "2.6.0b2"), ("date", formatdate(localtime=True)), ]) if filename != "": diff --git a/interfaces/cython/cantera/ctml2yaml.py b/interfaces/cython/cantera/ctml2yaml.py index eae0a67c42..e3ede9cbcb 100644 --- a/interfaces/cython/cantera/ctml2yaml.py +++ b/interfaces/cython/cantera/ctml2yaml.py @@ -2641,7 +2641,7 @@ def convert( metadata = BlockMap( { "generator": "ctml2yaml", - "cantera-version": "2.6.0b1", + "cantera-version": "2.6.0b2", "date": formatdate(localtime=True), } ) diff --git a/interfaces/python_minimal/SConscript b/interfaces/python_minimal/SConscript index c764bd3645..3a2a5fd353 100644 --- a/interfaces/python_minimal/SConscript +++ b/interfaces/python_minimal/SConscript @@ -1,6 +1,8 @@ """Minimal Python Module""" from pathlib import Path from buildutils import * +import json +import re Import('env', 'build', 'install') @@ -32,7 +34,6 @@ localenv.Depends(mod, [make_setup, readme, license, "setup.py", "pyproject.toml" install_cmd = ["$python_cmd_esc", "-m", "pip", "install"] user_install = False python_prefix = None -python_root = None if localenv["PYTHON_INSTALLER"] == "direct": if localenv["python_prefix"] == "USER": # Install to the OS-dependent user site-packages directory @@ -40,9 +41,49 @@ if localenv["PYTHON_INSTALLER"] == "direct": user_install = True elif localenv["python_prefix"]: # A specific location for the Cantera python module has been given - install_cmd.extend((f"--prefix={localenv.subst('python_prefix')}", + install_cmd.extend((f"--prefix={localenv.subst('$python_prefix')}", "--no-warn-script-location")) - python_prefix = localenv.subst("python_prefix") + python_prefix = localenv.subst("$python_prefix") + elif not env["default_prefix"]: + install_cmd.append(f"--prefix={env['prefix']}") + python_prefix = env["prefix"] + +# Get information about installation paths +script = """\ +import json +import site +vars = { + "site_packages": site.getsitepackages(), + "user_site_packages": site.getusersitepackages(), +} +print(json.dumps(vars)) +""" +info = json.loads(get_command_output(localenv["python_cmd"], "-c", script)) +site_packages = info["site_packages"] +user_site_packages = info["user_site_packages"] + +# Check for existing Python module installation. Allow pip to remove an existing +# installation only if we're installing to the same location. Also disable +# uninstallation if we're installing to a staging directory. +if env["stage_dir"]: + install_cmd.append("--ignore-installed") +else: + info = get_command_output( + localenv["python_cmd"], "-m", "pip", "show", "cantera-minimal", + ignore_errors=True + ) + + if user_install: + test_prefix = Path(user_site_packages).parents[2] + elif python_prefix is None: + test_prefix = Path(site_packages[0]).parents[2] + else: + test_prefix = Path(python_prefix) + + match = re.search(r"Location: (.*)\n", info, re.MULTILINE) + existing_prefix = Path(match.group(1)).parents[2] if match else None + if existing_prefix and existing_prefix != test_prefix: + install_cmd.append("--ignore-installed") if env["stage_dir"]: # Get the absolute path to the stage directory. If the stage directory is a relative