Skip to content

Commit e98f3c7

Browse files
committed
Merge remote-tracking branch 'origin/main' into dev
2 parents 8e254d7 + 9e4cb87 commit e98f3c7

File tree

271 files changed

+7713
-1662
lines changed

Some content is hidden

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

271 files changed

+7713
-1662
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest]
17-
python-version: ["3.10","3.12"]
17+
python-version: ["3.11","3.12","3.13", "3.14"]
1818
environment: ci
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2121
- name: Set up Python ${{ matrix.python-version }}
2222
uses: actions/setup-python@v5
2323
with:

.github/workflows/install_pyscf.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ python -m pip cache purge
44
pip install wheel
55
pip install pytest
66
pip install pytest-cov
7-
pip install numpy
8-
pip install scipy
9-
pip install h5py
10-
pip install 'jaxlib==0.4.35'
11-
pip install 'jax==0.4.35'
12-
pip install 'pyscf>=2.3'
7+
pip install 'numpy<2.4'
8+
pip install 'jax<0.9'
9+
pip install 'pyscf<2.12.0'

.github/workflows/publish_cuda_plugin.yml

Lines changed: 83 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,74 +5,111 @@ on:
55
types:
66
- released
77
workflow_dispatch:
8+
inputs:
9+
build_x86_64:
10+
description: "Build x86_64 wheels"
11+
type: boolean
12+
default: true
13+
build_aarch64:
14+
description: "Build aarch64 wheels"
15+
type: boolean
16+
default: true
817

918
jobs:
1019
build_wheel_linux:
1120
runs-on: ubuntu-latest
1221

22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
arch: [x86_64, aarch64]
26+
py: ['3.11', '3.12', '3.13', '3.14']
27+
1328
steps:
14-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@v5
30+
31+
- name: Decide whether to build
32+
id: decide
33+
shell: bash
34+
run: |
35+
should_build=false
36+
37+
if [ "${{ github.event_name }}" = "release" ]; then
38+
# On release: always build all matrix combinations
39+
should_build=true
40+
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
41+
if [ "${{ matrix.arch }}" = "x86_64" ] && [ "${{ inputs.build_x86_64 }}" = "true" ]; then
42+
should_build=true
43+
elif [ "${{ matrix.arch }}" = "aarch64" ] && [ "${{ inputs.build_aarch64 }}" = "true" ]; then
44+
should_build=true
45+
fi
46+
fi
47+
48+
echo "should_build=$should_build" >> "$GITHUB_OUTPUT"
1549
1650
- name: Set up QEMU
51+
if: ${{ steps.decide.outputs.should_build == 'true' }}
1752
uses: docker/setup-qemu-action@v3
1853
with:
1954
platforms: all
2055

2156
- name: Set up Docker Buildx
57+
if: ${{ steps.decide.outputs.should_build == 'true' }}
2258
uses: docker/setup-buildx-action@v3
2359

24-
- name: Build wheel for x86_64
60+
- name: Build ${{ matrix.arch }} wheel for Python ${{ matrix.py }}
61+
if: ${{ steps.decide.outputs.should_build == 'true' }}
2562
run: |
26-
docker run --rm -v ${{ github.workspace }}:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash -c "
27-
yum install -y curl && \
28-
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 && \
29-
chmod +x /usr/local/bin/bazel && \
30-
/opt/python/cp311-cp311/bin/pip install --upgrade pip setuptools wheel auditwheel && \
31-
ln -s /opt/python/cp311-cp311/bin/python3 /usr/local/bin/python3 && \
32-
cd pyscfadlib && \
33-
python3 build/build.py build --python_version=3.10 && \
34-
python3 build/build.py build --python_version=3.11 && \
35-
python3 build/build.py build --python_version=3.12 && \
36-
python3 build/build.py build --python_version=3.13 && \
37-
auditwheel repair dist/*.whl -w wheelhouse_x86_64/ && \
38-
rm -rf dist/
39-
"
40-
41-
- name: Upload x86_64 wheel
42-
uses: actions/upload-artifact@v4
43-
with:
44-
name: cuda_plugin_wheels_x86_64
45-
path: pyscfadlib/wheelhouse_x86_64/*.whl
46-
overwrite: true
63+
ARCH=${{ matrix.arch }}
64+
PY=${{ matrix.py }}
65+
TAG=${PY/./}
4766
48-
- name: Build wheel for aarch64
49-
run: |
50-
docker run --rm --platform linux/arm64 -v ${{ github.workspace }}:/project -w /project quay.io/pypa/manylinux2014_aarch64 bash -c "
51-
yum install -y curl && \
52-
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64 && \
53-
chmod +x /usr/local/bin/bazel && \
54-
/opt/python/cp311-cp311/bin/pip install --upgrade pip setuptools wheel auditwheel && \
55-
ln -s /opt/python/cp311-cp311/bin/python3 /usr/local/bin/python3 && \
56-
cd pyscfadlib && \
57-
python3 build/build.py build --python_version=3.10 --target_cpu=aarch64 && \
58-
python3 build/build.py build --python_version=3.11 --target_cpu=aarch64 && \
59-
python3 build/build.py build --python_version=3.12 --target_cpu=aarch64 && \
60-
python3 build/build.py build --python_version=3.13 --target_cpu=aarch64 && \
61-
auditwheel repair dist/*.whl -w wheelhouse_aarch64/
62-
"
63-
64-
- name: Upload aarch64 wheel
67+
if [ "$ARCH" = "x86_64" ]; then
68+
IMAGE=quay.io/pypa/manylinux_2_28_x86_64
69+
BAZEL_URL=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64
70+
PLATFORM_ARG=""
71+
else
72+
IMAGE=quay.io/pypa/manylinux_2_28_aarch64
73+
BAZEL_URL=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64
74+
PLATFORM_ARG="--platform linux/arm64"
75+
fi
76+
77+
docker run --rm $PLATFORM_ARG \
78+
-v ${{ github.workspace }}:/project \
79+
-w /project \
80+
"$IMAGE" \
81+
bash -lc "
82+
yum install -y curl
83+
curl -Lo /usr/local/bin/bazel $BAZEL_URL
84+
chmod +x /usr/local/bin/bazel
85+
86+
/opt/python/cp${TAG}-cp${TAG}/bin/pip install --no-cache-dir --upgrade pip setuptools wheel auditwheel
87+
ln -sf /opt/python/cp${TAG}-cp${TAG}/bin/python3 /usr/local/bin/python3
88+
89+
cd /project/pyscfadlib
90+
91+
if [ \"$ARCH\" = \"aarch64\" ]; then
92+
python3 build/build.py build --python_version=${PY} --target_cpu=aarch64
93+
else
94+
python3 build/build.py build --python_version=${PY}
95+
fi
96+
97+
mkdir -p wheelhouse
98+
auditwheel repair dist/*cp${TAG}*.whl -w wheelhouse/
99+
"
100+
101+
- name: Upload wheel
102+
if: ${{ steps.decide.outputs.should_build == 'true' }}
65103
uses: actions/upload-artifact@v4
66104
with:
67-
name: cuda_plugin_wheels_aarch64
68-
path: pyscfadlib/wheelhouse_aarch64/*.whl
105+
name: cuda_plugin_${{ matrix.arch }}_${{ matrix.py }}
106+
path: pyscfadlib/wheelhouse/*.whl
69107
overwrite: true
70108

71109
publish_pypi_linux:
72-
name: publish linux wheels to pypi
73110
needs: build_wheel_linux
111+
if: always()
74112
runs-on: ubuntu-latest
75-
76113
environment: release
77114
permissions:
78115
id-token: write
@@ -88,3 +125,5 @@ jobs:
88125

89126
- name: Publish to PyPI
90127
uses: pypa/gh-action-pypi-publish@release/v1
128+
with:
129+
skip-existing: true

.github/workflows/publish_pyscfad.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04]
15+
os: [ubuntu-latest]
1616
python-version: ["3.11"]
1717

1818
environment: release
1919
permissions:
2020
id-token: write
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v5
2424

2525
- name: Set up Python ${{ matrix.python-version }}
2626
uses: actions/setup-python@v5

.github/workflows/publish_pyscfadlib.yml

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,57 @@ on:
55
types:
66
- released
77
workflow_dispatch:
8+
inputs:
9+
build_linux_x86_64:
10+
description: "Build linux x86_64 wheels"
11+
type: boolean
12+
default: true
13+
build_linux_aarch64:
14+
description: "Build linux aarch64 wheels"
15+
type: boolean
16+
default: true
17+
build_macos_arm64:
18+
description: "Build macos arm64 wheels"
19+
type: boolean
20+
default: true
821

922
jobs:
10-
publish_pypi_linux_x86_aarch64:
11-
name: publish linux_x86 linux_aarch64 wheels to pypi
23+
build_wheel_linux_x86_64:
24+
if: github.event_name == 'release' || inputs.build_linux_x86_64 == true
25+
name: Build linux_x86_64 wheels
1226
runs-on: ubuntu-latest
1327

14-
environment: release
15-
permissions:
16-
id-token: write
17-
1828
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Set up QEMU
22-
uses: docker/setup-qemu-action@v3
23-
with:
24-
platforms: all
29+
- uses: actions/checkout@v5
2530

2631
- name: Build wheels
27-
uses: pypa/cibuildwheel@v2.21.3
32+
uses: pypa/cibuildwheel@v3.3.0
2833
env:
29-
CIBW_ARCHS_LINUX: x86_64 aarch64
34+
CIBW_ARCHS_LINUX: x86_64
3035
with:
3136
package-dir: pyscfadlib
3237
output-dir: pyscfadlib/wheelhouse
3338
config-file: "{package}/pyproject.toml"
3439

35-
- name: Publish to PyPI
36-
uses: pypa/gh-action-pypi-publish@release/v1
40+
- name: Upload wheels
41+
uses: actions/upload-artifact@v4
3742
with:
38-
packages-dir: pyscfadlib/wheelhouse
43+
name: cibw_wheels_linux_x86_64
44+
path: pyscfadlib/wheelhouse/*.whl
45+
overwrite: true
3946

40-
build_wheel_macos_x86:
41-
name: Build macos_x86 wheels
42-
runs-on: macos-13
47+
build_wheel_linux_aarch64:
48+
if: github.event_name == 'release' || inputs.build_linux_aarch64 == true
49+
name: Build linux_aarch64 wheels
50+
runs-on: ubuntu-24.04-arm
4351

4452
steps:
45-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v5
4654

4755
- name: Build wheels
48-
uses: pypa/cibuildwheel@v2.21.3
56+
uses: pypa/cibuildwheel@v3.3.0
4957
env:
50-
MACOSX_DEPLOYMENT_TARGET: "10.14"
58+
CIBW_ARCHS_LINUX: aarch64
5159
with:
5260
package-dir: pyscfadlib
5361
output-dir: pyscfadlib/wheelhouse
@@ -56,19 +64,20 @@ jobs:
5664
- name: Upload wheels
5765
uses: actions/upload-artifact@v4
5866
with:
59-
name: cibw_wheels_macos_x86
67+
name: cibw_wheels_linux_aarch64
6068
path: pyscfadlib/wheelhouse/*.whl
6169
overwrite: true
6270

6371
build_wheel_macos_arm64:
72+
if: github.event_name == 'release' || inputs.build_macos_arm64 == true
6473
name: Build macos_arm64 wheels
65-
runs-on: macos-14
74+
runs-on: macos-latest
6675

6776
steps:
68-
- uses: actions/checkout@v4
77+
- uses: actions/checkout@v5
6978

7079
- name: Build wheels
71-
uses: pypa/cibuildwheel@v2.21.3
80+
uses: pypa/cibuildwheel@v3.3.0
7281
env:
7382
CMAKE_OSX_ARCHITECTURES: arm64;x86_64
7483
with:
@@ -83,9 +92,16 @@ jobs:
8392
path: pyscfadlib/wheelhouse/*.whl
8493
overwrite: true
8594

86-
publish_pypi_macos_x86:
87-
name: publish macos_x86 wheels to pypi
88-
needs: build_wheel_macos_x86
95+
publish_pypi:
96+
name: publish wheels to pypi
97+
needs: [build_wheel_linux_x86_64, build_wheel_linux_aarch64, build_wheel_macos_arm64]
98+
if: |
99+
always() &&
100+
(
101+
needs.build_wheel_linux_x86_64.result == 'success' ||
102+
needs.build_wheel_linux_aarch64.result == 'success' ||
103+
needs.build_wheel_macos_arm64.result == 'success'
104+
)
89105
runs-on: ubuntu-latest
90106

91107
environment: release
@@ -96,31 +112,12 @@ jobs:
96112
- name: Download wheels
97113
uses: actions/download-artifact@v4
98114
with:
99-
name: cibw_wheels_macos_x86
100115
path: dist
116+
merge-multiple: true
101117

102118
- run: ls -R dist
103119

104120
- name: Publish to PyPI
105121
uses: pypa/gh-action-pypi-publish@release/v1
106-
107-
publish_pypi_macos_arm64:
108-
name: publish macos_arm64 wheels to pypi
109-
needs: build_wheel_macos_arm64
110-
runs-on: ubuntu-latest
111-
112-
environment: release
113-
permissions:
114-
id-token: write
115-
116-
steps:
117-
- name: Download wheels
118-
uses: actions/download-artifact@v4
119122
with:
120-
name: cibw_wheels_macos_arm64
121-
path: dist
122-
123-
- run: ls -R dist
124-
125-
- name: Publish to PyPI
126-
uses: pypa/gh-action-pypi-publish@release/v1
123+
skip-existing: true

.github/workflows/run_test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ export OMP_NUM_THREADS=1
77

88
coverage erase
99

10-
MODULES=("scipy" "gto" "scf" "dft" "cc" "fci" "gw" "mp" "tdscf" "lo" "pbc")
10+
MODULES=("scipy" "gto" "cc" "fci" "gw" "mp" "tdscf" "lo" "pbc" "lno")
11+
12+
FAILED=0
13+
14+
pytest "./tests" --cov=pyscfad --cov-report=xml --verbosity=1 --durations=5 --cov-append || FAILED=1
1115

1216
for mod in "${MODULES[@]}"; do
13-
pytest "./pyscfad/$mod" --cov=pyscfad --cov-report=xml --verbosity=1 --durations=5 --cov-append
17+
pytest "./pyscfad/$mod" --cov=pyscfad --cov-report=xml --verbosity=1 --durations=5 --cov-append || FAILED=1
1418
done
1519

1620
#coverage report -m
1721
coverage xml
22+
23+
if [ "$FAILED" -ne 0 ]; then
24+
echo "One or more test modules failed."
25+
exit 1
26+
fi

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ disable=abstract-method,
163163
consider-using-in,
164164
invalid-unary-operand-type,
165165
unnecessary-lambda-assignment,
166+
unbalanced-tuple-unpacking,
166167

167168

168169
[REPORTS]

0 commit comments

Comments
 (0)