Skip to content

Commit 1d2e439

Browse files
committed
Merge remote-tracking branch 'origin/main' into release
2 parents 38260c0 + b0f9734 commit 1d2e439

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+765
-1655
lines changed

.github/workflows/build-wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ jobs:
6565
with:
6666
user: __token__
6767
password: ${{ secrets.PYPI_TOKEN }}
68-
repository_url: https://upload.pypi.org/legacy/
68+
repository-url: https://upload.pypi.org/legacy/
6969
- name: Publish to Test PyPI
7070
uses: pypa/gh-action-pypi-publish@release/v1
7171
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
7272
with:
7373
user: __token__
7474
password: ${{ secrets.PYPI_TEST_TOKEN }}
75-
repository_url: https://test.pypi.org/legacy/
75+
repository-url: https://test.pypi.org/legacy/

.github/workflows/dolfinx-tests.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
- name: Install UFL and Basix (default branches/tags)
3636
if: github.event_name != 'workflow_dispatch'
3737
run: |
38-
python3 -m pip install git+https://github.com/FEniCS/ufl.git
39-
python3 -m pip install git+https://github.com/FEniCS/basix.git
38+
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ufl.git
39+
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git
4040
- name: Install UFL and Basix (specified branches/tags)
4141
if: github.event_name == 'workflow_dispatch'
4242
run: |
43-
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
44-
python3 -m pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
43+
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
44+
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
4545
- name: Install FFCx
4646
run: |
47-
pip3 install .
47+
pip3 install --break-system-packages .
4848
- name: Get DOLFINx source (default branch/tag)
4949
if: github.event_name != 'workflow_dispatch'
5050
uses: actions/checkout@v4
@@ -65,7 +65,9 @@ jobs:
6565
cmake --build build
6666
cmake --install build
6767
- name: Install DOLFINx (Python)
68-
run: python3 -m pip -v install --check-build-dependencies --no-build-isolation dolfinx/python/
68+
run: |
69+
python3 -m pip -v install --break-system-packages nanobind scikit-build-core[pyproject]
70+
python3 -m pip -v install --break-system-packages --check-build-dependencies --no-build-isolation dolfinx/python/
6971
- name: Build DOLFINx C++ unit tests
7072
run: |
7173
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S dolfinx/cpp/test/
@@ -74,6 +76,9 @@ jobs:
7476
run: |
7577
cd build/test
7678
ctest -V --output-on-failure -R unittests
79+
80+
- name: Install Python demo/test dependencies
81+
run: python3 -m pip install --break-system-packages matplotlib numba pyamg pytest pytest-xdist scipy
7782
- name: Run DOLFINx Python unit tests
7883
run: python3 -m pytest -n auto dolfinx/python/test/unit
7984
- name: Run DOLFINx Python demos

.github/workflows/pythonapp.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,73 @@ jobs:
2222
matrix:
2323
os: [ubuntu-latest]
2424
python-version: ['3.9', '3.10', '3.11', '3.12']
25+
include:
26+
- os: macos-latest
27+
python-version: '3.12'
28+
2529
steps:
2630
- name: Checkout FFCx
2731
uses: actions/checkout@v4
32+
2833
- name: Set up Python
2934
uses: actions/setup-python@v5
3035
with:
3136
python-version: ${{ matrix.python-version }}
37+
38+
- name: Export GitHub Actions cache environment variables (Windows)
39+
if: runner.os == 'Windows'
40+
uses: actions/github-script@v6
41+
with:
42+
script: |
43+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
44+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
45+
3246
- name: Install dependencies (non-Python, Linux)
3347
if: runner.os == 'Linux'
3448
run: |
3549
sudo apt-get install -y graphviz libgraphviz-dev ninja-build pkg-config
3650
- name: Install dependencies (non-Python, macOS)
3751
if: runner.os == 'macOS'
38-
run: brew install graphviz ninja pkg-config
39-
- name: Install FEniCS dependencies (Python)
52+
run: brew install ninja pkg-config
53+
54+
- name: Install FEniCS dependencies (Python, Unix)
55+
if: runner.os == 'Linux' || runner.os == 'macOS'
4056
run: |
4157
pip install git+https://github.com/FEniCS/ufl.git
4258
pip install git+https://github.com/FEniCS/basix.git
43-
- name: Install FFCx
59+
60+
- name: Install FEniCS dependencies (Python, Windows)
61+
if: runner.os == 'Windows'
62+
env:
63+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
64+
run: |
65+
pip install git+https://github.com/FEniCS/ufl.git
66+
pip install -v git+https://github.com/FEniCS/basix.git --config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
67+
68+
- name: Install FFCx (Linux, with optional dependencies)
69+
if: runner.os == 'Linux'
70+
run: pip install .[ci,optional]
71+
- name: Install FFCx (macOS, Windows)
72+
if: runner.os != 'Linux'
4473
run: pip install .[ci]
74+
4575
- name: Static check with mypy
4676
run: mypy ffcx/
47-
if: matrix.python-version != '3.12'
4877
- name: ruff checks
4978
run: |
5079
ruff check .
5180
ruff format --check .
81+
5282
- name: Run units tests
5383
run: python -m pytest -n auto --cov=ffcx/ --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml test/
84+
5485
- name: Upload to Coveralls
5586
if: ${{ github.repository == 'FEniCS/ffcx' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
5687
env:
5788
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
5889
run: coveralls
5990
continue-on-error: true
91+
6092
- name: Upload pytest results
6193
uses: actions/upload-artifact@v4
6294
with:
@@ -65,10 +97,15 @@ jobs:
6597
# Use always() to always run this step to publish test results
6698
# when there are test failures
6799
if: always()
100+
101+
- name: Setup cl.exe (Windows)
102+
if: runner.os == 'Windows'
103+
uses: ilammy/msvc-dev-cmd@v1
104+
68105
- name: Run FFCx demos
69106
run: |
70107
pytest demo/test_demos.py
71-
rm -Rf ufl/
108+
72109
- name: Build documentation
73110
run: |
74111
cd doc
@@ -80,6 +117,7 @@ jobs:
80117
path: doc/build/html/
81118
retention-days: 2
82119
if-no-files-found: error
120+
83121
- name: Checkout FEniCS/docs
84122
if: ${{ github.repository == 'FEniCS/ffcx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
85123
uses: actions/checkout@v4

.github/workflows/spack.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555
spack env create ffcx-main
5656
spack env activate ffcx-main
5757
spack add py-fenics-ffcx@main
58-
spack install --test=root
58+
spack install
59+
# spack install --test=root
5960
6061
- name: Install FFCx and run tests
6162
if: github.event_name == 'workflow_dispatch'
@@ -64,4 +65,5 @@ jobs:
6465
spack env create ffcx-testing
6566
spack env activate ffcx-testing
6667
spack add py-fenics-ffcx@${{ github.event.inputs.ffcx_version }}
67-
spack install --test=root
68+
spack install
69+
# spack install --test=root

cmake/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.19)
22

3-
project(ufcx VERSION 0.8.0 DESCRIPTION "UFCx interface header for finite element kernels"
3+
project(ufcx VERSION 0.9.0 DESCRIPTION "UFCx interface header for finite element kernels"
44
LANGUAGES C
55
HOMEPAGE_URL https://github.com/fenics/ffcx)
66
include(GNUInstallDirs)
@@ -9,6 +9,7 @@ file(SHA1 ${PROJECT_SOURCE_DIR}/../ffcx/codegeneration/ufcx.h UFCX_HASH)
99
message("Test hash: ${UFCX_HASH}")
1010

1111
add_library(${PROJECT_NAME} INTERFACE)
12+
target_compile_features(${PROJECT_NAME} INTERFACE c_std_17)
1213
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
1314
target_include_directories(${PROJECT_NAME}
1415
INTERFACE $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include>
@@ -39,4 +40,3 @@ install(FILES ${PROJECT_SOURCE_DIR}/../ffcx/codegeneration/ufcx.h TYPE INCLUDE)
3940
# Configure and install pkgconfig file
4041
configure_file(ufcx.pc.in ufcx.pc @ONLY)
4142
install(FILES ${PROJECT_BINARY_DIR}/ufcx.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
42-

demo/ExpressionInterpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
powq = 3 * q**2
5050

5151
# Extract basix cell type
52-
b_cell = basix.cell.string_to_type(cell)
52+
b_cell = basix.CellType[cell]
5353

5454
# Find quadrature points for quadrature element
5555
b_rule = basix.quadrature.string_to_type(q_rule)

demo/test_demos.py

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
@pytest.mark.parametrize("scalar_type", ["float64", "float32", "complex128", "complex64"])
1818
def test_demo(file, scalar_type):
1919
"""Test a demo."""
20+
if sys.platform.startswith("win32") and "complex" in scalar_type:
21+
# Skip complex demos on win32
22+
pytest.skip(reason="_Complex not supported on Windows")
23+
2024
if file in [
2125
"MixedGradient",
2226
"TraceElement", # HDiv Trace
@@ -25,29 +29,47 @@ def test_demo(file, scalar_type):
2529
"_TensorProductElement",
2630
]:
2731
# Skip demos that use elements not yet implemented in Basix
28-
pytest.skip()
32+
pytest.skip(reason="Element not yet implemented in Basix")
2933

3034
if "complex" in scalar_type and file in [
3135
"BiharmonicHHJ",
3236
"BiharmonicRegge",
3337
"StabilisedStokes",
3438
]:
3539
# Skip demos that are not implemented for complex scalars
36-
pytest.skip()
40+
pytest.skip(reason="Not implemented for complex types")
3741
elif "Complex" in file and scalar_type in ["float64", "float32"]:
3842
# Skip demos that are only implemented for complex scalars
39-
pytest.skip()
40-
41-
opts = f"--scalar_type {scalar_type}"
42-
extra_flags = "-Wunused-variable -Werror -fPIC "
43-
assert os.system(f"cd {demo_dir} && ffcx {opts} {file}.py") == 0
44-
assert (
45-
os.system(
46-
f"cd {demo_dir} && "
47-
"CPATH=../ffcx/codegeneration/ "
48-
f"gcc -I/usr/include/python{sys.version_info.major}.{sys.version_info.minor} "
49-
f"{extra_flags} "
50-
f"-shared {file}.c -o {file}.so"
43+
pytest.skip(reason="Not implemented for real types")
44+
45+
if sys.platform.startswith("win32"):
46+
opts = f"--scalar_type {scalar_type}"
47+
extra_flags = "/std:c17"
48+
assert os.system(f"cd {demo_dir} && ffcx {opts} {file}.py") == 0
49+
assert (
50+
os.system(
51+
f"cd {demo_dir} && " f'cl.exe /I "../ffcx/codegeneration" {extra_flags} /c {file}.c'
52+
)
53+
) == 0
54+
assert (
55+
os.system(
56+
f"cd {demo_dir} && "
57+
f'clang-cl.exe /I "../ffcx/codegeneration" {extra_flags} /c {file}.c'
58+
)
59+
) == 0
60+
else:
61+
cc = os.environ.get("CC", "cc")
62+
opts = f"--scalar_type {scalar_type}"
63+
extra_flags = (
64+
"-std=c17 -Wunused-variable -Werror -fPIC -Wno-error=implicit-function-declaration"
65+
)
66+
assert os.system(f"cd {demo_dir} && ffcx {opts} {file}.py") == 0
67+
assert (
68+
os.system(
69+
f"cd {demo_dir} && "
70+
f"{cc} -I../ffcx/codegeneration "
71+
f"{extra_flags} "
72+
f"-c {file}.c"
73+
)
74+
== 0
5175
)
52-
== 0
53-
)

ffcx/codegeneration/C/basix_custom_element_template.py

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

0 commit comments

Comments
 (0)