Skip to content

Commit 29c2e3c

Browse files
authored
Merge pull request #264 from mattip/use-version
Replace the 'VERSION = ' in Makefile.rule with the one from pyproject.toml
2 parents 4e20687 + 68a69e6 commit 29c2e3c

File tree

12 files changed

+268
-41
lines changed

12 files changed

+268
-41
lines changed

.github/workflows/checks.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check Changelog
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6.0.1
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Check version differs from main
17+
run: |
18+
version=$(grep "^version = " pyproject.toml | sed 's/version = "//;s/"//')
19+
main_version=$(git show origin/main:pyproject.toml | grep "^version = " | sed 's/version = "//;s/"//')
20+
if [[ "$version" == "$main_version" ]]; then
21+
echo "ERROR: pyproject.toml version ($version) is the same as main ($main_version)"
22+
echo "Please bump the version before submitting a PR."
23+
exit 1
24+
fi
25+
echo "Version check passed: $version (main is $main_version)"
26+
27+
- name: Check changelog has entry for version
28+
run: |
29+
version=$(grep "^version = " pyproject.toml | sed 's/version = "//;s/"//')
30+
if ! grep -q "^### $version " CHANGELOG.md; then
31+
echo "ERROR: CHANGELOG.md has no entry for $version"
32+
echo "Please run tools/update_changelog.sh and edit the entry before submitting."
33+
exit 1
34+
fi
35+
echo "Changelog check passed: found entry for $version"

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
workflow_dispatch:
55
inputs:
66
environment:
7-
description: Which PyPI environment to upload to, if any
7+
description: |
8+
Which PyPI environment to upload to?
9+
Be sure to push an annotated tag to 'main' before choosing 'pypi'
810
required: true
911
type: choice
1012
options: [ "none", "testpypi", "pypi" ]

CHANGELOG.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
## OpenBLAS v0.3.31.126 (v0.3.31-126-g55b16e59)
2+
3+
### 0.3.31.126.6 (2026-03-17)
4+
- Replace the VERSION = in Makefile.rule with the one from pyproject.toml
5+
6+
### 0.3.31.126.5 (2026-03-12)
7+
- use single workflow step for publishing to PyPI
8+
9+
### 0.3.31.126.4 (2026-03-12)
10+
- refactor, add pypi publishing
11+
12+
### 0.3.31.126.3 (2026-03-10)
13+
- disambiguate bewteen a NIGHTLY build and a publish build
14+
15+
### 0.3.31.126.2 (2026-03-10)
16+
- Trusted publishing work
17+
18+
### 0.3.31.126.1 (2026-03-08)
19+
- fix bad re-zip: use 'w' not 'a'
20+
21+
### 0.3.31.126.0 (2026-03-06)
22+
- update to 0.3.31-126-g55b16e59
23+
24+
## OpenBLAS v0.3.31.22 (v0.3.31-22-g5ffbf38b)
25+
26+
### 0.3.31.22.1 (2026-02-01)
27+
- feat: build riscv64+glibc wheel
28+
29+
### 0.3.31.22.0 (2026-01-20)
30+
- update to v0.3.31-22-g5ffbf38b
31+
32+
## OpenBLAS v0.3.30.443 (v0.3.30-443-g52ec7faf)
33+
34+
### 0.3.30.443.1 (2026-01-14)
35+
- fix typo which created bad pkgconfig file on arm64 32-bit interface
36+
37+
### 0.3.30.443.0 (2026-01-11)
38+
- version
39+
40+
## OpenBLAS v0.3.30.359 (v0.3.30-359-g29fab2b9)
41+
42+
### 0.3.30.359.2 (2026-01-11)
43+
- update OpenBLAS version
44+
45+
### 0.3.30.359.1 (2025-12-17)
46+
- cleanup and single-use OPENBLAS_COMMIT via a file
47+
48+
### 0.3.30.359.0 (2025-11-30)
49+
- Use clang instead of gcc to build on Linux
50+
51+
## OpenBLAS v0.3.30.349
52+
53+
### 0.3.30.349.1 (2025-11-29)
54+
- Always use gfortran-11 on macos
55+
56+
### 0.3.30.349.0 (2025-11-17)
57+
- update OpenBLAS version to v0.3.30-322-gef6f9762
58+
59+
## OpenBLAS v0.3.30.0
60+
61+
### 0.3.30.0.7 (2025-11-03)
62+
- patch out extraneous lock/unlock
63+
64+
### 0.3.30.0.6 (2025-10-29)
65+
- use gfortran-11 on macos-x86_64 build
66+
67+
### 0.3.30.0.5 (2025-10-23)
68+
- cleanup clean_code, remove repo_dir, checkout OpenBLAS commit in ci-before-build.sh
69+
70+
### 0.3.30.0.4 (2025-10-22)
71+
- patch to remove OpenBLAS PR 4741, cleanup unused bash code
72+
73+
### 0.3.30.0.3 (2025-10-21)
74+
- Use cibuildwheel to replace multibuild
75+
76+
### 0.3.30.0.2 (2025-10-12)
77+
- Using USE_THREADS & NUM_THREADS while building openblas for win arm64
78+
79+
### 0.3.30.0.0 (2025-06-26)
80+
- update OpenBLAS to 0.3.30
81+
82+
## OpenBLAS v0.3.29.265
83+
84+
### 0.3.29.265.2 (2025-06-09)
85+
- fix cmake and README
86+
87+
### 0.3.29.265.1 (2025-06-06)
88+
- Refactor confusing BUILD_BITS variable in CI
89+
90+
### 0.3.29.265.0 (2025-06-04)
91+
- Refactor CI to produce 64-bit integer interface wheels for WoA
92+
93+
## OpenBLAS v0.3.29.0
94+
95+
### 0.3.29.0.0 (2025-04-03)
96+
- Add build script for Windows on ARM64

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ https://anaconda.org/scientific=python-nightly-wheels/scipy_openblas64 via
3434
There are workflow triggers for repo admins. They can trigger a testpypi build
3535
or a pypi build with the publish workflow, which will upload the wheels using
3636
trusted publishing. In order to publish to PyPI, there must be a tag at the HEAD
37-
of the branch used to publish. Use annotated tags:
37+
of the branch used to publish. After merging a PR, be sure to update to main and
38+
use annotated tags:
3839
```
40+
git checkout main; git pull
3941
git tag -a v0.3.31.126.4 -m"fixed something"
4042
```
4143
The wheel is self-contained, it includes all needed gfortran support libraries.
42-
On windows, this is a single DLL.
44+
On windows, this is a single DLL.
4345

4446
## Buildtime
4547

ci-before-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ if [[ "$NIGHTLY" = "true" ]]; then
5151
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
5252
else
5353
export OPENBLAS_COMMIT=$(cat openblas_commit.txt)
54+
version=$(grep "^version =" pyproject.toml | sed 's/version = "//;s/"//')
5455
fi
56+
sed -e "s/^VERSION = .*/VERSION = ${version}/" -i.bak OpenBLAS/Makefile.rule
5557
echo "creating wheel from $OPENBLAS_COMMIT (NIGHTLY is $NIGHTLY)"
5658

5759
if [ "$(uname)" != "Darwin" ]; then

ci-test.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ if [ "$(uname)" == "Darwin" -a "${PLAT}" == "x86_64" ]; then
1212
which python3.9
1313
PYTHON="arch -x86_64 python3.9"
1414
fi
15+
16+
# Make sure the module works and that the version strings match
17+
# cibuildwheel will install the wheel automatically
1518
if [ "${INTERFACE64}" != "1" ]; then
16-
# cibuildwheel will install the wheel automatically
17-
# $PYTHON -m pip install --no-index --find-links /tmp/cibuildwheel/repaired_wheel scipy_openblas32
18-
$PYTHON -m scipy_openblas32
19+
config_str=$($PYTHON -m scipy_openblas32)
1920
else
20-
# $PYTHON -m pip install --no-index --find-links /tmp/cibuildwheel/repaired_wheel scipy_openblas64
21-
$PYTHON -m scipy_openblas64
21+
config_str=$($PYTHON -m scipy_openblas64)
22+
fi
23+
version=$($PYTHON -m pip list | grep scipy-openblas | sed 's/.*[[:space:]]//')
24+
if [[ "$config_str" != *"$version"* ]]; then
25+
echo "config_str version does not match the pyproject.toml"
26+
exit -1
2227
fi
2328

29+
30+
2431
$PYTHON -m pip install pkgconf
2532
$PYTHON -m pkgconf scipy-openblas --cflags

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "scipy-openblas64"
1111
# v0.3.31-126-g55b16e59
12-
version = "0.3.31.126.5"
12+
version = "0.3.31.126.6"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"

tools/build_steps_win_arm64.bat

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
:: Build script for scipy_openblas wheel on Windows on ARM64
2-
3-
:: Usage: build_steps_win_arm64.bat [build_bits] [if_bits]
4-
:: e.g build_steps_win_arm64.bat 64 64
5-
6-
:: build_bits (default binary architecture, 32 or 64, unspec -> 64).
7-
:: if_bits (default interface size, 32 or 64, unspec -> 32)
8-
:: If INTERFACE64 environment variable is 1, then if_bits defaults to 64
9-
:: Expects these binaries on the PATH:
10-
:: clang-cl, flang-new, cmake, perl
11-
:: First commit containing WoA build fixes.
12-
:: Minimum OpenBLAS commit to build; we'll update to this if commit not
13-
:: present.
1+
REM Build script for scipy_openblas wheel on Windows on ARM64
2+
3+
REM Usage: build_steps_win_arm64.bat [build_bits] [if_bits]
4+
REM e.g build_steps_win_arm64.bat 64 64
5+
6+
REM build_bits (default binary architecture, 32 or 64, unspec -> 64).
7+
REM if_bits (default interface size, 32 or 64, unspec -> 32)
8+
REM If INTERFACE64 environment variable is 1, then if_bits defaults to 64
9+
REM Expects these binaries on the PATH:
10+
REM clang-cl, flang-new, cmake, perl
11+
REM First commit containing WoA build fixes.
12+
REM Minimum OpenBLAS commit to build; we'll update to this if commit not
13+
REM present.
1414
set first_woa_buildable_commit="de2380e5a6149706a633322a16a0f66faa5591fc"
1515

1616
@echo off
@@ -33,7 +33,7 @@ if "%2"=="" (
3333
)
3434
echo Building for %build_bits%-bit binary, %if_bits%-bit interface...
3535

36-
:: Define destination directory
36+
REM Define destination directory
3737
pushd "%~dp0\.."
3838
set "ob_out_root=%CD%\local\scipy_openblas"
3939
set "ob_64=%ob_out_root%64"
@@ -54,13 +54,13 @@ if "%if_bits%"=="64" (
5454
)
5555
)
5656

57-
:: Clone OpenBLAS
57+
REM Clone OpenBLAS
5858
echo Cloning OpenBLAS repository with submodules...
5959
git submodule update --init --recursive OpenBLAS
6060
if errorlevel 1 exit /b 1
6161
set /p OPENBLAS_COMMIT=<openblas_commit.txt
6262

63-
:: Enter OpenBLAS directory and checkout buildable commit
63+
REM Enter OpenBLAS directory and checkout buildable commit
6464
cd OpenBLAS
6565
git checkout %OPENBLAS_COMMIT%
6666
git merge-base --is-ancestor %first_woa_buildable_commit% HEAD 2>NUL
@@ -70,30 +70,38 @@ if errorlevel 1 (
7070
exit /b 2
7171
)
7272

73-
:: Patch
73+
REM Patch
7474
for /r %%f in (..\patches\*) do git apply %%f
7575
if errorlevel 1 exit /b 1
7676

77-
:: Set suffixed-ILP64 flags
77+
REM Patch VERSION
78+
REM version=$(grep "^version =" ../pyproject.toml | sed 's/version = "//;s/"//')
79+
REM sed -e "s/^VERSION = .*/VERSION = ${version}/" -i.bak Makefile.rule
80+
81+
for /f "tokens=3 delims= " %%v in ('findstr /b "version = " ..\pyproject.toml') do set version=%%v
82+
set version=%version:"=%
83+
powershell -Command "(Get-Content OpenBLAS/Makefile.rule) -replace '^VERSION = .*', 'VERSION = %version%' | Set-Content Makefile.rule"
84+
85+
REM Set suffixed-ILP64 flags
7886
if "%if_bits%"=="64" (
7987
set "interface_flags=-DINTERFACE64=1 -DSYMBOLSUFFIX=64_"
8088
) else (
8189
set "interface_flags="
8290
)
8391

84-
:: Create build directory and navigate to it
92+
REM Create build directory and navigate to it
8593
if exist build (rmdir /S /Q build || exit /b 1)
8694
mkdir build || exit /b 1 & cd build || exit /b 1
8795

8896
echo Setting up ARM64 Developer Command Prompt and running CMake...
8997

90-
:: Initialize VS ARM64 environment
98+
REM Initialize VS ARM64 environment
9199
CALL "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat"
92100

93-
:: Prefer LLVM flang
101+
REM Prefer LLVM flang
94102
PATH=C:\Program Files\LLVM\bin;%PATH%
95103

96-
:: Run CMake and Ninja build
104+
REM Run CMake and Ninja build
97105

98106
set CFLAGS=-Wno-reserved-macro-identifier -Wno-unsafe-buffer-usage -Wno-unused-macros -Wno-sign-conversion -Wno-reserved-identifier
99107
cmake .. -G Ninja ^
@@ -132,13 +140,13 @@ if "%if_bits%"=="32" (
132140
cd ..
133141
)
134142

135-
:: Prepare destination directory
143+
REM Prepare destination directory
136144
cd OpenBLAS/build
137145
echo Preparing destination directory at %DEST_DIR%
138146
if not exist "%DEST_DIR%\lib\cmake\OpenBLAS" mkdir "%DEST_DIR%\lib\cmake\OpenBLAS"
139147
if not exist "%DEST_DIR%\include" mkdir "%DEST_DIR%\include"
140148

141-
:: Move library files
149+
REM Move library files
142150
echo Moving library files...
143151
if exist lib\release (
144152
move /Y lib\release\*.dll "%DEST_DIR%\lib\"
@@ -154,19 +162,19 @@ if exist lib\release (
154162
exit /b 1
155163
)
156164

157-
:: Copy CMake configuration files
165+
REM Copy CMake configuration files
158166
echo Copying CMake configuration files...
159167
if exist openblasconfig.cmake copy /Y openblasconfig.cmake "%DEST_DIR%\lib\cmake\openblas\"
160168
if exist openblasconfigversion.cmake copy /Y openblasconfigversion.cmake "%DEST_DIR%\lib\cmake\openblas\"
161169

162-
:: Copy header files
170+
REM Copy header files
163171
echo Copying generated header files...
164172
if exist generated xcopy /E /Y generated "%DEST_DIR%\include\"
165173
if exist lapacke_mangling.h copy /Y lapacke_mangling.h "%DEST_DIR%\include\"
166174
if exist openblas_config.h copy /Y openblas_config.h "%DEST_DIR%\include\"
167175

168176

169-
:: Copy LAPACKE header files
177+
REM Copy LAPACKE header files
170178
echo Copying LAPACKE header files...
171179
xcopy /Y "..\lapack-netlib\lapacke\include\*.h" "%DEST_DIR%\include\"
172180
if errorlevel 1 exit /b 1
@@ -189,14 +197,14 @@ if errorlevel 1 (
189197
exit /b 1
190198
)
191199

192-
:: Move back to the root directory
200+
REM Move back to the root directory
193201
cd ..
194202
if errorlevel 1 (
195203
echo Current directory %CD%, cannot cd ..
196204
exit /b 1
197205
)
198206

199-
:: Build the Wheel & Install It
207+
REM Build the Wheel & Install It
200208
echo Running 'python -m build' to build the wheel in %CD%
201209
python -c "import build" 2>NUL || pip install build
202210
if "%if_bits%"=="64" (
@@ -213,15 +221,15 @@ if "%if_bits%"=="32" (
213221
move /Y "%CD%\ob64_backup" "%ob_64%"
214222
)
215223

216-
:: Rename the wheel
224+
REM Rename the wheel
217225
for %%f in (dist\*any.whl) do (
218226
set WHEEL_FILE=dist\%%f
219227
set "filename=%%~nxf"
220228
set "newname=!filename:any.whl=win_arm64.whl!"
221229
ren "dist\!filename!" "!newname!"
222230
)
223231

224-
:: Locate the built wheel
232+
REM Locate the built wheel
225233
for /f %%f in ('dir /b dist\scipy_openblas*.whl 2^>nul') do set WHEEL_FILE=dist\%%f
226234

227235
if not defined WHEEL_FILE (

tools/build_steps_windows.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ OPENBLAS_VERSION=$(git describe --tags --abbrev=8)
9494
# with libquadmath
9595
patch -p1 < ../patches-windows/openblas-make-libs.patch
9696

97+
# Patch VERSION
98+
version=$(grep "^version =" ../pyproject.toml | sed 's/version = "//;s/"//')
99+
sed -e "s/^VERSION = .*/VERSION = ${version}/" -i.bak Makefile.rule
100+
97101
# Build OpenBLAS
98102
CFLAGS="$CFLAGS -fvisibility=protected -fno-ident" \
99103
make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \

tools/local_build.bat

Whitespace-only changes.

0 commit comments

Comments
 (0)