Skip to content

Commit 86939e5

Browse files
committed
pull main into branch
2 parents 73c055f + a972f33 commit 86939e5

Some content is hidden

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

54 files changed

+10964
-7898
lines changed

.binder/requirements.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
1-
PyPartMC>=0.0.19
2-
matplotlib!=3.10.0
3-
ipywidgets
4-
voila
5-
open-atmos-jupyter-utils
6-
numba>=0.61.0rc1; python_version >= '3.13'
7-
PySDM
1+
PyPartMC[examples]
82
git+https://github.com/bsumlin/PyMieScatt.git
9-
SciPy

.github/workflows/buildwheels.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: build_wheels+tests
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
schedule:
13+
- cron: '0 13 * * 4'
14+
release:
15+
types: [published]
16+
17+
jobs:
18+
debug_build_ok:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
25+
- run: DEBUG=1 VERBOSE=1 pip install --verbose -e .[tests]
26+
- run: pytest -v -s -We -p no:unraisableexception tests
27+
28+
zenodo_json:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: notiz-dev/github-action-json-property@release
33+
with:
34+
path: '.zenodo.json'
35+
prop_path: 'creators'
36+
37+
build_wheels:
38+
needs: [debug_build_ok, zenodo_json]
39+
name: Build wheels on ${{ matrix.os }}
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest]
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
submodules: recursive
49+
fetch-depth: 0
50+
51+
# download C and Fortran compiler on windows
52+
- if: matrix.os == 'windows-latest'
53+
uses: msys2/setup-msys2@v2
54+
with:
55+
msystem: MINGW64
56+
update: false
57+
install: >-
58+
mingw-w64-x86_64-gcc-fortran
59+
mingw-w64-x86_64-ninja
60+
m4
61+
62+
- uses: actions/setup-python@v5
63+
64+
- name: Install cibuildwheel
65+
run: python -m pip install cibuildwheel==2.23.2
66+
67+
- name: Build and test wheels
68+
env:
69+
# skip 32-bit, PyPy, and musllinux builds
70+
CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*"
71+
CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel
72+
CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DCMAKE_MAKE_PROGRAM=D:/a/_temp/msys64/mingw64/bin/ninja.exe" CMAKE_PROGRAM_PATH="D:/a/_temp/msys64/usr/bin" CMAKE_GENERATOR="Ninja" TEMP="D:/a/_temp/"
73+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
74+
CIBW_BEFORE_BUILD_MACOS: brew reinstall gcc
75+
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion` SYSTEM_VERSION_COMPAT=0
76+
CIBW_TEST_REQUIRES: pytest pytest-order
77+
CIBW_TEST_COMMAND: pytest -v -s -We -p no:unraisableexception {package}/tests
78+
run: python -m cibuildwheel --output-dir dist
79+
80+
- uses: actions/upload-artifact@v4
81+
with:
82+
name: dist-${{matrix.os}}-${{matrix.manylinux}}
83+
path: dist
84+
85+
run_example_notebooks:
86+
needs: [build_wheels]
87+
runs-on: ${{ matrix.os }}
88+
name: Run example notebooks on ${{ matrix.os }}
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest]
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
with:
97+
submodules: recursive
98+
fetch-depth: 0
99+
100+
- uses: actions/[email protected]
101+
with:
102+
python-version: "3.13"
103+
104+
- uses: actions/download-artifact@v4
105+
with:
106+
name: dist-${{matrix.os}}-${{matrix.manylinux}}
107+
path: dist
108+
109+
# install fortran compiler needed by dustpy
110+
- if: startsWith(matrix.os, 'macos-')
111+
run: |
112+
brew reinstall gcc
113+
114+
- run: |
115+
temp=`find dist/ -name "*cp313*.whl"`
116+
python -m pip install $temp[examples]
117+
ex -sc 'g/^PyPartMC/d' -cx .binder/requirements.txt
118+
python -m pip install --force-reinstall --no-deps $PIP_INSTALL_OPTS -r .binder/requirements.txt
119+
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
120+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_run_notebooks.py
121+
122+
check_annotated_todos:
123+
runs-on: ubuntu-latest
124+
name: Check if todos are annotated
125+
126+
steps:
127+
- uses: actions/checkout@v4
128+
with:
129+
submodules: recursive
130+
fetch-depth: 0
131+
132+
- run: |
133+
python -m pip install pytest
134+
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
135+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests/test_todos_annotated.py
136+
137+
dist_check:
138+
runs-on: ${{ matrix.os }}
139+
needs: [build_wheels]
140+
strategy:
141+
matrix:
142+
os: [ubuntu-latest, ubuntu-24.04-arm]
143+
steps:
144+
- uses: actions/[email protected]
145+
with:
146+
python-version: "3.11"
147+
- run: pip install twine auditwheel
148+
- uses: actions/download-artifact@v4
149+
with:
150+
name: dist-${{matrix.os}}-${{matrix.manylinux}}
151+
path: dist
152+
- run: twine check --strict dist/*
153+
- run: for i in dist/*-manylinux*.whl; do auditwheel show $i; done;
154+
155+
dist_upload:
156+
runs-on: ubuntu-latest
157+
needs: [build_wheels]
158+
permissions:
159+
id-token: write
160+
steps:
161+
- uses: actions/download-artifact@v4
162+
with:
163+
pattern: dist-*
164+
merge-multiple: true
165+
path: dist
166+
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
167+
uses: pypa/gh-action-pypi-publish@release/v1.12
168+
with:
169+
repository_url: https://test.pypi.org/legacy/
170+
attestations: false
171+
- run: |
172+
echo "github.event_name:" ${{ github.event_name }}
173+
echo "github.event.action:" ${{ github.event.action }}
174+
echo "github.event.prerelease:" ${{ github.event.prerelease }}
175+
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF }}
176+
echo "env.GITHUB_REF:" ${{ env.GITHUB_REF_NAME }}
177+
- if: github.event_name == 'release' && github.event.prerelease == false
178+
uses: pypa/gh-action-pypi-publish@release/v1.12
179+
with:
180+
attestations: false

.github/workflows/codecov.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: codecov
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
codecov:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
submodules: recursive
16+
fetch-depth: 0
17+
- run: sudo apt install -y lcov
18+
- run: |
19+
set -xe
20+
pip install "pip<23" setuptools==65.2
21+
CMAKE_ARGS="-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_C_FLAGS=--coverage -DCMAKE_Fortran_FLAGS=--coverage" pip install -e .[tests]
22+
pytest -We tests
23+
lcov --capture --directory ./build/*/_PyPartMC/CMakeFiles/_PyPartMC.dir/ --output-file coverage.info --no-external
24+
- run: find -name \*.gcno | grep -v pypartmc.cpp | grep -v _PyPartMC.dir | xargs rm
25+
- uses: codecov/[email protected]
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }}
28+
fail_ci_if_error: true

.github/workflows/cpplint.yml

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

.github/workflows/readme_listings.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- run : python -c 'import numpy as np; import os; dir="readme_output/"; data=[float(np.loadtxt(dir+file)) for file in os.listdir(dir)]; print("data:", data); similar_as_first = np.array([abs(data[0]-k)/data[0] for k in data[1:]]); print("similar_as_first", similar_as_first); assert((similar_as_first < .5).all())'
110110

111111
matlab:
112-
runs-on: ubuntu-20.04
112+
runs-on: ubuntu-22.04
113113

114114
steps:
115115
- uses: actions/checkout@v2
@@ -118,16 +118,15 @@ jobs:
118118

119119
- uses: actions/setup-python@v1
120120
with:
121-
python-version: 3.8
121+
python-version: 3.9
122122

123-
- uses: jwlawson/[email protected]
123+
- uses: RalfG/[email protected]_x86_64
124124
with:
125-
cmake-version: '3.26.x'
125+
python-versions: cp39-cp39
126+
build-requirements: 'setuptools_scm'
127+
pre-build-command: 'git config --global --add safe.directory "*"'
126128

127-
- run: |
128-
echo "CC=gcc-9" >> $GITHUB_ENV
129-
echo "CXX=g++-9" >> $GITHUB_ENV
130-
VERBOSE=1 pip install --verbose -e .
129+
- run: pip install --verbose dist/*manylinux*.whl
131130

132131
- run: pip install pytest-codeblocks pytest
133132
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.m', 'w'); f.writelines(block.code for block in code if block.syntax=='Matlab'); f.close()"

0 commit comments

Comments
 (0)