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 406ccdf27..5f273a990 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", "py314"] 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,44 +39,24 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v6 - - 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 + 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 + - 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: | @@ -84,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' || matrix.python-version == 'py314' 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..c7ebed04e --- /dev/null +++ b/pixi.lock @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:751e13cc32dc1d88c00f1e2e9c2b029d20a5884d43f86e1b67ced74b8015823b +size 1089301 diff --git a/pyproject.toml b/pyproject.toml index 80535d8cb..271c171b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,34 +1,39 @@ [project] -authors = [{name = "Jeffrey Larson"}, {name = "Stephen Hudson"}, - {name = "Stefan M. Wild"}, {name = "David Bindel"}, - {name = "John-Luke Navarro"}] +authors = [ + { name = "Jeffrey Larson" }, + { name = "Stephen Hudson" }, + { name = "Stefan M. Wild" }, + { name = "David Bindel" }, + { name = "John-Luke Navarro" }, +] -dependencies = [ "numpy", "psutil", "pydantic", "pyyaml", "tomli"] +dependencies = ["numpy", "psutil", "pydantic", "pyyaml", "tomli"] description = "A Python toolkit for coordinating asynchronous and dynamic ensembles of calculations." name = "libensemble" requires-python = ">=3.10" -license = {file = "LICENSE"} +license = { file = "LICENSE" } readme = "README.rst" classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - "Operating System :: MacOS", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering", - "Topic :: Software Development :: Libraries :: Python Modules", + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "Operating System :: MacOS", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", ] dynamic = ["version"] @@ -39,73 +44,175 @@ Issues = "https://github.com/Libensemble/libensemble/issues" [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools", "wheel", "pip>=24.3.1,<26", "setuptools>=75.1.0,<81", ] +requires = ["setuptools", "wheel", "pip>=24.3.1,<26", "setuptools>=75.1.0,<81"] [tool.setuptools.packages.find] where = ["."] include = ["libensemble*"] [tool.setuptools.dynamic] -version = {attr = "libensemble.version.__version__"} +version = { attr = "libensemble.version.__version__" } -[tool.pixi.project] +[tool.pixi.workspace] channels = ["conda-forge"] -platforms = ["osx-arm64", "linux-64", "osx-64"] +platforms = ["osx-arm64", "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"] +py314 = ["py314", "basic"] + +py310e = ["py310", "py310e", "basic", "extra"] +py311e = ["py311", "py311e", "basic", "extra"] +py312e = ["py312", "py312e", "basic", "extra"] +py313e = ["py313", "py313e", "basic", "extra"] +py314e = ["py314", "py314e", "basic", "extra"] + +# Extra tools for dev environment [tool.pixi.feature.dev.dependencies] +pre-commit = ">=4.5.1,<5" +git-lfs = ">=3.7.1,<4" +black = ">=25.12.0,<26" + + +# Basic dependencies for basic CI +[tool.pixi.feature.basic.dependencies] mpi = ">=1.0.1,<2" -mpich = ">=4.3.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" -pytest-timeout = ">=2.3.1,<3" +mpich = ">=4.3.2,<5" +mpi4py = ">=4.1.1,<5" +scipy = ">=1.15.2,<2" +mpmath = ">=1.3.0,<2" + +# "dev" dependencies needed for basic CI +flake8 = ">=7.3.0,<8" +coverage = ">=7.13.0,<8" +pytest = ">=9.0.2,<10" + +pytest-cov = ">=7.0.0,<8" +pytest-timeout = ">=2.4.0,<3" mock = ">=5.2.0,<6" python-dateutil = ">=2.9.0.post0,<3" -anyio = ">=4.9.0,<5" -matplotlib = ">=3.10.1,<4" -mpmath = ">=1.3.0,<2" -rich = ">=14.0.0,<15" +rich = ">=14.2.0,<15" +matplotlib = ">=3.10.8,<4" + +# Extra dependencies for extra CI +[tool.pixi.feature.extra.dependencies] +superlu_dist = ">=9.1.0,<10" +hypre = ">=2.32.0,<3" +mumps-mpi = ">=5.8.1,<6" +dfo-ls = ">=1.3.0,<2" +petsc = ">=3.24.2,<4" +petsc4py = ">=3.24.2,<4" +ninja = ">=1.13.2,<2" # for building Tasmanian from pypi +nlopt = ">=2.10.0,<3" + +[tool.pixi.feature.docs.dependencies] sphinx = ">=8.2.3,<9" -sphinxcontrib-bibtex = ">=2.6.3,<3" +sphinxcontrib-bibtex = ">=2.6.5,<3" sphinx-design = ">=0.6.1,<0.7" -sphinx_rtd_theme = ">=3.0.1,<4" +sphinx_rtd_theme = ">=3.0.2,<4" sphinx-copybutton = ">=0.5.2,<0.6" -pre-commit = ">=4.2.0,<5" -nlopt = ">=2.10.0,<3" +pre-commit = ">=4.5.1,<5" scipy = ">=1.15.2,<2" -ax-platform = ">=0.5.0,<0.6" -sphinxcontrib-spelling = ">=8.0.1,<9" +ax-platform = ">=1.2.1,<2" +sphinxcontrib-spelling = ">=8.0.2,<9" autodoc-pydantic = ">=2.1.0,<3" ipdb = ">=0.13.13,<0.14" -mypy = ">=1.15.0,<2" +mypy = ">=1.19.1,<2" types-psutil = ">=6.1.0.20241221,<7" -types-pyyaml = ">=6.0.12.20250402,<7" +types-pyyaml = ">=6.0.12.20250915,<7" + +# Linux dependencies, only for extra tests +[tool.pixi.feature.extra.target.linux-64.dependencies] +scikit-build = "*" +packaging = "*" +octave = ">=9.4.0,<11" +pyzmq = ">=26.4.0,<28" + +# 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.*" +[tool.pixi.feature.py314.dependencies] +python = "3.14.*" + +# ax-platform only works up to 3.13 on Linux +[tool.pixi.feature.py310e.target.linux-64.dependencies] +ax-platform = ">=1.2.1,<2" + +[tool.pixi.feature.py310e.dependencies] +globus-compute-sdk = ">=4.3.0,<5" + +[tool.pixi.feature.py311e.target.linux-64.dependencies] +ax-platform = ">=1.2.1,<2" + +[tool.pixi.feature.py311e.dependencies] +globus-compute-sdk = ">=4.3.0,<5" + +[tool.pixi.feature.py312e.target.linux-64.dependencies] +ax-platform = ">=1.2.1,<2" + +[tool.pixi.feature.py312e.dependencies] +globus-compute-sdk = ">=4.3.0,<5" + +[tool.pixi.feature.py313e.target.linux-64.dependencies] +ax-platform = ">=0.5.0,<0.6" + +[tool.pixi.feature.py314e] + +# 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" -pyyaml = ">=6.0,<7" -tomli = ">=1.2.1,<3" -psutil = ">=5.9.4,<7" +python = ">=3.10,<3.15" +pip = ">=25.2,<26" +setuptools = ">=80.8.0,<81" +numpy = ">=2.2.6,<3" +pydantic = ">=2.12.4,<3" +pyyaml = ">=6.0.2,<7" +tomli = ">=2.2.1,<3" + +# macOS dependencies [tool.pixi.target.osx-arm64.dependencies] -clang_osx-arm64 = ">=19.1.2,<20" +clang_osx-arm64 = ">=21.1.7,<22" + +# Linux dependencies +[tool.pixi.target.linux-64.dependencies] +gxx_linux-64 = ">=15.2.0,<16" +# Extra dependencies, from pypi +[dependency-groups] +extra = [ + "pyenchant==3.2.2", + "enchant>=0.0.1,<0.0.2", + "proxystore>=0.8.3,<0.9", + "redis>=7.1.0,<8", +] +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', 'py314'] force-exclude = ''' ( /( @@ -117,10 +224,7 @@ force-exclude = ''' ''' [tool.typos.default] -extend-ignore-identifiers-re = [ - ".*NDArray.*", - "8ba9de56.*" -] +extend-ignore-identifiers-re = [".*NDArray.*", "8ba9de56.*"] [tool.typos.default.extend-words] als = "als" @@ -141,6 +245,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"]