diff --git a/.ci_support/linux_64_build_variantpyqtpython3.10.____cpython.yaml b/.ci_support/linux_64_build_variantpyqtpython3.10.____cpython.yaml index 09f8c86..f8a29f0 100644 --- a/.ci_support/linux_64_build_variantpyqtpython3.10.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyqtpython3.10.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.10.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyqtpython3.11.____cpython.yaml b/.ci_support/linux_64_build_variantpyqtpython3.11.____cpython.yaml index f224f43..aa203e4 100644 --- a/.ci_support/linux_64_build_variantpyqtpython3.11.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyqtpython3.11.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.11.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyqtpython3.12.____cpython.yaml b/.ci_support/linux_64_build_variantpyqtpython3.12.____cpython.yaml index 0534d1c..a15d5d0 100644 --- a/.ci_support/linux_64_build_variantpyqtpython3.12.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyqtpython3.12.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.12.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyqtpython3.9.____cpython.yaml b/.ci_support/linux_64_build_variantpyqtpython3.9.____cpython.yaml index 32d37f3..e4e8a63 100644 --- a/.ci_support/linux_64_build_variantpyqtpython3.9.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyqtpython3.9.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.9.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyside6python3.10.____cpython.yaml b/.ci_support/linux_64_build_variantpyside6python3.10.____cpython.yaml index 85f36ac..a66ec11 100644 --- a/.ci_support/linux_64_build_variantpyside6python3.10.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyside6python3.10.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.10.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyside6python3.11.____cpython.yaml b/.ci_support/linux_64_build_variantpyside6python3.11.____cpython.yaml index cddd8be..c7187d1 100644 --- a/.ci_support/linux_64_build_variantpyside6python3.11.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyside6python3.11.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.11.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyside6python3.12.____cpython.yaml b/.ci_support/linux_64_build_variantpyside6python3.12.____cpython.yaml index 6e18e19..ac459e9 100644 --- a/.ci_support/linux_64_build_variantpyside6python3.12.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyside6python3.12.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.12.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/linux_64_build_variantpyside6python3.9.____cpython.yaml b/.ci_support/linux_64_build_variantpyside6python3.9.____cpython.yaml index 5a52eea..a167c79 100644 --- a/.ci_support/linux_64_build_variantpyside6python3.9.____cpython.yaml +++ b/.ci_support/linux_64_build_variantpyside6python3.9.____cpython.yaml @@ -15,6 +15,6 @@ pin_run_as_build: python: - 3.9.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - linux-64 diff --git a/.ci_support/osx_64_build_variantpyqtpython3.10.____cpython.yaml b/.ci_support/osx_64_build_variantpyqtpython3.10.____cpython.yaml index f5cdb6f..1e76adb 100644 --- a/.ci_support/osx_64_build_variantpyqtpython3.10.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyqtpython3.10.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.10.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyqtpython3.11.____cpython.yaml b/.ci_support/osx_64_build_variantpyqtpython3.11.____cpython.yaml index 90d2d64..ba13c43 100644 --- a/.ci_support/osx_64_build_variantpyqtpython3.11.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyqtpython3.11.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.11.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyqtpython3.12.____cpython.yaml b/.ci_support/osx_64_build_variantpyqtpython3.12.____cpython.yaml index cbaa257..6e5b83b 100644 --- a/.ci_support/osx_64_build_variantpyqtpython3.12.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyqtpython3.12.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.12.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyqtpython3.9.____cpython.yaml b/.ci_support/osx_64_build_variantpyqtpython3.9.____cpython.yaml index 6c200d4..cdebfbd 100644 --- a/.ci_support/osx_64_build_variantpyqtpython3.9.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyqtpython3.9.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.9.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyside6python3.10.____cpython.yaml b/.ci_support/osx_64_build_variantpyside6python3.10.____cpython.yaml index cec22f4..582bed8 100644 --- a/.ci_support/osx_64_build_variantpyside6python3.10.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyside6python3.10.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.10.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyside6python3.11.____cpython.yaml b/.ci_support/osx_64_build_variantpyside6python3.11.____cpython.yaml index 58a5643..584fb48 100644 --- a/.ci_support/osx_64_build_variantpyside6python3.11.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyside6python3.11.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.11.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyside6python3.12.____cpython.yaml b/.ci_support/osx_64_build_variantpyside6python3.12.____cpython.yaml index 0665999..48adaf5 100644 --- a/.ci_support/osx_64_build_variantpyside6python3.12.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyside6python3.12.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.12.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.ci_support/osx_64_build_variantpyside6python3.9.____cpython.yaml b/.ci_support/osx_64_build_variantpyside6python3.9.____cpython.yaml index bd260ce..fc9e64c 100644 --- a/.ci_support/osx_64_build_variantpyside6python3.9.____cpython.yaml +++ b/.ci_support/osx_64_build_variantpyside6python3.9.____cpython.yaml @@ -17,6 +17,6 @@ pin_run_as_build: python: - 3.9.* *_cpython python_min: -- '3.10' +- '3.9' target_platform: - osx-64 diff --git a/.gitignore b/.gitignore index 179afe5..47b5408 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,8 @@ /build_artifacts *.pyc + +# Rattler-build's artifacts are in `output` when not specifying anything. +/output +# Pixi's configuration +.pixi diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 00f377a..6ee04aa 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -12,7 +12,7 @@ source .scripts/logging_utils.sh set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -PROVIDER_DIR="$(basename $THISDIR)" +PROVIDER_DIR="$(basename "$THISDIR")" FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" diff --git a/build-locally.py b/build-locally.py index c4a56c6..9dfe440 100755 --- a/build-locally.py +++ b/build-locally.py @@ -10,6 +10,7 @@ import os import platform import subprocess +import sys from argparse import ArgumentParser @@ -44,10 +45,19 @@ def run_osx_build(ns): subprocess.check_call([script]) +def run_win_build(ns): + script = ".scripts/run_win_build.bat" + subprocess.check_call(["cmd", "/D", "/Q", "/C", f"CALL {script}"]) + + def verify_config(ns): + choices_filter = ns.filter or "*" valid_configs = { - os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + os.path.basename(f)[:-5] + for f in glob.glob(f".ci_support/{choices_filter}.yaml") } + if choices_filter != "*": + print(f"filtering for '{choices_filter}.yaml' configs") print(f"valid configs are {valid_configs}") if ns.config in valid_configs: print("Using " + ns.config + " configuration") @@ -60,38 +70,43 @@ def verify_config(ns): selections = list(enumerate(sorted(valid_configs), 1)) for i, c in selections: print(f"{i}. {c}") - s = input("\n> ") + try: + s = input("\n> ") + except KeyboardInterrupt: + print("\nno option selected, bye!", file=sys.stderr) + sys.exit(1) idx = int(s) - 1 ns.config = selections[idx][1] print(f"selected {ns.config}") else: raise ValueError("config " + ns.config + " is not valid") - # Remove the following, as implemented - if ns.config.startswith("win"): - raise ValueError( - f"only Linux/macOS configs currently supported, got {ns.config}" + if ( + ns.config.startswith("osx") + and platform.system() == "Darwin" + and not os.environ.get("OSX_SDK_DIR") + ): + raise RuntimeError( + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) - elif ns.config.startswith("osx"): - if "OSX_SDK_DIR" not in os.environ: - raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " - "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " - "Note: OSX_SDK_DIR must be set to an absolute path. " - "Setting this variable implies agreement to the licensing terms of the SDK by Apple." - ) def main(args=None): p = ArgumentParser("build-locally") p.add_argument("config", default=None, nargs="?") + p.add_argument( + "--filter", + default=None, + help="Glob string to filter which build choices are presented in interactive mode.", + ) p.add_argument( "--debug", action="store_true", help="Setup debug environment using `conda debug`", ) - p.add_argument( - "--output-id", help="If running debug, specify the output to setup." - ) + p.add_argument("--output-id", help="If running debug, specify the output to setup.") ns = p.parse_args(args=args) verify_config(ns) @@ -104,10 +119,10 @@ def main(args=None): run_docker_build(ns) elif ns.config.startswith("osx"): run_osx_build(ns) + elif ns.config.startswith("win"): + run_win_build(ns) finally: - recipe_license_file = os.path.join( - "recipe", "recipe-scripts-license.txt" - ) + recipe_license_file = os.path.join("recipe", "recipe-scripts-license.txt") if os.path.exists(recipe_license_file): os.remove(recipe_license_file) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index e756ee2..4f1798a 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,5 +1,3 @@ build_variant: - "pyqt" - "pyside6" -python_min: - - "3.10" diff --git a/recipe/menu/open_prompt.bat b/recipe/menu/open_prompt.bat index 0b087b0..619dda6 100755 --- a/recipe/menu/open_prompt.bat +++ b/recipe/menu/open_prompt.bat @@ -1,7 +1,16 @@ :: This is used to initialize the bash prompt on Windows. @ECHO OFF -call %__PREFIX__%\Scripts\Activate.bat +:: Workaround for +:: https://github.com/conda/conda/issues/14884 +set "CONDA_EXE=#PREFIX#\Scripts\conda.exe" +call "#PREFIX#\Scripts\Activate.bat" +:: Find first Python on path. +FOR /F "tokens=*" %%g IN ('where python') do ( + SET PYPATH=%%g + goto :endloop +) +:endloop FOR /F "tokens=*" %%g IN ('python --version') do (SET PYVER=%%g) FOR /F "tokens=*" %%g IN ('where python') do (SET PYPATH=%%g) FOR /F "tokens=*" %%g IN ('mne --version') do (SET MNEVER=%%g) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 86c433e..03dba97 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,8 @@ {% set name = "mne-python" %} {% set version = "1.9.0" %} {% set sha256 = "101967698b005a7f9071586e0469aebc83fe06f48717a95f3382a6f99c591162" %} -{% set build = 1 %} +{% set build = 2 %} +{% set python_min = "3.10" %} # Adapted from https://github.com/conda-forge/vtk-feedstock/blob/main/recipe/meta.yaml # PySide6 is lower priority than PyQt5 for backward compat (e.g., with matplotlib, @@ -20,7 +21,6 @@ source: build: number: {{ build }} - string: "{{ build_variant }}_h{{ PKG_HASH }}_{{ build }}" outputs: - name: mne-base @@ -49,7 +49,6 @@ outputs: - decorator - packaging - jinja2 - - importlib_resources >=5.10.2 # [py<=39] - lazy_loader >=0.3 test: @@ -59,15 +58,20 @@ outputs: - pip check # [not win] - mne --version requires: + - python {{ python_min }} - pip - name: mne build: - string: "{{ build_variant }}_h{{ PKG_HASH }}_{{ build }}" + string: "osx_{{ build_variant }}_h{{ PKG_HASH }}_{{ build }}" # [osx] + string: "linux_{{ build_variant }}_h{{ PKG_HASH }}_{{ build }}" # [linux] noarch: python requirements: + host: + - python {{ python_min }} run: + - python >={{ python_min }} - {{ pin_subpackage('mne-base', max_pin="x.x.x.x") }} - __osx # [osx] - pyobjc-framework-cocoa >=5.2.0 # [osx] # for setting Dock icons etc @@ -117,6 +121,7 @@ outputs: - pip check # [not win] - mne --version requires: + - python {{ python_min }} - pip - name: mne-installer-menus