Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e144e7
.gitignore: ignore CMakeCache.txt and CMakeFiles
gsmecher Dec 15, 2025
f9cff67
msvc: don't define FILENAME_MAX if it already exists
gsmecher Dec 16, 2025
3baa45e
Windows: MSVC: Poison GD_TRUNC for now - it is unsafe to unlink while…
gsmecher Dec 16, 2025
fe8536d
big_test.py (Python tests): Python 2.x -> 3.x exception update
gsmecher Dec 15, 2025
2355082
big_test.py (Python tests): gracefully handle builds without regex/pc…
gsmecher Dec 16, 2025
f99b653
big_test.py (Python tests): CheckEOS: escape input before using re.se…
gsmecher Dec 16, 2025
5092790
big_test.py (Python tests): use path.join for "expected results" with…
gsmecher Dec 16, 2025
7053593
bindings/python: callback.py tests: win32 portability (CRLF and path …
gsmecher Dec 17, 2025
c3be171
cmake modernization and python bindings
gsmecher Dec 14, 2025
da9913b
CMake: correctly wrangle tests with exit code 77 (autotools conventio…
gsmecher Dec 15, 2025
a77fb0a
bindings/python: move pyproject.toml to CMake backend
gsmecher Dec 15, 2025
ddbb147
Github workflows: add CMake regression tests and Windows wheels
gsmecher Dec 16, 2025
817c385
test/c89*: place GD_C89_API in an #ifndef guard to squash redefinitio…
gsmecher Dec 16, 2025
1c7ab3c
test/version_5: fix #ifdef within macro expansion
gsmecher Dec 16, 2025
39d279c
Remove HAVE_CONFIG_H macro entirely
gsmecher Dec 16, 2025
049f87b
.github/workflows/package.yml: upgrade cibuildwheel; add Python 3.13/…
gsmecher Dec 17, 2025
030e0d1
bindings/python/pyproject.toml: Teach scikit-build to extract the ver…
gsmecher Dec 17, 2025
ca9b776
package.yml: wheel builder: no need to SKIP Python 3.6/3.7 any more
gsmecher Dec 17, 2025
d8852ed
CMake/wheels: properly configure and install utils (checkdirfile, dir…
gsmecher Dec 18, 2025
6ead649
MSVC: work around #define snprintf _snprintf in stdio.h
gsmecher Dec 18, 2025
187676f
wheel build: use shared libraries; teach wheel repair steps how to fi…
gsmecher Dec 18, 2025
9b6e3cc
CMake: Add BUILD_CXX compile option; disable it for pyproject.toml en…
gsmecher Dec 18, 2025
fbdfa26
CMake: Correct .dll placement for Windows
gsmecher Dec 19, 2025
4dbcfe8
CMake: extract GETDATA_VERSION macros from m4/version.m4
gsmecher Dec 19, 2025
a5eef49
bindings/python: fix encoding_support return codes
gsmecher Jan 26, 2026
f85bb2a
wheel build: teach arm64 macos to find, build, and install plugins
gsmecher Feb 5, 2026
7e62344
wheel build: restructure .whl files; statically link
gsmecher Feb 6, 2026
a1a001e
pyproject.toml: parse version from m4/version.m4
gsmecher Feb 6, 2026
ee05e9c
CMake: correctly parse .so versioning information from m4/version.m4
gsmecher Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/bootstrap.sh

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/cmake-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CMake CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
cmake-build-test:
name: CMake on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
deps: sudo apt-get update && sudo apt-get install -y cmake bzip2 gzip xz-utils flac zip unzip libbz2-dev liblzma-dev libflac-dev libpcre3-dev libzzip-dev
- os: macos-latest
deps: brew install --quiet cmake bzip2 flac xz pcre libzzip
- os: windows-latest
deps: choco install cmake --no-progress

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Python dependencies
run: python -m pip install numpy>2

- name: Install system dependencies
run: ${{ matrix.deps }}

- name: Configure CMake
working-directory: cmake
run: cmake -B build -DBUILD_PYTHON=ON -DGD_TEST=ON

- name: Build
working-directory: cmake
run: cmake --build build --config Release

- name: Run tests
working-directory: cmake
run: ctest --test-dir build --output-on-failure --build-config Release --no-tests=error
93 changes: 34 additions & 59 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,15 @@ jobs:
matrix:
include:
# macos-15-intel for x86_64 (min macOS 15.0), macos-14 for ARM (min macOS 14.0)
- os: macos-15-intel
python: '3.9'
build: 'cp39-macosx_x86_64'
target: '15.0'
prefix: /usr/local

- os: macos-15-intel
python: '3.10'
build: 'cp310-macosx_x86_64'
target: '15.0'
prefix: /usr/local

- os: macos-15-intel
python: '3.11'
build: 'cp311-macosx_x86_64'
target: '15.0'
prefix: /usr/local

- os: macos-15-intel
python: '3.12'
build: 'cp312-macosx_x86_64'
build: 'cp*-macosx_x86_64'
target: '15.0'
prefix: /usr/local

- os: macos-14
python: '3.9'
build: 'cp39-macosx_arm64'
target: '14.0'
prefix: /opt/homebrew

- os: macos-14
python: '3.10'
build: 'cp310-macosx_arm64'
target: '14.0'
prefix: /opt/homebrew

- os: macos-14
python: '3.11'
build: 'cp311-macosx_arm64'
target: '14.0'
prefix: /opt/homebrew

- os: macos-14
python: '3.12'
build: 'cp312-macosx_arm64'
build: 'cp*-macosx_arm64'
target: '14.0'
prefix: /opt/homebrew

Expand All @@ -69,6 +33,11 @@ jobs:
build: 'cp*-manylinux_x86_64'
prefix: /usr

- os: windows-latest
python: '3.12'
build: 'cp*-win_amd64'
prefix: 'C:\Program Files'

steps:
- name: Setup environment
run: echo "PREFIX=${{ matrix.prefix }}" >> $GITHUB_ENV
Expand All @@ -87,43 +56,49 @@ jobs:
- name: Setup macOS environment
if: runner.os == 'macOS'
run: |
brew install automake libtool
echo "MACOSX_DEPLOYMENT_TARGET=${{ matrix.target }}" >> $GITHUB_ENV
echo CPPFLAGS="`python3-config --includes`" >> $GITHUB_ENV

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
run: python -m pip install cibuildwheel==3.3.0

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse bindings/python
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: cp36* cp37* cp38*
CIBW_SKIP: cp38*
CIBW_BEFORE_ALL_LINUX: >
yum install -y bzip2-devel flac-devel xz-devel pcre-devel zziplib-devel &&
.github/workflows/bootstrap.sh --disable-python &&
make
yum install -y cmake bzip2-devel flac-devel xz-devel pcre-devel zziplib-devel
CIBW_BEFORE_ALL_MACOS: >
brew install bzip2 flac xz pcre libzzip &&
.github/workflows/bootstrap.sh --disable-python &&
make
brew install --quiet cmake bzip2 flac xz pcre libzzip
CIBW_BEFORE_ALL_WINDOWS: >
choco install cmake --no-progress
CIBW_ENVIRONMENT_MACOS: >
PKG_CONFIG_PATH=${{ matrix.prefix }}/lib/pkgconfig
PREFIX=${{ matrix.prefix }}
CIBW_BEFORE_BUILD: >
python -m pip install "numpy>=2.0" &&
.github/workflows/bootstrap.sh &&
make -C bindings/python pyconstants.c
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH=$PWD/src/.libs auditwheel repair -w {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=$PWD/src/.libs delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
python -m pip install "scikit-build-core>=0.5" "numpy>=2.0"
CIBW_BEFORE_BUILD_WINDOWS: >
pip install delvewheel "scikit-build-core>=0.5" "numpy>=2.0"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
delvewheel repair --extract-dir {dest_dir}\..\extract --add-path {dest_dir}\..\extract\bin -vv -w {dest_dir} {wheel}
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_COMMAND: >
cd {package}/test &&
PYTHONPATH=`python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])'`:$PYTHONPATH make check
CIBW_TEST_COMMAND_LINUX: >
python -c "import pygetdata; print(f'pygetdata version: {pygetdata.__version__}')" &&
cd {project}/bindings/python/test &&
python big_test.py
CIBW_TEST_COMMAND_MACOS: >
python -c "import pygetdata; print(f'pygetdata version: {pygetdata.__version__}')" &&
cd {project}/bindings/python/test &&
python big_test.py
CIBW_TEST_COMMAND_WINDOWS: >
python -c "import pygetdata; print(f'pygetdata version: {pygetdata.__version__}')" &&
cd /d {project}\bindings\python\test &&
python big_test.py

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-wheel-${{ matrix.os }}-${{ matrix.python }}
name: cibw-wheel-${{ matrix.os }}
path: ./wheelhouse/pygetdata*.whl

upload_pypi:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ libpath_mangled
Makefile
Makefile.in

CMakeFiles
CMakeCache.txt

/*.zip
/*.tar.*
/*.sig
Expand Down
2 changes: 0 additions & 2 deletions bindings/cxx/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
// along with GetData; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifdef HAVE_CONFIG_H
#include "gd_config.h"
#endif

/* To avoid including stuff out of tree, we include everything here,
* even though getdata/dirfile.h will try to include it again.
Expand Down
2 changes: 0 additions & 2 deletions bindings/cxx/test/big_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
// along with GetData; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifdef HAVE_CONFIG_H
#include "gd_config.h"
#endif
#undef GETDATA_LEGACY_API

#include "getdata/dirfile.h"
Expand Down
4 changes: 1 addition & 3 deletions bindings/idl/getdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
#undef _POSIX_C_SOURCE
#undef _SVID_SOURCE

#ifdef HAVE_CONFIG_H
# include "gd_config.h"
#endif
#include "gd_config.h"

#ifdef GD_EXTERNAL
# include <complex.h>
Expand Down
4 changes: 2 additions & 2 deletions bindings/make_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
* along with GetData; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include "gd_config.h"
#endif

#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#define GD_NO_LEGACY_API
#include "getdata.h"
Expand Down
2 changes: 0 additions & 2 deletions bindings/matlab/matlab.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifdef HAVE_CONFIG_H
#include "gd_config.h"
#endif

#ifdef GD_EXTERNAL
# define GD_C89_API
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/pygetdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ static PyObject *gdpy_encoding_support(struct gdpy_fragment_t *self,

n = gd_encoding_support(enc);

if (n == 0) {
if (n < 0) {
Py_INCREF(Py_None);
dreturn("%p", Py_None);
return Py_None;
Expand Down
24 changes: 17 additions & 7 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2.0"]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core>=0.5", "numpy>=2.0"]
build-backend = "scikit_build_core.build"

[project]
name = "pygetdata"
dependencies = ["numpy>=1.7"]
dynamic = ["version"]

[tool.setuptools]
script-files = ["../../util/dirfile2ascii", "../../util/checkdirfile"]
[tool.scikit-build]
cmake.source-dir = "../../cmake"
cmake.build-type = "Release"
cmake.args = ["-DBUILD_PYTHON=ON", "-DGD_TEST=OFF", "-DGD_UTIL=ON", "-DBUILD_CXX=OFF"]
install.components = ["Runtime"]
wheel.install-dir = "."

[tool.setuptools_scm]
version_scheme = "only-version"
local_scheme = "no-local-version"
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "../../m4/version.m4"
regex = '''
m4_define\(getdata_major,\s*(?P<major>\d+)\)[\s\S]*
m4_define\(getdata_minor,\s*(?P<minor>\d+)\)[\s\S]*
m4_define\(getdata_revision,\s*(?P<micro>\d+)\)
'''
result = "{major}.{minor}.{micro}"

1 change: 0 additions & 1 deletion bindings/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ setup(
include_dirs = includes,
library_dirs = [ join(libbuild_dir, '.libs') ],
libraries = [ 'getdata' ],
define_macros = [ ('HAVE_CONFIG_H','1') ]
)
]
)
16 changes: 8 additions & 8 deletions bindings/python/test/big_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def B(s):
def CheckOK(t):
global ne
ne+=1
print ("e[", t, "] =", sys.exc_info()[0], sys.exc_value)
print ("e[", t, "] =", sys.exc_info()[0], sys.exc_info()[1])

def CheckOK2(t,m):
global ne
ne+=1
print ("e[", t, ",", m, "] =", sys.exc_info()[0], sys.exc_value)
print ("e[", t, ",", m, "] =", sys.exc_info()[0], sys.exc_info()[1])

def CheckException(t,g):
global ne
Expand Down Expand Up @@ -88,7 +88,7 @@ def CheckSimple2(t,m,v,g):

def CheckEOS(t,v,g):
global ne
if (re.search(g + "$", v) == None):
if (re.search(re.escape(g) + "$", v) == None):
ne+=1
print ("n[", t, "] =", v, "expected", g)

Expand Down Expand Up @@ -641,7 +641,7 @@ def CheckEOS(t,v,g):
f = d.fragment(0)
except:
CheckOK(64)
CheckEOS(64,f.name,"dirfile/format")
CheckEOS(64,f.name,os.path.join("dirfile","format"))

# 65: nfragments check
try:
Expand Down Expand Up @@ -1053,7 +1053,7 @@ def CheckEOS(t,v,g):
n = d.raw_filename("data")
except:
CheckOK(116)
CheckEOS(116,n,"dirfile/data")
CheckEOS(116,n,os.path.join("dirfile","data"))

# 117: reference check
try:
Expand Down Expand Up @@ -1976,7 +1976,7 @@ def CheckEOS(t,v,g):
n = d.linterp_tablename("linterp")
except:
CheckOK(241)
CheckEOS(241,n,"dirfile/lut")
CheckEOS(241,n,os.path.join("dirfile","lut"))

# 242: mcarrays
try:
Expand Down Expand Up @@ -2247,9 +2247,9 @@ def CheckEOS(t,v,g):
# 305: gd_match_entries
try:
n = d.match_entries(regex='^lin', fragment=0)
CheckSimple2(305, 1, n, [ B('lincom'), B('linterp') ])
except:
CheckOK2(305, 0)
CheckSimple2(305, 1, n, [ B('lincom'), B('linterp') ])
CheckException2(305, 0, pygetdata.UnsupportedError) # Expected when regex unsupported

# 306: gd_open_limit
try:
Expand Down
Loading
Loading