diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 2b2fadd990..fefe785875 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -93,12 +93,14 @@ jobs: python-version: "3.12" - name: Install Python build dependencies + working-directory: python run: | - pip -v install --upgrade -r python/build-requirements.txt + pip install scikit-build-core setuptools + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} @@ -187,11 +189,14 @@ jobs: run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV - name: Install Python build dependencies - run: pip install -r python/build-requirements.txt + working-directory: python + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} @@ -292,10 +297,15 @@ jobs: - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV + - name: Install Python build dependencies + working-directory: python + run: | + pip install scikit-build-core setuptools + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install + - name: Install FEniCS Python components run: | - pip install -r python/build-requirements.txt - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 175b7e1fd2..6f2f363a97 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -33,7 +33,12 @@ jobs: run: | apt-get update apt-get install -y clang-tidy catch2 - pip install -r python/build-requirements.txt + + - name: Install Python build dependencies + working-directory: python + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 24541b633f..0433af5ae6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -105,9 +105,11 @@ jobs: mpiexec -np 3 ctest -V --output-on-failure -R unittests - name: Build and install DOLFINx Python interface + working-directory: python run: | - pip install -r python/build-requirements.txt - pip install --check-build-dependencies --no-build-isolation 'python/[test]' + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install + pip install --check-build-dependencies --no-build-isolation './[test]' - name: Basic test run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c170d02f4d..be44531bbf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -142,7 +142,8 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python run: | - pip -v install --no-binary mpi4py -r build-requirements.txt + pip install scikit-build-core + python -m pip install --no-binary mpi4py (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json) - name: Install DOLFINx (Python) working-directory: dolfinx-src/python diff --git a/README.md b/README.md index f2955b5917..93cb18af8b 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,8 @@ To install the Python interface, first install the C++ core, and then in the `python/` directory run: ```shell -pip install -r build-requirements.txt +pip install scikit-build-core +python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . ``` diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index 8942553c14..ebbbe32a85 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -71,7 +71,9 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release" # Using pip install `.[test]` with --no-dependencies and --no-build-isolation # does not install necessary packages, hence install build and optional # dependencies manually here. -ONBUILD RUN pip install --no-cache-dir -r dolfinx/python/build-requirements.txt && \ +ONBUILD RUN cd dolfinx/python && + pip install --no-cache-dir scikit-build-core && + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set # The dolfinx-onbuild container expects to have folders basix/ ufl/ diff --git a/python/README.md b/python/README.md index 446911e9e6..282724a142 100644 --- a/python/README.md +++ b/python/README.md @@ -6,7 +6,8 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: - pip install -r build-requirements.txt + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: diff --git a/python/build-requirements.txt b/python/build-requirements.txt deleted file mode 100644 index 5c54a707e1..0000000000 --- a/python/build-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -nanobind>=2.5.0 -scikit-build-core[pyproject]>=0.10 -mpi4py -setuptools diff --git a/python/doc/source/installation.rst b/python/doc/source/installation.rst index d6663fae38..27d063fdfc 100644 --- a/python/doc/source/installation.rst +++ b/python/doc/source/installation.rst @@ -105,7 +105,7 @@ Python After installation of the C++ interface, from the ``python/`` directory the Python interface can be installed using:: - pip install -r build-requirements.txt + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . diff --git a/python/pyproject.toml b/python/pyproject.toml index ae295b2eb4..0d5587dcae 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -3,7 +3,6 @@ # system built petsc4py and mpi4py. # NOTE: petsc4py is an optional build dependency, therefore we don't # list it here. -# pip install -r build-requirements.txt [build-system] requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py"] build-backend = "scikit_build_core.build"