foamlib 0.7.3__tar.gz → 0.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- foamlib-0.8.0/.devcontainer.json +16 -0
- foamlib-0.8.0/.dockerignore +163 -0
- foamlib-0.8.0/.git-blame-ignore-revs +11 -0
- foamlib-0.8.0/.github/dependabot.yml +16 -0
- foamlib-0.8.0/.github/workflows/ci.yml +109 -0
- foamlib-0.8.0/.github/workflows/docker.yml +149 -0
- foamlib-0.8.0/.github/workflows/dockerhub-description.yml +28 -0
- foamlib-0.8.0/.github/workflows/pypi-publish.yml +24 -0
- foamlib-0.8.0/.gitignore +147 -0
- foamlib-0.8.0/.readthedocs.yaml +16 -0
- foamlib-0.8.0/Dockerfile +28 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/PKG-INFO +36 -27
- foamlib-0.8.0/benchmark.png +0 -0
- foamlib-0.8.0/docs/Makefile +20 -0
- foamlib-0.8.0/docs/cases.rst +22 -0
- foamlib-0.8.0/docs/conf.py +26 -0
- foamlib-0.8.0/docs/files.rst +10 -0
- foamlib-0.8.0/docs/index.rst +16 -0
- foamlib-0.8.0/docs/make.bat +35 -0
- foamlib-0.8.0/docs/ruff.toml +7 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/__init__.py +2 -2
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_base.py +2 -9
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_util.py +1 -8
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_files.py +3 -3
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_io.py +1 -3
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_parsing.py +137 -84
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_serialization.py +24 -22
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_types.py +5 -7
- foamlib-0.8.0/logo.png +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/pyproject.toml +4 -10
- foamlib-0.8.0/tests/__init__.py +0 -0
- foamlib-0.8.0/tests/ruff.toml +8 -0
- foamlib-0.8.0/tests/test_cases/__init__.py +0 -0
- foamlib-0.8.0/tests/test_cases/test_cavity.py +65 -0
- foamlib-0.8.0/tests/test_cases/test_cavity_async.py +85 -0
- foamlib-0.8.0/tests/test_cases/test_flange.py +78 -0
- foamlib-0.8.0/tests/test_cases/test_flange_async.py +101 -0
- foamlib-0.8.0/tests/test_files/__init__.py +0 -0
- foamlib-0.8.0/tests/test_files/test_dumps.py +74 -0
- foamlib-0.8.0/tests/test_files/test_files.py +256 -0
- foamlib-0.8.0/tests/test_files/test_parsing.py +79 -0
- foamlib-0.7.3/foamlib.egg-info/PKG-INFO +0 -211
- foamlib-0.7.3/foamlib.egg-info/SOURCES.txt +0 -25
- foamlib-0.7.3/foamlib.egg-info/dependency_links.txt +0 -1
- foamlib-0.7.3/foamlib.egg-info/requires.txt +0 -36
- foamlib-0.7.3/foamlib.egg-info/top_level.txt +0 -1
- foamlib-0.7.3/setup.cfg +0 -4
- {foamlib-0.7.3 → foamlib-0.8.0}/LICENSE.txt +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/README.md +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/__init__.py +2 -2
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_async.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_run.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_slurm.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_subprocess.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_cases/_sync.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/__init__.py +1 -1
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/_files/_util.py +0 -0
- {foamlib-0.7.3 → foamlib-0.8.0}/foamlib/py.typed +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"image": "microfluidica/openfoam",
|
3
|
+
"features": {
|
4
|
+
"ghcr.io/devcontainers/features/git": {},
|
5
|
+
"ghcr.io/devcontainers/features/python": {}
|
6
|
+
},
|
7
|
+
"customizations": {
|
8
|
+
"vscode": {
|
9
|
+
"extensions": [
|
10
|
+
"github.vscode-github-actions",
|
11
|
+
"ms-python.mypy-type-checker",
|
12
|
+
"charliermarsh.ruff"
|
13
|
+
]
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,163 @@
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
2
|
+
**/__pycache__/
|
3
|
+
**/*.py[cod]
|
4
|
+
**/*$py.class
|
5
|
+
|
6
|
+
# C extensions
|
7
|
+
**/*.so
|
8
|
+
|
9
|
+
# Distribution / packaging
|
10
|
+
**/.Python
|
11
|
+
**/build/
|
12
|
+
**/develop-eggs/
|
13
|
+
**/dist/
|
14
|
+
**/downloads/
|
15
|
+
**/eggs/
|
16
|
+
**/.eggs/
|
17
|
+
**/lib/
|
18
|
+
**/lib64/
|
19
|
+
**/parts/
|
20
|
+
**/sdist/
|
21
|
+
**/var/
|
22
|
+
**/wheels/
|
23
|
+
**/share/python-wheels/
|
24
|
+
**/*.egg-info/
|
25
|
+
**/.installed.cfg
|
26
|
+
**/*.egg
|
27
|
+
**/MANIFEST
|
28
|
+
|
29
|
+
# PyInstaller
|
30
|
+
# Usually these files are written by a python script from a template
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32
|
+
**/*.manifest
|
33
|
+
**/*.spec
|
34
|
+
|
35
|
+
# Installer logs
|
36
|
+
**/pip-log.txt
|
37
|
+
**/pip-delete-this-directory.txt
|
38
|
+
|
39
|
+
# Unit test / coverage reports
|
40
|
+
**/htmlcov/
|
41
|
+
**/.tox/
|
42
|
+
**/.nox/
|
43
|
+
**/.coverage
|
44
|
+
**/.coverage.*
|
45
|
+
**/.cache
|
46
|
+
**/nosetests.xml
|
47
|
+
**/coverage.xml
|
48
|
+
**/*.cover
|
49
|
+
**/*.py,cover
|
50
|
+
**/.hypothesis/
|
51
|
+
**/.pytest_cache/
|
52
|
+
**/cover/
|
53
|
+
|
54
|
+
# Translations
|
55
|
+
**/*.mo
|
56
|
+
**/*.pot
|
57
|
+
|
58
|
+
# Django stuff:
|
59
|
+
**/*.log
|
60
|
+
**/local_settings.py
|
61
|
+
**/db.sqlite3
|
62
|
+
**/db.sqlite3-journal
|
63
|
+
|
64
|
+
# Flask stuff:
|
65
|
+
**/instance/
|
66
|
+
**/.webassets-cache
|
67
|
+
|
68
|
+
# Scrapy stuff:
|
69
|
+
**/.scrapy
|
70
|
+
|
71
|
+
# Sphinx documentation
|
72
|
+
**/docs/_build/
|
73
|
+
|
74
|
+
# PyBuilder
|
75
|
+
**/.pybuilder/
|
76
|
+
**/target/
|
77
|
+
|
78
|
+
# Jupyter Notebook
|
79
|
+
**/.ipynb_checkpoints
|
80
|
+
|
81
|
+
# IPython
|
82
|
+
**/profile_default/
|
83
|
+
**/ipython_config.py
|
84
|
+
|
85
|
+
# pyenv
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
88
|
+
# .python-version
|
89
|
+
|
90
|
+
# pipenv
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94
|
+
# install all needed dependencies.
|
95
|
+
#Pipfile.lock
|
96
|
+
|
97
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
98
|
+
**/__pypackages__/
|
99
|
+
|
100
|
+
# Celery stuff
|
101
|
+
**/celerybeat-schedule
|
102
|
+
**/celerybeat.pid
|
103
|
+
|
104
|
+
# SageMath parsed files
|
105
|
+
**/*.sage.py
|
106
|
+
|
107
|
+
# Environments
|
108
|
+
**/.env
|
109
|
+
**/.venv
|
110
|
+
**/env/
|
111
|
+
**/venv/
|
112
|
+
**/ENV/
|
113
|
+
**/env.bak/
|
114
|
+
**/venv.bak/
|
115
|
+
|
116
|
+
# Spyder project settings
|
117
|
+
**/.spyderproject
|
118
|
+
**/.spyproject
|
119
|
+
|
120
|
+
# Rope project settings
|
121
|
+
**/.ropeproject
|
122
|
+
|
123
|
+
# mkdocs documentation
|
124
|
+
/site
|
125
|
+
|
126
|
+
# mypy
|
127
|
+
**/.mypy_cache/
|
128
|
+
**/.dmypy.json
|
129
|
+
**/dmypy.json
|
130
|
+
|
131
|
+
# Pyre type checker
|
132
|
+
**/.pyre/
|
133
|
+
|
134
|
+
# pytype static type analyzer
|
135
|
+
**/.pytype/
|
136
|
+
|
137
|
+
# Cython debug symbols
|
138
|
+
**/cython_debug/
|
139
|
+
|
140
|
+
# uv
|
141
|
+
**/uv.lock
|
142
|
+
|
143
|
+
# macOS
|
144
|
+
**/.DS_Store
|
145
|
+
|
146
|
+
# VS Code
|
147
|
+
**/.vscode
|
148
|
+
|
149
|
+
# Docker
|
150
|
+
**/Dockerfile
|
151
|
+
**/.dockerignore
|
152
|
+
|
153
|
+
# Git
|
154
|
+
**/.git
|
155
|
+
**/.gitignore
|
156
|
+
**/.gitattributes
|
157
|
+
|
158
|
+
# GitHub
|
159
|
+
**/.github
|
160
|
+
|
161
|
+
# Dev Containers
|
162
|
+
**/.devcontainer
|
163
|
+
**/.devcontainer.json
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Apply extra Ruff rules
|
2
|
+
5a858118ea3f7475545103fba8b045eca85e7d3d
|
3
|
+
|
4
|
+
# Apply extra Ruff rules
|
5
|
+
8579acf91c346ce6f126b201a972561644bba656
|
6
|
+
|
7
|
+
# Apply extra Ruff rules
|
8
|
+
520ba8c05d75e2510fa333ac086c2008ca6b4afb
|
9
|
+
|
10
|
+
# Apply extra Ruff rules
|
11
|
+
0af6da4324087876ff3ca2365e05c1c1c9ff2ddc
|
@@ -0,0 +1,16 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: "github-actions"
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: "weekly"
|
7
|
+
|
8
|
+
- package-ecosystem: "pip"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
|
13
|
+
- package-ecosystem: "docker"
|
14
|
+
directory: "/"
|
15
|
+
schedule:
|
16
|
+
interval: "weekly"
|
@@ -0,0 +1,109 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- main
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
lint:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
steps:
|
16
|
+
- name: Checkout
|
17
|
+
uses: actions/checkout@v4
|
18
|
+
- name: Lint with Ruff
|
19
|
+
uses: astral-sh/ruff-action@v2
|
20
|
+
- name: Format with Ruff
|
21
|
+
uses: astral-sh/ruff-action@v2
|
22
|
+
with:
|
23
|
+
args: 'format --check'
|
24
|
+
|
25
|
+
typing:
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
steps:
|
28
|
+
- name: Checkout
|
29
|
+
uses: actions/checkout@v4
|
30
|
+
- name: Install uv
|
31
|
+
uses: astral-sh/setup-uv@v4
|
32
|
+
- name: Set up Python
|
33
|
+
uses: actions/setup-python@v5
|
34
|
+
with:
|
35
|
+
python-version-file: pyproject.toml
|
36
|
+
- name: Check types with mypy
|
37
|
+
run: |
|
38
|
+
uv run --extra typing mypy
|
39
|
+
|
40
|
+
test:
|
41
|
+
runs-on: ubuntu-22.04
|
42
|
+
services:
|
43
|
+
mysql:
|
44
|
+
image: mysql:8.0
|
45
|
+
env:
|
46
|
+
MYSQL_ROOT_PASSWORD: root
|
47
|
+
ports:
|
48
|
+
- "8888:3306"
|
49
|
+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
50
|
+
strategy:
|
51
|
+
matrix:
|
52
|
+
openfoam-version: [2406, 2006, 12, 9]
|
53
|
+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
|
54
|
+
slurm: [false]
|
55
|
+
include:
|
56
|
+
- openfoam-version: 2406
|
57
|
+
python-version: '3.13'
|
58
|
+
slurm: true
|
59
|
+
- openfoam-version: 12
|
60
|
+
python-version: '3.13'
|
61
|
+
slurm: true
|
62
|
+
- openfoam-version: 2006
|
63
|
+
python-version: '3.7'
|
64
|
+
slurm: true
|
65
|
+
- openfoam-version: 9
|
66
|
+
python-version: '3.7'
|
67
|
+
slurm: true
|
68
|
+
fail-fast: false
|
69
|
+
steps:
|
70
|
+
- name: Checkout
|
71
|
+
uses: actions/checkout@v4
|
72
|
+
- name: Set up OpenFOAM
|
73
|
+
uses: gerlero/setup-openfoam@v1
|
74
|
+
with:
|
75
|
+
openfoam-version: ${{ matrix.openfoam-version }}
|
76
|
+
- name: Install uv
|
77
|
+
uses: astral-sh/setup-uv@v4
|
78
|
+
- name: Set up Python ${{ matrix.python-version }}
|
79
|
+
uses: actions/setup-python@v5
|
80
|
+
with:
|
81
|
+
python-version: ${{ matrix.python-version }}
|
82
|
+
- name: Set up Slurm
|
83
|
+
if: matrix.slurm
|
84
|
+
uses: koesterlab/setup-slurm-action@v1
|
85
|
+
- name: Install test dependencies
|
86
|
+
run: |
|
87
|
+
uv sync --extra test
|
88
|
+
- name: Test with pytest
|
89
|
+
run: |
|
90
|
+
uv run pytest --cov=foamlib --cov-report xml
|
91
|
+
env:
|
92
|
+
OMPI_MCA_rmaps_base_oversubscribe: 1
|
93
|
+
OMPI_ALLOW_RUN_AS_ROOT: 1
|
94
|
+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
|
95
|
+
- name: Upload code coverage results to Codecov
|
96
|
+
uses: codecov/codecov-action@v5
|
97
|
+
with:
|
98
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
99
|
+
|
100
|
+
build:
|
101
|
+
runs-on: ubuntu-latest
|
102
|
+
steps:
|
103
|
+
- name: Checkout
|
104
|
+
uses: actions/checkout@v4
|
105
|
+
- name: Install uv
|
106
|
+
uses: astral-sh/setup-uv@v4
|
107
|
+
- name: Check package build
|
108
|
+
run: |
|
109
|
+
uv build
|
@@ -0,0 +1,149 @@
|
|
1
|
+
name: Docker
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
tags:
|
8
|
+
- '*'
|
9
|
+
pull_request:
|
10
|
+
branches:
|
11
|
+
- main
|
12
|
+
workflow_dispatch:
|
13
|
+
|
14
|
+
env:
|
15
|
+
IMAGES: ${{ vars.DOCKERHUB_REPOSITORY || github.repository }}
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
bare:
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
permissions:
|
21
|
+
packages: write
|
22
|
+
steps:
|
23
|
+
- name: Set up QEMU
|
24
|
+
uses: docker/setup-qemu-action@v3
|
25
|
+
- name: Set up Docker Buildx
|
26
|
+
uses: docker/setup-buildx-action@v3
|
27
|
+
- name: Docker meta
|
28
|
+
id: meta
|
29
|
+
uses: docker/metadata-action@v5
|
30
|
+
with:
|
31
|
+
images: ${{ env.IMAGES }}
|
32
|
+
tags: |
|
33
|
+
type=ref,event=branch
|
34
|
+
type=ref,event=pr
|
35
|
+
type=pep440,pattern={{version}}
|
36
|
+
type=pep440,pattern={{major}}.{{minor}}
|
37
|
+
type=pep440,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
|
38
|
+
- name: Login to GitHub Container Registry
|
39
|
+
continue-on-error: ${{ github.event_name != 'push' }}
|
40
|
+
uses: docker/login-action@v3
|
41
|
+
with:
|
42
|
+
registry: ghcr.io
|
43
|
+
username: ${{ github.repository_owner }}
|
44
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
45
|
+
- name: Login to DockerHub
|
46
|
+
if: vars.DOCKERHUB_REPOSITORY
|
47
|
+
continue-on-error: ${{ github.event_name != 'push' }}
|
48
|
+
uses: docker/login-action@v3
|
49
|
+
with:
|
50
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
51
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
52
|
+
- name: Build and push
|
53
|
+
uses: docker/build-push-action@v6
|
54
|
+
with:
|
55
|
+
platforms: linux/amd64,linux/arm64
|
56
|
+
tags: ${{ steps.meta.outputs.tags }}
|
57
|
+
labels: ${{ steps.meta.outputs.labels }}
|
58
|
+
cache-from: |
|
59
|
+
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-amd64
|
60
|
+
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-arm64
|
61
|
+
push: ${{ github.event_name == 'push' }}
|
62
|
+
- name: Push build cache (amd64)
|
63
|
+
if: github.event_name == 'push'
|
64
|
+
uses: docker/build-push-action@v6
|
65
|
+
with:
|
66
|
+
platforms: linux/amd64
|
67
|
+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-amd64
|
68
|
+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-amd64,mode=max
|
69
|
+
- name: Push build cache (arm64)
|
70
|
+
if: github.event_name == 'push'
|
71
|
+
uses: docker/build-push-action@v6
|
72
|
+
with:
|
73
|
+
platforms: linux/arm64
|
74
|
+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-arm64
|
75
|
+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-arm64,mode=max
|
76
|
+
|
77
|
+
openfoam:
|
78
|
+
runs-on: ubuntu-latest
|
79
|
+
permissions:
|
80
|
+
packages: write
|
81
|
+
strategy:
|
82
|
+
matrix:
|
83
|
+
openfoam-version: [2406, 2312, 12, 11]
|
84
|
+
fail-fast: false
|
85
|
+
steps:
|
86
|
+
- name: Set up QEMU
|
87
|
+
uses: docker/setup-qemu-action@v3
|
88
|
+
- name: Set up Docker Buildx
|
89
|
+
uses: docker/setup-buildx-action@v3
|
90
|
+
- name: Docker meta
|
91
|
+
id: meta
|
92
|
+
uses: docker/metadata-action@v5
|
93
|
+
with:
|
94
|
+
images: ${{ env.IMAGES }}
|
95
|
+
tags: |
|
96
|
+
type=ref,event=branch,suffix=-openfoam${{ matrix.openfoam-version }}
|
97
|
+
type=ref,event=pr,suffix=-openfoam${{ matrix.openfoam-version }}
|
98
|
+
type=pep440,pattern=openfoam${{ matrix.openfoam-version }}
|
99
|
+
type=pep440,pattern={{version}}-openfoam${{ matrix.openfoam-version }}
|
100
|
+
type=pep440,pattern={{major}}.{{minor}}-openfoam${{ matrix.openfoam-version }}
|
101
|
+
type=pep440,pattern={{major}}-openfoam${{ matrix.openfoam-version }},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
|
102
|
+
flavor: latest=false
|
103
|
+
- name: Login to GitHub Container Registry
|
104
|
+
continue-on-error: ${{ github.event_name != 'push' }}
|
105
|
+
uses: docker/login-action@v3
|
106
|
+
with:
|
107
|
+
registry: ghcr.io
|
108
|
+
username: ${{ github.repository_owner }}
|
109
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
110
|
+
- name: Login to DockerHub
|
111
|
+
if: vars.DOCKERHUB_REPOSITORY
|
112
|
+
continue-on-error: ${{ github.event_name != 'push' }}
|
113
|
+
uses: docker/login-action@v3
|
114
|
+
with:
|
115
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
116
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
117
|
+
- name: Build and push
|
118
|
+
uses: docker/build-push-action@v6
|
119
|
+
with:
|
120
|
+
platforms: linux/amd64,linux/arm64
|
121
|
+
tags: ${{ steps.meta.outputs.tags }}
|
122
|
+
labels: ${{ steps.meta.outputs.labels }}
|
123
|
+
cache-from: |
|
124
|
+
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-amd64
|
125
|
+
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-arm64
|
126
|
+
push: ${{ github.event_name == 'push' }}
|
127
|
+
build-args: |
|
128
|
+
BASE=openfoam
|
129
|
+
OPENFOAM_VERSION=${{ matrix.openfoam-version }}
|
130
|
+
- name: Push build cache (amd64)
|
131
|
+
if: github.event_name == 'push'
|
132
|
+
uses: docker/build-push-action@v6
|
133
|
+
with:
|
134
|
+
platforms: linux/amd64
|
135
|
+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-amd64
|
136
|
+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-amd64,mode=max
|
137
|
+
build-args: |
|
138
|
+
BASE=openfoam
|
139
|
+
OPENFOAM_VERSION=${{ matrix.openfoam-version }}
|
140
|
+
- name: Push build cache (arm64)
|
141
|
+
if: github.event_name == 'push'
|
142
|
+
uses: docker/build-push-action@v6
|
143
|
+
with:
|
144
|
+
platforms: linux/arm64
|
145
|
+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-arm64
|
146
|
+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-openfoam${{ matrix.openfoam-version }}-arm64,mode=max
|
147
|
+
build-args: |
|
148
|
+
BASE=openfoam
|
149
|
+
OPENFOAM_VERSION=${{ matrix.openfoam-version }}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Update Docker Hub description
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
paths:
|
7
|
+
- README.md
|
8
|
+
- .github/workflows/dockerhub-description.yml
|
9
|
+
workflow_dispatch:
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
dockerhub-description:
|
13
|
+
if: vars.DOCKERHUB_REPOSITORY
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
steps:
|
16
|
+
- name: Checkout
|
17
|
+
uses: actions/checkout@v4
|
18
|
+
- name: Modify README.md for Docker Hub
|
19
|
+
run: |
|
20
|
+
sed -i "s|^\s*#\s\+\(.\+\)|# [\1]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY)|" README.md
|
21
|
+
- name: Update Docker Hub description
|
22
|
+
uses: peter-evans/dockerhub-description@v4
|
23
|
+
with:
|
24
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
25
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
26
|
+
repository: ${{ vars.DOCKERHUB_REPOSITORY }}
|
27
|
+
short-description: ${{ github.event.repository.description }}
|
28
|
+
enable-url-completion: true
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Publish
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [published]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
deploy:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
environment:
|
11
|
+
name: pypi
|
12
|
+
url: https://pypi.org/p/foamlib
|
13
|
+
permissions:
|
14
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- name: Checkout
|
18
|
+
uses: actions/checkout@v4
|
19
|
+
- name: Install uv
|
20
|
+
uses: astral-sh/setup-uv@v4
|
21
|
+
- name: Build
|
22
|
+
run: uv build
|
23
|
+
- name: Publish to PyPI
|
24
|
+
run: uv publish
|
foamlib-0.8.0/.gitignore
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
2
|
+
__pycache__/
|
3
|
+
*.py[cod]
|
4
|
+
*$py.class
|
5
|
+
|
6
|
+
# C extensions
|
7
|
+
*.so
|
8
|
+
|
9
|
+
# Distribution / packaging
|
10
|
+
.Python
|
11
|
+
build/
|
12
|
+
develop-eggs/
|
13
|
+
dist/
|
14
|
+
downloads/
|
15
|
+
eggs/
|
16
|
+
.eggs/
|
17
|
+
lib/
|
18
|
+
lib64/
|
19
|
+
parts/
|
20
|
+
sdist/
|
21
|
+
var/
|
22
|
+
wheels/
|
23
|
+
share/python-wheels/
|
24
|
+
*.egg-info/
|
25
|
+
.installed.cfg
|
26
|
+
*.egg
|
27
|
+
MANIFEST
|
28
|
+
|
29
|
+
# PyInstaller
|
30
|
+
# Usually these files are written by a python script from a template
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32
|
+
*.manifest
|
33
|
+
*.spec
|
34
|
+
|
35
|
+
# Installer logs
|
36
|
+
pip-log.txt
|
37
|
+
pip-delete-this-directory.txt
|
38
|
+
|
39
|
+
# Unit test / coverage reports
|
40
|
+
htmlcov/
|
41
|
+
.tox/
|
42
|
+
.nox/
|
43
|
+
.coverage
|
44
|
+
.coverage.*
|
45
|
+
.cache
|
46
|
+
nosetests.xml
|
47
|
+
coverage.xml
|
48
|
+
*.cover
|
49
|
+
*.py,cover
|
50
|
+
.hypothesis/
|
51
|
+
.pytest_cache/
|
52
|
+
cover/
|
53
|
+
|
54
|
+
# Translations
|
55
|
+
*.mo
|
56
|
+
*.pot
|
57
|
+
|
58
|
+
# Django stuff:
|
59
|
+
*.log
|
60
|
+
local_settings.py
|
61
|
+
db.sqlite3
|
62
|
+
db.sqlite3-journal
|
63
|
+
|
64
|
+
# Flask stuff:
|
65
|
+
instance/
|
66
|
+
.webassets-cache
|
67
|
+
|
68
|
+
# Scrapy stuff:
|
69
|
+
.scrapy
|
70
|
+
|
71
|
+
# Sphinx documentation
|
72
|
+
docs/_build/
|
73
|
+
|
74
|
+
# PyBuilder
|
75
|
+
.pybuilder/
|
76
|
+
target/
|
77
|
+
|
78
|
+
# Jupyter Notebook
|
79
|
+
.ipynb_checkpoints
|
80
|
+
|
81
|
+
# IPython
|
82
|
+
profile_default/
|
83
|
+
ipython_config.py
|
84
|
+
|
85
|
+
# pyenv
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
88
|
+
# .python-version
|
89
|
+
|
90
|
+
# pipenv
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94
|
+
# install all needed dependencies.
|
95
|
+
#Pipfile.lock
|
96
|
+
|
97
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
98
|
+
__pypackages__/
|
99
|
+
|
100
|
+
# Celery stuff
|
101
|
+
celerybeat-schedule
|
102
|
+
celerybeat.pid
|
103
|
+
|
104
|
+
# SageMath parsed files
|
105
|
+
*.sage.py
|
106
|
+
|
107
|
+
# Environments
|
108
|
+
.env
|
109
|
+
.venv
|
110
|
+
env/
|
111
|
+
venv/
|
112
|
+
ENV/
|
113
|
+
env.bak/
|
114
|
+
venv.bak/
|
115
|
+
|
116
|
+
# Spyder project settings
|
117
|
+
.spyderproject
|
118
|
+
.spyproject
|
119
|
+
|
120
|
+
# Rope project settings
|
121
|
+
.ropeproject
|
122
|
+
|
123
|
+
# mkdocs documentation
|
124
|
+
/site
|
125
|
+
|
126
|
+
# mypy
|
127
|
+
.mypy_cache/
|
128
|
+
.dmypy.json
|
129
|
+
dmypy.json
|
130
|
+
|
131
|
+
# Pyre type checker
|
132
|
+
.pyre/
|
133
|
+
|
134
|
+
# pytype static type analyzer
|
135
|
+
.pytype/
|
136
|
+
|
137
|
+
# Cython debug symbols
|
138
|
+
cython_debug/
|
139
|
+
|
140
|
+
# uv
|
141
|
+
uv.lock
|
142
|
+
|
143
|
+
# macOS
|
144
|
+
.DS_Store
|
145
|
+
|
146
|
+
# VS Code
|
147
|
+
.vscode
|
foamlib-0.8.0/Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
ARG BASE=python:3.12-slim
|
3
|
+
|
4
|
+
ARG OPENFOAM_VERSION=2406
|
5
|
+
FROM microfluidica/openfoam:${OPENFOAM_VERSION} AS openfoam
|
6
|
+
|
7
|
+
ARG VIRTUAL_ENV=/opt/venv
|
8
|
+
|
9
|
+
RUN apt-get update \
|
10
|
+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
11
|
+
python3-venv \
|
12
|
+
&& rm -rf /var/lib/apt/lists/* \
|
13
|
+
&& python3 -m venv ${VIRTUAL_ENV}
|
14
|
+
|
15
|
+
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
|
16
|
+
|
17
|
+
CMD ["python3"]
|
18
|
+
|
19
|
+
|
20
|
+
FROM ${BASE}
|
21
|
+
|
22
|
+
COPY . /src/
|
23
|
+
|
24
|
+
RUN pip install --no-cache-dir /src
|
25
|
+
|
26
|
+
RUN rm -rf /src \
|
27
|
+
# smoke test
|
28
|
+
&& python -c 'import foamlib'
|