Skip to content

Commit 6037ceb

Browse files
Remove build-requirements.txt (#3955)
* Remove build-requirements * Apply suggestion from @schnellerhase * Fine tune * Install scikit before * Apply suggestions from code review * Align build dependencies * Apply suggestions from code review * Apply suggestions from code review * Update .github/workflows/macos.yml * Apply suggestions from code review * Fix windows? * Step by step * Found? * Remove build dependency setuptools, ufl install without build isolation * Add install to CI
1 parent 99dc279 commit 6037ceb

File tree

10 files changed

+36
-19
lines changed

10 files changed

+36
-19
lines changed

.github/workflows/ccpp.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ jobs:
9393
python-version: "3.12"
9494

9595
- name: Install Python build dependencies
96+
working-directory: python
9697
run: |
97-
pip -v install --upgrade -r python/build-requirements.txt
98+
pip install scikit-build-core setuptools
99+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
98100
99101
- name: Install FEniCS Python components
100102
run: |
101-
pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
103+
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
102104
pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
103105
pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
104106
@@ -187,11 +189,14 @@ jobs:
187189
run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
188190

189191
- name: Install Python build dependencies
190-
run: pip install -r python/build-requirements.txt
192+
working-directory: python
193+
run: |
194+
pip install scikit-build-core
195+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
191196
192197
- name: Install FEniCS Python components
193198
run: |
194-
pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
199+
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
195200
pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
196201
pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
197202
@@ -292,10 +297,15 @@ jobs:
292297
- name: Load environment variables
293298
run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
294299

300+
- name: Install Python build dependencies
301+
working-directory: python
302+
run: |
303+
pip install scikit-build-core setuptools
304+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
305+
295306
- name: Install FEniCS Python components
296307
run: |
297-
pip install -r python/build-requirements.txt
298-
pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
308+
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
299309
pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
300310
pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }}
301311

.github/workflows/clang-tidy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ jobs:
3333
run: |
3434
apt-get update
3535
apt-get install -y clang-tidy catch2
36-
pip install -r python/build-requirements.txt
36+
37+
- name: Install Python build dependencies
38+
working-directory: python
39+
run: |
40+
pip install scikit-build-core
41+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
3742
3843
- name: Load environment variables
3944
run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV

.github/workflows/macos.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ jobs:
105105
mpiexec -np 3 ctest -V --output-on-failure -R unittests
106106
107107
- name: Build and install DOLFINx Python interface
108+
working-directory: python
108109
run: |
109-
pip install -r python/build-requirements.txt
110-
pip install --check-build-dependencies --no-build-isolation 'python/[test]'
110+
pip install scikit-build-core
111+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
112+
pip install --check-build-dependencies --no-build-isolation './[test]'
111113
112114
- name: Basic test
113115
run: |

.github/workflows/windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ jobs:
142142
- name: Install DOLFINx Python build dependencies
143143
working-directory: dolfinx-src/python
144144
run: |
145-
pip -v install --no-binary mpi4py -r build-requirements.txt
145+
pip install scikit-build-core
146+
python -m pip install --no-binary mpi4py (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json)
146147
147148
- name: Install DOLFINx (Python)
148149
working-directory: dolfinx-src/python

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ To install the Python interface, first install the C++ core, and then in
4646
the `python/` directory run:
4747

4848
```shell
49-
pip install -r build-requirements.txt
49+
pip install scikit-build-core
50+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
5051
pip install --check-build-dependencies --no-build-isolation .
5152
```
5253

docker/Dockerfile.end-user

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release"
7171
# Using pip install `.[test]` with --no-dependencies and --no-build-isolation
7272
# does not install necessary packages, hence install build and optional
7373
# dependencies manually here.
74-
ONBUILD RUN pip install --no-cache-dir -r dolfinx/python/build-requirements.txt && \
74+
ONBUILD RUN cd dolfinx/python &&
75+
pip install --no-cache-dir scikit-build-core &&
76+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \
7577
pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set
7678

7779
# The dolfinx-onbuild container expects to have folders basix/ ufl/

python/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Below is guidance for building the DOLFINx Python interface.
66

77
2. Ensure the Python interface build requirements are installed:
88

9-
pip install -r build-requirements.txt
9+
pip install scikit-build-core
10+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
1011

1112
3. Build DOLFINx Python interface:
1213

python/build-requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

python/doc/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Python
105105
After installation of the C++ interface, from the ``python/`` directory
106106
the Python interface can be installed using::
107107

108-
pip install -r build-requirements.txt
108+
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
109109
pip install --check-build-dependencies --no-build-isolation .
110110

111111

python/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# system built petsc4py and mpi4py.
44
# NOTE: petsc4py is an optional build dependency, therefore we don't
55
# list it here.
6-
# pip install -r build-requirements.txt
76
[build-system]
87
requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py"]
98
build-backend = "scikit_build_core.build"

0 commit comments

Comments
 (0)