diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d9f4f2f80 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +pixi.lock filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index aa363f426..5b1a2d903 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -17,15 +17,15 @@ jobs: matrix: os: [ubuntu-latest] mpi-version: [mpich] - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["py310", "py311", "py312", "py313"] comms-type: [m, l] include: - os: macos-latest - python-version: "3.11" + python-version: "py311" mpi-version: mpich comms-type: m - os: macos-latest - python-version: "3.11" + python-version: "py311" mpi-version: mpich comms-type: l @@ -39,46 +39,24 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v5 - - name: Setup conda - Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v3 + - uses: actions/checkout@v4 with: - activate-environment: condaenv - miniconda-version: "latest" - python-version: ${{ matrix.python-version }} - channels: conda-forge - channel-priority: strict - auto-update-conda: true - - - name: Force-update certifi and pip - run: | - python --version - python -m pip install --upgrade pip - python -m pip install -I --upgrade certifi - - - name: Install Ubuntu compilers - if: matrix.os == 'ubuntu-latest' - run: | - conda install -c conda-forge gcc_linux-64 - pip install nlopt==2.9.0 + lfs: true - # Roundabout solution on macos for proper linking with mpicc - - name: Install macOS compilers - if: matrix.os == 'macos-latest' - run: | - conda install clang_osx-64 - pip install nlopt==2.8.0 + - name: Checkout lockfile + run: git lfs checkout - - name: Install basic testing/feature dependencies - run: | - pip install -r install/testing_requirements.txt - pip install -r install/misc_feature_requirements.txt - source install/install_ibcdfo.sh - conda install numpy scipy + - uses: prefix-dev/setup-pixi@v0.9.2 + with: + pixi-version: v0.55.0 + cache: true + frozen: true + environments: ${{ matrix.python-version }} + activate-environment: ${{ matrix.python-version }} - - name: Install mpi4py and MPI from conda + - name: Install IBCDFO run: | - conda install mpi4py ${{ matrix.mpi-version }} + pixi run -e ${{ matrix.python-version }} ./install/install_ibcdfo.sh - name: Install libEnsemble, test flake8 run: | @@ -86,19 +64,19 @@ jobs: flake8 libensemble - name: Remove various tests on newer pythons - if: matrix.python-version >= '3.11' + if: matrix.python-version == 'py311' || matrix.python-version == 'py312' || matrix.python-version == 'py313' run: | - rm ./libensemble/tests/functionality_tests/test_local_sine_tutorial*.py # matplotlib errors on 3.12 + rm ./libensemble/tests/functionality_tests/test_local_sine_tutorial*.py # matplotlib errors on py312 - name: Run simple tests, Ubuntu if: matrix.os == 'ubuntu-latest' run: | - ./libensemble/tests/run_tests.py -A "-W error" -${{ matrix.comms-type }} + ./libensemble/tests/run_tests.py -A "-W error" -${{ matrix.comms-type }} - name: Run simple tests, macOS if: matrix.os == 'macos-latest' run: | - ./libensemble/tests/run_tests.py -A "-W error" -${{ matrix.comms-type }} + pixi run -e ${{ matrix.python-version }} ./libensemble/tests/run_tests.py -A "-W error" -${{ matrix.comms-type }} - name: Merge coverage run: | diff --git a/docs/conf.py b/docs/conf.py index 7686b741f..0b7e2b3dd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,7 +31,7 @@ def __getattr__(cls, name): return MagicMock() -autodoc_mock_imports = ["ax", "balsam", "gpcam", "IPython", "matplotlib", "pandas", "scipy", "surmise"] +autodoc_mock_imports = ["ax", "gpcam", "IPython", "matplotlib", "pandas", "scipy", "surmise"] MOCK_MODULES = [ "argparse", diff --git a/pixi.lock b/pixi.lock new file mode 100644 index 000000000..e4a46c635 --- /dev/null +++ b/pixi.lock @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11ec013d45f87d4e4ff63ee18827bd3ed29f4c8d261ef8b22e9777a43f6e1230 +size 1336004 diff --git a/pyproject.toml b/pyproject.toml index 80535d8cb..3e802269b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,37 +50,74 @@ version = {attr = "libensemble.version.__version__"} [tool.pixi.project] channels = ["conda-forge"] -platforms = ["osx-arm64", "linux-64", "osx-64"] +platforms = ["osx-arm64", "osx-64", "linux-64"] [tool.pixi.pypi-dependencies] libensemble = { path = ".", editable = true } [tool.pixi.environments] default = [] -dev = ["dev"] +basic = ["basic"] +extra = ["basic", "extra"] +docs = ["docs", "basic"] +dev = ["dev", "basic", "extra", "docs"] + +# CI environments +py310 = ["py310", "basic"] +py311 = ["py311", "basic"] +py312 = ["py312", "basic"] +py313 = ["py313", "basic"] + +py310e = ["py310", "py310e", "basic", "extra"] +py311e = ["py311", "py311e", "basic", "extra"] +py312e = ["py312", "py312e", "basic", "extra"] +py313e = ["py313", "py313e", "basic", "extra"] + +# Extra tools for dev environment [tool.pixi.feature.dev.dependencies] +pre-commit = ">=4.1.0,<5" +git-lfs = ">=3.6.1,<4" + +# Basic dependencies for basic CI +[tool.pixi.feature.basic.dependencies] mpi = ">=1.0.1,<2" -mpich = ">=4.3.0,<5" +mpich = ">=4.0.0,<5" mpi4py = ">=4.0.3,<5" -flake8 = ">=7.2.0,<8" -coverage = ">=7.8.0,<8" -pytest = ">=8.3.5,<9" -pytest-cov = ">=6.1.1,<7" +nlopt = "<=2.8.0" +scipy = ">=1.13,<2" +mpmath = ">=1.3.0,<2" + +# "dev" dependencies needed for basic CI +flake8 = ">=7.1.2,<8" +coverage = ">=7.6.12,<8" +pytest = ">=8.3.4,<9" +pytest-cov = ">=6.0.0,<7" pytest-timeout = ">=2.3.1,<3" mock = ">=5.2.0,<6" python-dateutil = ">=2.9.0.post0,<3" -anyio = ">=4.9.0,<5" +rich = ">=13.9.4,<14" matplotlib = ">=3.10.1,<4" -mpmath = ">=1.3.0,<2" -rich = ">=14.0.0,<15" -sphinx = ">=8.2.3,<9" + +# Extra dependencies for extra CI +[tool.pixi.feature.extra.dependencies] +ax-platform = ">=0.5.0,<0.6" +superlu_dist = ">=9.0.0,<10" +hypre = ">=2.32.0,<3" +mumps-mpi = ">=5.7.3,<6" +dfo-ls = ">=1.3.0,<2" +pyzmq = ">=26.4.0,<27" +petsc = ">=3.23.0,<4" +petsc4py = ">=3.23.0,<4" +ninja = ">=1.13.1,<2" # for building Tasmanian from pypi + +[tool.pixi.feature.docs.dependencies] +sphinx = ">=8.2.1,<9" sphinxcontrib-bibtex = ">=2.6.3,<3" sphinx-design = ">=0.6.1,<0.7" sphinx_rtd_theme = ">=3.0.1,<4" sphinx-copybutton = ">=0.5.2,<0.6" pre-commit = ">=4.2.0,<5" -nlopt = ">=2.10.0,<3" scipy = ">=1.15.2,<2" ax-platform = ">=0.5.0,<0.6" sphinxcontrib-spelling = ">=8.0.1,<9" @@ -90,22 +127,58 @@ mypy = ">=1.15.0,<2" types-psutil = ">=6.1.0.20241221,<7" types-pyyaml = ">=6.0.12.20250402,<7" +# Linux dependencies, only for extra tests +[tool.pixi.feature.extra.target.linux-64.dependencies] +scikit-build = ">=0.18.1,<0.19" +packaging = ">=25.0,<26" + +# Python versions +[tool.pixi.feature.py310.dependencies] +python = "3.10.*" +[tool.pixi.feature.py311.dependencies] +python = "3.11.*" +[tool.pixi.feature.py312.dependencies] +python = "3.12.*" +[tool.pixi.feature.py313.dependencies] +python = "3.13.*" + +# Octave only works up to 3.12 on Linux +[tool.pixi.feature.py310e.target.linux-64.dependencies] +octave = ">=9.4.0,<10" +[tool.pixi.feature.py311e.target.linux-64.dependencies] +octave = ">=9.4.0,<10" +[tool.pixi.feature.py312e.target.linux-64.dependencies] +octave = ">=9.4.0,<10" +[tool.pixi.feature.py313e.target.linux-64.dependencies] + +# Dependencies for libEnsemble [tool.pixi.dependencies] python = ">=3.10,<3.14" pip = ">=24.3.1,<25" setuptools = ">=75.6.0,<76" numpy = ">=1.21,<3" -pydantic = ">=1.10,<3" +pydantic = ">=2,<3" pyyaml = ">=6.0,<7" tomli = ">=1.2.1,<3" psutil = ">=5.9.4,<7" +# macOS dependencies [tool.pixi.target.osx-arm64.dependencies] -clang_osx-arm64 = ">=19.1.2,<20" +clang_osx-arm64 = ">=21.1.4,<22" +# Linux dependencies +[tool.pixi.target.linux-64.dependencies] +gxx_linux-64 = ">=14.2.0,<15" + +# Extra dependencies, from pypi +[dependency-groups] +extra = ["pyenchant", "enchant>=0.0.1,<0.0.2", "proxystore>=0.7.0", "redis>=6.0.0,<7", "globus-compute-sdk>=2.28.0,<3"] +dev = ["wat>=0.7.0,<0.8"] + +# Various config from here onward [tool.black] line-length = 120 -target-version = ['py39', 'py310', 'py311', 'py312', 'py313'] +target-version = ['py310', 'py311', 'py312', 'py313'] force-exclude = ''' ( /( @@ -141,6 +214,3 @@ extend-exclude = ["*.bib", "*.xml", "docs/nitpicky"] [tool.mypy] disable_error_code = ["import-not-found", "import-untyped"] - -[dependency-groups] -dev = ["pyenchant", "enchant>=0.0.1,<0.0.2", "flake8-modern-annotations>=1.6.0,<2", "flake8-type-checking>=3.0.0,<4"]